5 BaseDir =
"/afs/cern.ch/cms/CAF/CMSCOMM/COMM_DQM/HDQM/Cron/Scripts/RunSelection/Test" 9 FileName = BaseDir+
"/SelectedGoodRuns.txt" 11 QualityFlag =
"Strip:GOOD" 15 os.system(
"mv "+self.FileName+
" "+self.FileName+
".old")
18 inputFile = open(self.BaseDir+
"/runreg_template.cfg",
"r") 20 outputFileContent = inputFile.read().
replace(
"GROUP", self.Group).
replace(
"FIRSTRUN", self.FirstRun).
replace(
"OUTPUTFILENAME", self.FileName).
replace(
"HLTNAMEFILTER", self.HLTNameFilter).
replace(
"QUALITYFLAG", self.QualityFlag)
21 outputFile = open(self.BaseDir+
"/runreg.cfg",
"w")
22 outputFile.write(outputFileContent)
26 os.system(
"source /afs/cern.ch/cms/ccs/wm/scripts/Crab/crab.sh; python "+self.BaseDir+
"/runregparse.py")
30 if os.path.isfile(self.FileName+
".old"):
31 if filecmp.cmp(self.FileName, self.FileName+
".old"):
def replace(string, replacements)