Script Reference
The scripts
Module
Console scripts.
- class chrysalio.scripts.Script(args, create_all, includes=None, dbsession_factory=None)[source]
Base class for a script which reads the INI file and interacts with the database.
- Parameters:
args (argparse.Namespace) – Command line arguments.
create_all (bool) – If
True
, it creates all the tables, otherwise, it checks if the tableusers
exists with at least one user.includes (list) – (optional) List of hard coding includes.
dbsession_factory (sqlalchemy.orm.session.sessionmaker) – (optional) Function to create session.
- classmethod argument_parser(description)[source]
Create an argument parser object to parse command line arguments.
- Parameters:
description (str) – Description of the script.
- Return type:
- classmethod arguments(parser, args=None, filemode='w')[source]
Retrieve arguments from parser, check them and setup logging.
- Parameters:
parser (argparse.ArgumentParser) – Configuration parser object.
args (list) – (optional) Command line arguments (for testing).
filemode (str) – File mode for logging (
'w'
or'a'
).
- Return type:
The scripts.cioexecute
Script
Console script to execute jobs.
- class cioservice.scripts.cioexecute.Execute(args, includes=None, dbsession_factory=None)[source]
Class to execute jobs.
- Parameters:
args (argparse.Namespace) – Command line arguments.
includes (list) – (optional) List of hard coding includes.
dbsession_factory (sqlalchemy.orm.session.sessionmaker) – (optional) Function to create session.