Driver
index
/home/graeme/CVS/dna/scheduler/Scheduler/Driver/Driver.py

Driver.py
# Maintained by G.Winter
# Part of the second version of the Scheduler code - version 1.1
# 19th January 2004

# This section of code will declare the generic class, which contains the 
# functionality required to start, control and end a child process being 
# controlled via standard io channels.

# $Id: Driver.html,v 1.1 2004/10/01 12:15:56 gwin Exp $

 
Modules
       
Scheduler
exceptions
fcntl
os
popen2
select
shutil
signal
string
sys
thread
threading
time

 
Classes
       
Driver
exceptions.Exception
DriverException

 
class Driver
    A class to drive external binary applications
 
  Methods defined here:
__init__(self, debug=20, name='')
Create a driver class - this doesnt do much
close(self)
Close the connection to the child process - this will simply
close the input channels, so that we can be sure that this is
flushed - the equivalent of ^D
debug(self)
getExecutable(self)
getWorkingDirectory(self)
input(self, line, newline=1)
Print a line to the standard input channel of the child process
kill(self)
Terminate the child process - this is designed to implement the
abort type method - so will be useful if the child process gets
stuck in a tight loop, which may happen
output(self)
Read a line from the standard output of the child process
pause(self)
Stop a process in its tracks, to allow restarting later on
setExecutable(self, executableName)
setInputCopy(self, method)
setOutputCopy(self, method)
setTimeout(self, value)
setWorkingDirectory(self, directory)
start(self, command=None)
Make a connection to the child process - which involves opening
a pipe to it
unpause(self)
Restart a stopped process

 
class DriverException(exceptions.Exception)
    a specific exception for the driver class
 
  Methods defined here:
__init__(self, args)

Methods inherited from exceptions.Exception:
__getitem__(...)
__str__(...)

 
Functions
       
Abort()
This will KILL all current running processes - which will in turn
cause the object run methods to return
Reset()
Reset the abort flag
getcwd()
A thread safe getcwd

 
Data
        debug_scheduler = False
driverStartMutex = <thread.lock object>
processTable = []
processTableMutex = <thread.lock object>
processesKilled = False