ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CRAB/python/PsetManipulator.py
(Generate patch)

Comparing COMP/CRAB/python/PsetManipulator.py (file contents):
Revision 1.17 by ewv, Wed Apr 30 19:41:29 2008 UTC vs.
Revision 1.21 by slacapra, Wed Jul 16 11:24:01 2008 UTC

# Line 43 | Line 43 | class PsetManipulator:
43                  self.cmsProcess = self.cfo
44              except Exception, ex:
45                  msg =  "Your cfg file is not valid, %s\n" % str(ex)
46 <                msg += "  https://twiki.cern.ch/twiki/bin/view/CMS/CrabFaq#Problem_with_ParameterSet_parsin\n"
46 >                msg += "  https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideCrabFaq#Problem_with_ParameterSet_parsin\n"
47                  msg += "  may help you understand the problem."
48                  raise CrabException(msg)
49          self.cfg = CfgInterface(self.cmsProcess)
# Line 63 | Line 63 | class PsetManipulator:
63          # FUTURE: Can drop cfg mode for CMSSW < 2_1_x
64          outFile = open(common.work_space.jobDir()+name,"w")
65          if name.endswith('py'):
66 <          outFile.write("import FWCore.ParameterSet.Config as cms\n")
67 <          outFile.write(self.cmsProcess.dumpPython())
66 >            outFile.write("import FWCore.ParameterSet.Config as cms\n")
67 >            outFile.write(self.cmsProcess.dumpPython())
68          else:
69 <          outFile.write(str(self.cfg))
69 >            outFile.write(str(self.cfg))
70          outFile.close()
71  
72          return
# Line 97 | Line 97 | class PsetManipulator:
97              messageLogger.fwkJobReports.append(name)
98  
99          return
100 +
101 +    def getTFileService(self):
102 +        """ Get Output filename from TFileService and return it. If not existing, return None """
103 +        if not self.cfg.data.services.has_key('TFileService'):
104 +            return None
105 +        tFileService = self.cfg.data.services['TFileService']
106 +        if "fileName" in tFileService.parameterNames_():
107 +            fileName = getattr(tFileService,'fileName',None).value()
108 +            return fileName
109 +        return None
110 +        
111 +    def getPoolOutputModule(self):
112 +        """ Get Output filename from PoolOutputModule and return it. If not existing, return None """
113 +        if not self.cfg.data.outputModules:
114 +            return None
115 +        poolOutputModule = self.cfg.data.outputModules
116 +        for out in poolOutputModule:
117 +            return poolOutputModule[out].fileName.value()
118 +

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines