00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 import sys
00028 import os
00029 base=os.popen2("echo $CMSSW_BASE")
00030 base=base[1].read()
00031 if len(base)<2:
00032 print "No $CMSSW_BASE directory can be found."
00033 print "Are you sure you've set up your CMSSW release area?"
00034 sys.exit()
00035
00036
00037 try:
00038 from Tkinter import *
00039 except:
00040 print "Could not import Tkinter module!"
00041 print "Cannot display GUI!"
00042 print "(If you are running from FNAL, this is a known problem --\n"
00043 print " Tkinter isn't available in the SL4 release of python for some reason."
00044 print "This is being investigated.)"
00045 sys.exit()
00046
00047 import tkMessageBox
00048
00049 import thread
00050 import time
00051 import cPickle
00052 import python_dbs
00053 import string
00054 import helpfunctions
00055
00056
00057 from pyDBSRunClass import DBSRun
00058
00059 from pydbsAccessor import dbsAccessor
00060 from pyDBSguiBaseClass import dbsBaseGui
00061
00062
00063
00064
00065
00066
00067 class DQMfromDBSgui(dbsBaseGui):
00068 '''
00069 *** DQMfromDBSgui ***
00070 Looks in DBS, and runs HCAL DQM on resulting found files.
00071 '''
00072
00073 def __init__(self,parent=None,debug=False):
00074 ''' *** DQMfromDBSgui.__init__ ***
00075 Call the base class __init__ function, and replaces necessary variables
00076 with DQMfromDBSgui-specific values.
00077 '''
00078
00079 dbsBaseGui.__init__(self,parent,debug)
00080
00081
00082 self.prescaleOverRunText="#replace hcalMonitor.diagnosticPrescaleEvt = "
00083
00084 if (self.debug):
00085 print self.__doc__
00086 print self.__init__.__doc__
00087
00088 return
00089
00090
00091
00092
00093 if __name__=="__main__":
00094
00095 debug=False
00096
00097
00098 try:
00099 from optparse import OptionParser
00100 parser=OptionParser()
00101
00102 parser.add_option("-d","--debug",
00103 dest="debug",
00104 action="store_true",
00105 help = "Enable debugging when GUI runs",
00106 default=False)
00107
00108 (options,args)=parser.parse_args(sys.argv)
00109 debug=options.debug
00110 except:
00111 print "Dang, optionParsing didn't work"
00112 print "Starting GUI anyway"
00113
00114
00115
00116 mygui=DQMfromDBSgui(debug=debug)
00117 mygui.DrawGUI()
00118 mygui.root.mainloop()