spmi package#
Subpackages#
- spmi.core package
- Subpackages
- Submodules
- spmi.core.manageable module
Manageable
Manageable.FileSystemHelper
Manageable.LoadHelper
Manageable.MetaDataHelper
Manageable.destruct()
Manageable.from_descriptor()
Manageable.from_directory()
Manageable.from_directory_unknown()
Manageable.is_correct_directory()
Manageable.is_correct_meta_data()
Manageable.kill()
Manageable.register()
Manageable.start()
Manageable.state
Manageable.status
Manageable.status_string()
Manageable.term()
ManageableException
ManageableStatus
manageable()
- spmi.core.pool module
- Module contents
- spmi.utils package
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:
args (
dict
) –docopt
arguments.pm (
spmi.utils.pattern.PatternMatcher
) – Pattern matcher.
- class ArgumentsHelper(args)#
Bases:
object
Command line argument container.
Provides methods to work with
docopt
arguments- Parameters:
args (
dict
) – Dictionary, returned bydocopt.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
ofstr
- property patterns#
List of patterns.
- Type:
list
ofstr
- 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 fromDEFAULTS
attribute.
- DEFAULTS = {'SPMI_PATH': '~/.spmi'}#
dict
Default SPMI settings.
- load()#
Loads system environment variables.
- Raises:
- 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