spmi package#

Subpackages#

Submodules#

spmi.app module#

SPMI application module.

Execute next command to get help message:

$ spmi --help
class spmi.app.Spmi(args, pm)#

Bases: object

Main aplication class.

Provides methods to start application.

Parameters:
class ArgumentsHelper(args)#

Bases: object

Command line argument container.

Provides methods to work with docopt arguments

Parameters:

args (dict) – Dictionary, returned by docopt.docopt.

property debug#

True if --debug in options.

Type:

bool

property is_clean#

True, if should clean.

Type:

bool

property is_connect#

True, if should connect to task.

Type:

bool

property is_kill#

True, if should kill.

Type:

bool

property is_list#

True, if should show list.

Type:

bool

property is_load#

True if should load.

Type:

bool

property is_start#

True, if should start.

Type:

bool

property is_status#

True, if should show status.

Type:

bool

property is_stop#

True, if should stop.

Type:

bool

property pathes#

List of pathes.

Type:

list of str

property patterns#

List of patterns.

Type:

list of str

property task_id#

ID of task.

Type:

str

class ConfigHelper(defaults=None)#

Bases: object

Manages SPMI configuration.

Settings os SPMI are stored in environment variables:

  • SPMI_PATH is path to SPMI home directory.

Parameters:

defaults (Union[dict, None]) – default settings. If None, defaults are set from DEFAULTS attribute.

DEFAULTS = {'SPMI_PATH': '~/.spmi'}#

dict Default SPMI settings.

load()#

Loads system environment variables.

Raises:

SpmiException

property path#

Path to SPMI home directory.

Type:

pathlib.Path

clean(patterns)#

Cleans all manageables corresponding to pattern.

Parameters:

pattern (str) – Pattern string.

connect(task_id)#

Prints stdout of task and prints to it stdin.

Parameters:

task_id (str) – ID of task to connect.

execute()#

Execute command from CLI.

kill(patterns)#

Kills all manageables corresponding to pattern.

Parameters:

pattern (str) – Pattern string.

load(pathes)#
show_list()#

Prints list of manageables.

start(patterns)#

Starts all manageables corresponding to pattern.

Parameters:

pattern (str) – Pattern string.

status(patterns)#

Prints status all manageables corresponding to pattern.

Parameters:

pattern (str) – Pattern string.

stop(patterns)#

Stops all manageables corresponding to pattern.

Parameters:

pattern (str) – Pattern string.

spmi.app.VERSION = 'SPMI 0.0.1'#

Version of SPMI

Type:

str

Module contents#