00001 #!/usr/local/bin/python 00002 # 00003 # Copyright 2004 00004 # by 00005 # The Board of Trustees of the 00006 # Leland Stanford Junior University. 00007 # All rights reserved. 00008 # 00009 00010 __facility__ = "Online" 00011 __abstract__ = "Null application for testing" 00012 __author__ = "R. Claus <Claus@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online" 00013 __date__ = "August 18, 2004" 00014 __version__ = "$Revision: 1.2 $" 00015 __release__ = "$Name: R04-12-00 $" 00016 __credits__ = "SLAC" 00017 00018 import LATTE.copyright_SLAC 00019 00020 from LATTE.runcontrol.rcTransitions import rcTransitions 00021 00022 00023 # Null application implementation. 00024 class userApplication(rcTransitions): 00025 "Implmentation class for Null application" 00026 def __init__(self, rc, userId, debug): 00027 rcTransitions.__init__(self, rc, userId, debug) 00028 00029 def getName(self): 00030 return __name__ 00031 00032 def setup(self): 00033 # A state transition can be rejected by not returning None 00034 return None 00035 00036 def startRun(self): 00037 # A state transition can be rejected by not returning None 00038 return None 00039 00040 def stopRun(self): 00041 self.setCompletionStatus(self.COMPL_STATUS_PASSED) 00042 00043 # The STOP_RUN transition can not be rejected 00044 00045 def stop(self): 00046 return self.stopRun() 00047 00048 def process(self, (status, buffer)): 00049 "Method called back for each data event taken" 00050 pass 00051 00052 def wait(self): 00053 pass 00054 00055 00056 # Standalone mode: 00057 if __name__ == "__main__": 00058 import os 00059 import logging as log 00060 log.basicConfig() 00061 log.getLogger("").setLevel(log.DEBUG) 00062 ua = userApplication(None, 321, 0) 00063 prefs = {'datasave': 1, 'datadir':os.path.join(os.environ['ONLINE_ROOT'],'temp')} 00064 ua.setPrefs(prefs) 00065 ua.rcSetup(os.path.join(os.environ['ONLINE_ROOT'], 'repos/simpleTemSchema.xml')) 00066 ua.rcStartRun() 00067 ua.wait() 00068 ua.rcStopRun() 00069 ua.rcTeardown() 00070 00071 # History: 00072 # $Log: nullApp.py,v $ 00073 # Revision 1.2 2004/08/25 04:00:39 stuvi 00074 # no message 00075 # 00076 # Revision 1.1 2004/08/19 01:55:50 claus 00077 # Null application used for testing. 00078 #