The product generation framework class containing the product generation functionality.
More...
|
| __init__ (self) |
| Constructor.
|
|
| Help (self, name=None) |
| Built-in algorithm query.
|
|
| register (self, name, module, function, Help="", strings="", ints="", floats="", seqs="") |
| Registers a new item in the registry.
|
|
| update_registry (self) |
| Re-loads the generation registry, assuming it's been modified on file.
|
|
| deregister (self, name) |
| De-registers a new item in one of the registries.
|
|
| flush (self, stupid_password) |
| Public method for dumping queue to file.
|
|
| generate (self, algorithm, files, arguments) |
| Dispatcher method.
|
|
| get_quality_controls (self) |
| Returns the registered controls.
|
|
| get_areas (self) |
| Returns the areas available to the composite generator.
|
|
| get_pcs_definitions (self) |
| Return the pcs definitions.
|
|
| job_done (self, jobid) |
|
| execute (self, command) |
| Executes a shell escape command.
|
|
| echo_args (self, arguments) |
| Pretty useless method used to check argument types.
|
|
|
| name = multiprocessing.current_process().name |
|
| logger = rave_pgf_logger.create_logger() |
|
| runner = None |
|
| queue = None |
|
| pool = None |
|
| job_done |
|
|
| _listMethods (self) |
| This method must exist for system.listMethods to work.
|
|
| _methodHelp (self, method) |
| This method must exist for system.listMethods to work.
|
|
| _queue_job (self, algorithm, files, arguments, jobid) |
| Queue a job for processing.
|
|
| _dump_queue (self, filename=rave_pgf_qtools.QFILE) |
| Dumps the job queue to XML file.
|
|
| _load_queue (self) |
| Loads the job queue from XML file.
|
|
| _run_all_jobs (self) |
| Internal executor of the product generation algorithm queue, according to how they are queued.
|
|
| _run (self, algorithm, files, arguments) |
| Internal direct executor of the product generation algorithms.
|
|
| _generate (self, algorithm, files, arguments) |
| The mother method that coordinates the product generation calls.
|
|
|
| _pid = os.getpid() |
|
int | _job_counter = 0 |
|
str | _jobid = "%i-0" % self._pid |
|
| _algorithm_registry = None |
|
| _client = None |
|
The product generation framework class containing the product generation functionality.
◆ __init__()
Lib.rave_pgf.RavePGF.__init__ |
( |
| self | ) |
|
◆ _dump_queue()
Lib.rave_pgf.RavePGF._dump_queue |
( |
| self, |
|
|
| filename = rave_pgf_qtools.QFILE ) |
|
protected |
Dumps the job queue to XML file.
Called automatically when the server is stopped.
- Parameters
-
filename | string file name to white to dump the queue |
◆ _generate()
Lib.rave_pgf.RavePGF._generate |
( |
| self, |
|
|
| algorithm, |
|
|
| files, |
|
|
| arguments ) |
|
protected |
The mother method that coordinates the product generation calls.
This method verifies the integrity of the arguments, then runs the job. If the result gets injected to the DEX, then this is also done.
- Parameters
-
algorithm | string to the desired product generation call |
files | list of file strings |
arguments | list of strings, ordered as 'key-value' pairs, so that even items are argument names and odd ones are their values. These must be parsed into their corrects formats, ie. int, float, list, etc. |
- Returns
- string either "OK" or an error with a corresponding Traceback
◆ _listMethods()
Lib.rave_pgf.RavePGF._listMethods |
( |
| self | ) |
|
|
protected |
This method must exist for system.listMethods to work.
◆ _load_queue()
Lib.rave_pgf.RavePGF._load_queue |
( |
| self | ) |
|
|
protected |
Loads the job queue from XML file.
Called automatically when the server is started, even if the queue is empty.
◆ _methodHelp()
Lib.rave_pgf.RavePGF._methodHelp |
( |
| self, |
|
|
| method ) |
|
protected |
This method must exist for system.listMethods to work.
- Parameters
-
method | string name of method for which to get help. |
◆ _queue_job()
Lib.rave_pgf.RavePGF._queue_job |
( |
| self, |
|
|
| algorithm, |
|
|
| files, |
|
|
| arguments, |
|
|
| jobid ) |
|
protected |
Queue a job for processing.
All jobs are calls to the generate method.
- Parameters
-
algorithm,an | Element object that contains all the information required to run a job. |
files,a | list of input file strings. |
arguments,a | list of argument key-value pairs. |
jobid | string unique ID of that job. |
◆ _run()
Lib.rave_pgf.RavePGF._run |
( |
| self, |
|
|
| algorithm, |
|
|
| files, |
|
|
| arguments ) |
|
protected |
Internal direct executor of the product generation algorithms.
This will automatically verify the module and reload it if it has been modified. The module is loaded, and the function specified is executed with the files and arguments lists. The function must not return anything.
- Parameters
-
algorithm | Element copied from self._algorithm_registry |
files | list of file strings |
arguments | list of verified arguments to pass to the generator |
- Returns
- the result from the algorithm, either filename or None
◆ _run_all_jobs()
Lib.rave_pgf.RavePGF._run_all_jobs |
( |
| self | ) |
|
|
protected |
Internal executor of the product generation algorithm queue, according to how they are queued.
Runs only once at startup, if there are dumped jobs in the queue.
◆ deregister()
Lib.rave_pgf.RavePGF.deregister |
( |
| self, |
|
|
| name ) |
De-registers a new item in one of the registries.
- Parameters
-
name | string name of the registry entry to de-register. |
- Returns
- string
◆ echo_args()
Lib.rave_pgf.RavePGF.echo_args |
( |
| self, |
|
|
| arguments ) |
Pretty useless method used to check argument types.
- Parameters
-
arguments | sequence of ints, floats, strings in arbitrary order. |
- Returns
- string of arguments
◆ execute()
Lib.rave_pgf.RavePGF.execute |
( |
| self, |
|
|
| command ) |
Executes a shell escape command.
- Parameters
-
command | the shell command without & |
- Returns
- : OK
◆ flush()
Lib.rave_pgf.RavePGF.flush |
( |
| self, |
|
|
| stupid_password ) |
Public method for dumping queue to file.
- Parameters
-
stupid_password | A rudimentary safeguard against sabotage. |
- Returns
- string
◆ generate()
Lib.rave_pgf.RavePGF.generate |
( |
| self, |
|
|
| algorithm, |
|
|
| files, |
|
|
| arguments ) |
Dispatcher method.
Calls the generate function that in turn creates a provisional instance of a PGF object to invoke the _generate method that does the job. The algorithm's presence in the registry is checked first.
- Parameters
-
algorithm | string to the desired product generation call |
files | list of file strings |
arguments | list of strings, ordered as 'key-value' pairs, so that even items are argument names and odd ones are their values. These must be parsed into their corrects formats, ie. int, float, list, etc. |
- Returns
- string "OK" always, which is ignored because the real work is deferred.
◆ get_areas()
Lib.rave_pgf.RavePGF.get_areas |
( |
| self | ) |
|
Returns the areas available to the composite generator.
◆ get_pcs_definitions()
Lib.rave_pgf.RavePGF.get_pcs_definitions |
( |
| self | ) |
|
Return the pcs definitions.
◆ get_quality_controls()
Lib.rave_pgf.RavePGF.get_quality_controls |
( |
| self | ) |
|
Returns the registered controls.
◆ Help()
Lib.rave_pgf.RavePGF.Help |
( |
| self, |
|
|
| name = None ) |
Built-in algorithm query.
- Parameters
-
name | string, optionally the name of the algorithm being queried. |
- Returns
- string a help text comprising the names of each registered algorithm and its descriptive text.
◆ register()
Lib.rave_pgf.RavePGF.register |
( |
| self, |
|
|
| name, |
|
|
| module, |
|
|
| function, |
|
|
| Help = "", |
|
|
| strings = "", |
|
|
| ints = "", |
|
|
| floats = "", |
|
|
| seqs = "" ) |
Registers a new item in the registry.
Re-registering an item is done in the same way.
- Parameters
-
name | string algorithm's name. |
module | string name of the module to import. |
function | string name of the function to run in the module. |
Help | string containing explanatory text for this registry entry. |
strings | string of comma-separated argument names that are strings. |
ints | string of comma-separated argument names that are integers. |
floats | string of comma-separated argument names that are floats. |
seqs | string of comma-separated argument names that are sequences. |
- Returns
- string
◆ update_registry()
Lib.rave_pgf.RavePGF.update_registry |
( |
| self | ) |
|
Re-loads the generation registry, assuming it's been modified on file.
Is this ever needed or used?
The documentation for this class was generated from the following file: