/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

JobState.py
Go to the documentation of this file.
00001 # JobState
00002 #
00003 # This package maintains a primitive database of the pending, running,
00004 # and completed jobs.
00005 #
00006 # Created by dandwyer@caltech.edu 2010/08/09
00007 
00008 import ProcessManager.Status as Status
00009 
00010 class State: 
00011     UNKNOWN=0
00012 
00013     RUN_READY=1
00014     RUN_PROCESSING=2
00015     RUN_DONE=3
00016     RUN_FAILED=4
00017 
00018     STATS_UNKNOWN=5
00019     STATS_READY=6
00020     STATS_ADDING=7
00021     STATS_DONE=8
00022     STATS_FAILED=9
00023 
00024     SUMMARY_UNKNOWN=10
00025     SUMMARY_READY=11
00026     SUMMARY_PRINTING=12
00027     SUMMARY_PRINTED=13
00028     SUMMARY_INDEXING=14
00029     SUMMARY_INDEXED=15
00030     SUMMARY_ADDING=16
00031     SUMMARY_DONE=17
00032     SUMMARY_FAILED_PRINTING=18
00033     SUMMARY_FAILED_INDEXING=19
00034     SUMMARY_FAILED_ADDING=20
00035 
00036     DQDUMP_READY=21
00037     DQDUMP_PMTPROCESSING=22
00038     DQDUMP_PMTDONE=23
00039     DQDUMP_PMTFAILED=24
00040     DQDUMP_TRIGGERPROCESSING=25
00041     DQDUMP_TRIGGERDONE=26
00042     DQDUMP_TRIGGERFAILED=27
00043     DQDUMP_RATEDONE=28
00044     DQDUMP_RATEFAILED=29
00045     DQDUMP_PROCESSING=30
00046     DQDUMP_FAILED=31
00047     DQDUMP_DONE=32
00048 
00049 
00050     @classmethod
00051     def getStateByName(cls, name):
00052         """Return the state with the given name"""
00053         if hasattr(cls, name):
00054             return getattr(cls, name)
00055         return State.UNKNOWN
00056 
00057     @classmethod
00058     def getName(cls, state):
00059         """Return the name for a given state"""
00060         for name in dir(cls):
00061             if name.startswith("__"):
00062                 continue
00063             if getattr(cls,name)==state:
00064                 return name
00065         return "UNKNOWN"
00066             
00067 class JobState:
00068     """State of the given job"""
00069     def __init__(self,state=State.UNKNOWN,time=0):
00070         """ Initialize Job State """
00071         self.state=state
00072         self.time=time
00073 
00074 class JobType:
00075     """Types of Jobs"""
00076     RUN="run"
00077     ADDSTATS="addStats"
00078     SUMMARY="summary"
00079     DQDUMP="dqDump"
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 09:54:04 for ProcessManager by doxygen 1.7.4