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

Class FileMonitor

source code

object --+    
         |    
   Monitor --+
             |
            FileMonitor

A monitor which writes output to log files. Simple textual feedback will also be reported to the console.

Instance Methods [hide private]
 
__init__(self, file_pattern='/tmp/job_{}.log', meta=True, **kwargs)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
get_log_name(self, job)
(Virtual) get the log of the log file to use.
source code
 
job_finished(self, job)
Called when a job has completed.
source code
 
job_started(self, job)
Called just after a job is started.
source code
 
job_output(self, job, line)
Called for each line of output from a job.
source code
 
gen_feedback(self)
Called whenever the Monitor things feedback should be generated (in addition to the other events).
source code

Inherited from Monitor: convert_cmds, get_jobs, run

Inherited from Monitor (private): _check_feedback, _check_finished

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, file_pattern='/tmp/job_{}.log', meta=True, **kwargs)
(Constructor)

source code 

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

Parameters:
  • file_pattern - will be formatted with the job.id to produce filenames. These files are overwritten when a job starts and record the output of the job.
  • meta - if True then meta information about the job will also be recorded to the logfile
  • kwargs - the remaining arguments are passed to the Monitor constructor
Overrides: object.__init__
(inherited documentation)

job_finished(self, job)

source code 

Called when a job has completed.

Overrides: Monitor.job_finished

job_started(self, job)

source code 

Called just after a job is started.

Overrides: Monitor.job_started

job_output(self, job, line)

source code 

Called for each line of output from a job.

Overrides: Monitor.job_output

gen_feedback(self)

source code 

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.

Overrides: Monitor.gen_feedback