facio.hooks

Hook

Below is documentatin for the facio.hooks.Hook class.

class facio.hooks.Hook[source]
error(message)

Print error that does not result in an exit (Red)

Parameters:message (str) – Message to print to user
gather(message)

Common message prompting for gathering input form the end user.

Parameters:message (str) – Message to print to user
has_after()[source]

Does the hooks file contain a after list.

Returns:Bool
has_before()[source]

Does the hooks file contain a before list.

Returns:Bool
has_run(path)[source]

Has a hooks module run.

Parameters:path (str) – The hooks python module path
Returns:False if not run else the modules returned data
import_module(path)[source]

Import module to run in before or post hooks.

Parameters:path (str) – The python path to the module
load(path)[source]

Parse the hooks file.

Parameters:path (str) – Path to hooks file, locally
out(message, color=<function blue at 0x7f9c287a5848>)

Print message information to user (Blue)

Parameters:message (str) – Message to print to user

** Optional Key Word Arguments **

Parameters:color – Clint color function to use
Type:function – default blue
run_after()[source]

Run the after modules.

run_before()[source]

Run the before modules.

run_module(path)[source]

Run a before or after module.

Parameters:path – Path to the module
success(message)

Print a success message (Green)

Parameters:message (str) – Message to print to user
warning(message)

Print a warning message (Yellow)

Parameters:message (str) – Message to print to user

django.secret

class facio.hooks.django.secret.GenerateDjangoSecretKey[source]
characters = 'abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)'
generate()[source]

Generate Django secret key

Returns:str – The generated key
facio.hooks.django.secret.run()[source]

Called by the facio.hooks runner.

python.setup

class facio.hooks.python.setup.Setup[source]
get_default_path_to_python()[source]

Returns the default path to python, if virtualenv hooks has been called use that path, else use the current executing python, this should be the systems python in most cases.

Returns:str – path to python executable
get_install_arg()[source]

Gets the install args from the user, for example setup.py install or develop.

Returns:str – The install type
get_path_to_python()[source]

Gets the path to python to run setup.py against. Detect if the virtualenv hooks has run, if so the default path to python should come from the path to this virtual environment, else it should be the system default python path.

Returns:str – The path to python
log_errors(errors)[source]

Called with errors are encountered running setup.py and are logged to a setup.error.log.

Parameters:errors (str) – Errors from setup.py
run()[source]

Runs the python setup.py command.

Returns:bool – Based on return code subprocess call return code
facio.hooks.python.setup.run()[source]

Called by hooks runner, runs the setup class and returns Bool on status of the run command.

Returns:bool – The state of running setup.py

python.virtualenv

class facio.hooks.python.virtualenv.Virtualenv[source]
create()[source]

Creates a python virtual environment.

get_name()[source]

Returns the name for the virtualenv - gathered from user input with the default value being the project name from facio state.

Returns:str – Virtual environment name
get_path()[source]

The path to where the virtual environment should be created, the user is prompted to input this path, default will be ~/.virtualenvs.

Returns:str – The path to where the virtual environment
facio.hooks.python.virtualenv.run()[source]

Called from facio.hooks runner.

Returns:str – Path to the created virtual environment

Table Of Contents

Related Topics

This Page