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.22 by ewv, Tue Aug 5 21:48:05 2008 UTC vs.
Revision 1.24 by ewv, Tue Dec 16 17:07:08 2008 UTC

# Line 55 | Line 55 | class PsetManipulator:
55          self.cfg.maxEvents.setMaxEventsInput(maxEv)
56          return
57  
58 +    def skipEvent(self, skipEv):
59 +        """
60 +        Set max event in the standalone untracked module
61 +        """
62 +        self.cfg.inputSource.setSkipEvents(skipEv)
63 +        return
64 +
65      def psetWriter(self, name):
66          """
67          Write out modified CMSSW.cfg
# Line 64 | Line 71 | class PsetManipulator:
71          outFile = open(common.work_space.jobDir()+name,"w")
72          if name.endswith('py'):
73              outFile.write("import FWCore.ParameterSet.Config as cms\n")
74 <            outFile.write(self.cmsProcess.dumpPython())
74 >            try:
75 >                outFile.write(self.cmsProcess.dumpPython())
76 >            except Exception, ex:
77 >                msg =  "Your cfg file is not valid, %s\n" % str(ex)
78 >                msg += "  https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideCrabFaq#Problem_with_ParameterSet_parsin\n"
79 >                msg += "  may help you understand the problem."
80 >                raise CrabException(msg)
81 >
82          else:
83              outFile.write(self.cfg.data.dumpConfig())
84          outFile.close()

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines