Package peppy :: Module major :: Class JobControlMixin
[frames] | no frames]

Class JobControlMixin

                       object --+    
                                |    
lib.processmanager.JobOutputMixin --+
                                    |
                       object --+   |
                                |   |
        lib.userparams.ClassPrefs --+
                                    |
                                   JobControlMixin
Known Subclasses:

Process handling mixin to run scripts based on the current major mode.

This mixin provides some common interfacing to run scripts that are tied to a major mode. An interpreter classpref is provided that links a major mode to a binary file to run scripts in that mode. Actions like RunScript and StopScript are tied to the presense of this mixin and will be automatically enabled when they find a mode has the interpreter_exe classpref.

Nested Classes

Inherited from lib.userparams.ClassPrefs: __metaclass__

Instance Methods
 
finishedCallback(self, job)
Callback from the JobOutputMixin when the job terminates.
 
getCommandLine(self, bangpath=None)
Return the entire command line of the job to be started.
 
getInterpreterArgs(self)
Hook to pass arguments to the command interpreter
 
getScriptArgs(self)
Hook to specify any arguments passed to the script itself
 
startInterpreter(self, argstring=None)
Interface used by actions to start the interpreter.
 
startupCallback(self, job)
Callback from the JobOutputMixin when a job is successfully started.
 
stderrCallback(self, job, text)
Callback from the JobOutputMixin for a block of text on stderr.
 
stdoutCallback(self, job, text)
Callback from the JobOutputMixin for a block of text on stdout.
 
stopInterpreter(self)
Interface used by actions to kill the currently running job.

Inherited from lib.processmanager.JobOutputMixin: startupFailureCallback

Inherited from object: __delattr__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Class Variables
  classprefs = <peppy.lib.userparams.PrefsProxy object at 0x432a...
  default_classprefs = PathParam('interpreter_exe', '', 'Full pa...

Inherited from lib.userparams.ClassPrefs: preferences_sort_weight

Properties

Inherited from object: __class__

Method Details

finishedCallback(self, job)

 

Callback from the JobOutputMixin when the job terminates.

Overrides: lib.processmanager.JobOutputMixin.finishedCallback

getCommandLine(self, bangpath=None)

 

Return the entire command line of the job to be started.

If allowed by the operating system, the script is parsed for a bangpath and will be executed directly if it exists. Otherwise, the command interpreter will be used to start the script.

startInterpreter(self, argstring=None)

 

Interface used by actions to start the interpreter.

This method is the outside interface to the job control mixin to start the interpreter. See the RunScript action for an example of its usage in practice.

startupCallback(self, job)

 

Callback from the JobOutputMixin when a job is successfully started.

Overrides: lib.processmanager.JobOutputMixin.startupCallback

stderrCallback(self, job, text)

 

Callback from the JobOutputMixin for a block of text on stderr.

Overrides: lib.processmanager.JobOutputMixin.stderrCallback

stdoutCallback(self, job, text)

 

Callback from the JobOutputMixin for a block of text on stdout.

Overrides: lib.processmanager.JobOutputMixin.stdoutCallback

stopInterpreter(self)

 

Interface used by actions to kill the currently running job.

This method is the outside interface to the job control mixin to stop the currently running job. See the StopScript action for an example of its usage in practice.


Class Variable Details

classprefs

Value:
<peppy.lib.userparams.PrefsProxy object at 0x432a550>

default_classprefs

Value:
PathParam('interpreter_exe', '', 'Full path to a program that can inte\
rpret this text\nand return results on standard output'), BoolParam('a\
utosave_before_run', True, 'Automatically save without prompting befor\
e running script'),