Package shelljob :: Module job :: Class Monitor
[hide private]
[frames] | no frames]

Class Monitor

source code

object --+
         |
        Monitor
Known Subclasses:

Instance Methods [hide private]
 
__init__(self, max_simul=8, feedback_timeout=5.0)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
convert_cmds(self, in_cmds)
Converts a variable format input command list to a set of Jobs.
source code
 
run(self, cmds, shell=False)
Run a series of commands and wait for their completion.
source code
 
_check_finished(self)
Process all finished items.
source code
 
_check_feedback(self)
Call gen_feedback at regular interval.
source code
 
job_finished(self, job)
(Virtual) Called when a job has completed.
source code
 
job_started(self, job)
(Virtual) Called just after a job is started.
source code
 
job_output(self, job, line)
(Virtual) Called for each line of output from a job.
source code
 
gen_feedback(self)
(Virtual) Called whenever the Monitor things feedback should be generated (in addition to the other events).
source code
 
get_jobs(self)
Get the list of jobs.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, max_simul=8, feedback_timeout=5.0)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Parameters:
  • max_simul - the maximum number of processes which can be running at the same time
  • feedback_timeout - generate progress feedback at this interval
Overrides: object.__init__

run(self, cmds, shell=False)

source code 

Run a series of commands and wait for their completion.

Parameters:
  • cmds - a list of cmds or Job's for Group.run. This will be run in parallel obeying the 'max_simul' option provided to the constructor. Using Job's directly allows you to associate additional data for use with each job -- helpful for custom monitors.

_check_finished(self)

source code 

Process all finished items.

Returns:
count of still running jobs

gen_feedback(self)

source code 

(Virtual) Called whenever the Monitor things feedback should be generated (in addition to the other events). Generally this is called for each feedback_timeout period specified in the constructor.