Документ взят из кэша поисковой машины. Адрес оригинального документа : http://www.stsci.edu/spst/UnixTransition/doc/batch_util.html
Дата изменения: Fri Apr 8 12:46:14 2016
Дата индексирования: Mon Apr 11 00:37:58 2016
Кодировка:
Python: module batch_util
 
 
batch_util (version 14.09.29)
index
batch_util.py

PURPOSE --
A general purpose tool for setting up and saving the info about
batch jobs.
 
DEVELOPER --
Don Chance
 
MODIFICATION HISTORY --
Initial implementation  3/15/01
Add -dir erroneously left off submit call.  drc 7/26/01
Added code for Codine/Sun Gridware.  drc 8/02/01
Limit job names to 10 characters on Unix.  drc 12/10/01
Added status routine to batch class        app 04/24/03
Mods from python review                    app 05/05/03
Mods to support Mac OS X                   mdr 03/15/05
Add find_queues_with_resource function     drc 06/21/06
Updated for SGE 6; remove VMS code         drc 05/07/07
Modified for move to local time            drc 07/06/10
Mods to enhanced submit_codine             mdr 10/07/10
Mods for fixed submit_codine               mdr 10/08/10
Make Python 3 compatible.                  drc 09/29/14

 
Modules
       
os
pickle
spss_sys_util
time
time_util

 
Classes
       
__builtin__.object
batch

 
class batch(__builtin__.object)
     Methods defined here:
__init__(self, jobname=None, setup=1)
Constructor for batch objects.
 
If 'setup' is 0 (false), don't run the setup function.
If 'setup' is 1, run the setup function.
If 'setup' is 2, run the setup function, but also run the function to
query for the command that runs recursively.  The reason for two levels
of setup arises because some subclasses may know the command they need
to run, while others need to have the user specify it.
__repr__(self)
check(self)
Checks that the batch job is in the queue.
 
Returns true if the batch job is found, otherwise returns false.
pprint(self)
Print out all attributes for examination.
save(self)
Save this object onto disk.
 
Use the old pickle file name if it exists.
set_command(self)
setup(self)
start(self)
Start the batch job running.
status(self)
Checks that the batch job is in the queue.
 
Returns dictionary of status information if the batch job is found,
otherwise returns an empty dictionary

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
Functions
       
check_directory(text)
Prompt the user for a directory.  Check that the user input
is either a directory or an environment variable that points to a
directory.
 
Return the input value in either case.
find_queues(rtype=None)
Find queues that the resources necessary to run PASS or SPSS.
 
The input must be the string 'spss' or 'pass', None or a dictionary of
resources.
find_queues_with_resource(name, value)
Find SGE queues that have the input resource with the input
value.
get_directory(dir)
If the input is an environment variable, return its value,
otherwise return the input.
input = raw_input(...)
raw_input([prompt]) -> string
 
Read a string from standard input.  The trailing newline is stripped.
If the user hits EOF (Unix: Ctl-D, Windows: Ctl-Z+Return), raise EOFError.
On Unix, GNU readline is used if enabled.  The prompt string, if given,
is printed without a trailing newline before reading.

 
Data
        FLIGHT_SMS_QUEUE = 'flight_sms.q'
PASS_QUEUE = 'pass.q'
PASS_RESOURCES_DICT = {'pass_machine': '1'}
SPSS_QUEUE = 'spst.q'
SPSS_RESOURCES_DICT = {'spst': '1'}
TEST_SMS_QUEUE = 'test_sms.q'
__author__ = 'Don Chance'
__version__ = '14.09.29'

 
Author
        Don Chance