CMS 3D CMS Logo

Classes | Functions | Variables

python::EnablePSetHistory Namespace Reference

Classes

class  TestModificationTracking

Functions

def auto_inspect
 helpers for inspection ####
def new___init__
def new__Module_name
def new__ModuleSequenceType__iadd__
def new__ModuleSequenceType__imul__
def new__ModuleSequenceType__init__
def new__ModuleSequenceType_copy
def new__ModuleSequenceType_isModified
def new__ModuleSequenceType_remove
def new__ModuleSequenceType_replace
def new__ModuleSequenceType_resetModified
def new__place
def new__placeLooper
def new__placeService
def new__placeSource
def new__Sequenceable_name
 sequence history ####
def new__SequenceIgnore_name
def new__SequenceNegation_name
def new_addAction
def new_checkRecording
def new_deleteAction
def new_disableRecording
def new_dumpHistory
def new_dumpModifications
def new_dumpModificationsWithObjects
def new_enableRecording
def new_history
def new_items_
def new_modificationCheckpoint
def new_modifiedObjects
def new_moduleItems_
def new_Parameterizable_addParameter
def new_Parameterizable_init
 parameterizable history ####
def new_Parameterizable_resetModified
def new_Parameterizable_setattr
def new_Parameterizeable_delattr
def new_ParameterTypeBase_resetModified
def new_recurseDumpModifications_
def new_recurseResetModified_
def new_resetHistory
def new_resetModified
def new_resetModifiedObjects
def new_Sequence_name
def new_setattr
def new_setLooper_
def new_setSchedule_
def new_SortedKeysDict__copy__
def new_SortedKeysDict__deepcopy__

Variables

 _isModified
 _modifications
 ACTIVATE_INSPECTION = True

Function Documentation

def python::EnablePSetHistory::auto_inspect ( )

helpers for inspection ####

Definition at line 8 of file EnablePSetHistory.py.

00009                   :
00010     if not ACTIVATE_INSPECTION:
00011         return [("unknown","unknown","unknown")]
00012     stack = inspect.stack()
00013     while len(stack)>=1 and len(stack[0])>=2 and ('FWCore/ParameterSet' in stack[0][1] or 'FWCore/GuiBrowsers' in stack[0][1]):
00014         stack = stack[1:]
00015     if len(stack)>=1 and len(stack[0])>=3:
00016        return stack
00017     else:
00018        return [("unknown","unknown","unknown")]

def python::EnablePSetHistory::new___init__ (   self,
  name 
)

Definition at line 43 of file EnablePSetHistory.py.

00044                            :
00045     self.old___init__(name)
00046     self.__dict__['_Process__history'] = []
00047     self.__dict__['_Process__enableRecording'] = 0
00048     self.__dict__['_Process__modifiedobjects'] = []
00049     self.__dict__['_Process__modifiedcheckpoint'] = None
00050     self.__dict__['_Process__modifications'] = []
00051 cms.Process.old___init__=cms.Process.__init__
00052 cms.Process.__init__=new___init__

def python::EnablePSetHistory::new__Module_name (   self)

Definition at line 465 of file EnablePSetHistory.py.

00466                           :
00467   if hasattr(self,'_Labelable__label'):
00468     return getattr(self,'_Labelable__label')
00469   elif hasattr(self,'_TypedParameterizable__type'):
00470     return 'unnamed(%s)'%getattr(self,'_TypedParameterizable__type')
00471   return type(self).__name__
00472 cms._Module._name = new__Module_name

def python::EnablePSetHistory::new__ModuleSequenceType__iadd__ (   self,
  other 
)

Definition at line 520 of file EnablePSetHistory.py.

00521                                                :
00522     stack = auto_inspect()
00523     self._isModified=True
00524     self._modifications.append({'file':stack[0][1],'line':stack[0][2],'action':'append','new':other._name(),'old':None})
00525     return self.old__iadd__(other)
00526 cms._ModuleSequenceType.old__iadd__ = cms._ModuleSequenceType.__iadd__
00527 cms._ModuleSequenceType.__iadd__ = new__ModuleSequenceType__iadd__

def python::EnablePSetHistory::new__ModuleSequenceType__imul__ (   self,
  other 
)

Definition at line 512 of file EnablePSetHistory.py.

00513                                                :
00514     stack = auto_inspect()
00515     self._modifications.append({'file':stack[0][1],'line':stack[0][2],'action':'append','new':other._name(),'old':None})
00516     self._isModified=True
00517     return self.old__iadd__(other)
00518 cms._ModuleSequenceType.old__imul__ = cms._ModuleSequenceType.__imul__
00519 cms._ModuleSequenceType.__imul__ = new__ModuleSequenceType__imul__

def python::EnablePSetHistory::new__ModuleSequenceType__init__ (   self,
  arg,
  argv 
)

Definition at line 473 of file EnablePSetHistory.py.

00474                                                      :
00475     self._modifications = []
00476     self.old__init__(*arg,**argv)
00477 cms._ModuleSequenceType.old__init__ = cms._ModuleSequenceType.__init__
00478 cms._ModuleSequenceType.__init__ = new__ModuleSequenceType__init__
    
def python::EnablePSetHistory::new__ModuleSequenceType_copy (   self)

Definition at line 488 of file EnablePSetHistory.py.

00489                                       :
00490     returnValue = cms._ModuleSequenceType.__new__(type(self))
00491     returnValue.__init__(self._seq)
00492     returnValue._isModified = self._isModified
00493     returnValue._modifications = deepcopy(self._modifications)
00494     return returnValue
00495 cms._ModuleSequenceType.copy = new__ModuleSequenceType_copy

def python::EnablePSetHistory::new__ModuleSequenceType_isModified (   self)

Definition at line 484 of file EnablePSetHistory.py.

00485                                             :
00486     return self._isModified
00487 cms._ModuleSequenceType.isModified = new__ModuleSequenceType_isModified

def python::EnablePSetHistory::new__ModuleSequenceType_remove (   self,
  original 
)

Definition at line 504 of file EnablePSetHistory.py.

00505                                                   :
00506     stack = auto_inspect()
00507     self._isModified=True
00508     self._modifications.append({'file':stack[0][1],'line':stack[0][2],'action':'remove','old':original._name(),'new':None})
00509     return self.old_remove(original)
00510 cms._ModuleSequenceType.old_remove = cms._ModuleSequenceType.remove
00511 cms._ModuleSequenceType.remove = new__ModuleSequenceType_remove

def python::EnablePSetHistory::new__ModuleSequenceType_replace (   self,
  original,
  replacement 
)

Definition at line 496 of file EnablePSetHistory.py.

00497                                                                 :
00498     stack = auto_inspect()
00499     self._isModified=True
00500     self._modifications.append({'file':stack[0][1],'line':stack[0][2],'action':'replace','old':original._name(),'new':replacement._name()})
00501     return self.old_replace(original, replacement)
00502 cms._ModuleSequenceType.old_replace = cms._ModuleSequenceType.replace
00503 cms._ModuleSequenceType.replace = new__ModuleSequenceType_replace

def python::EnablePSetHistory::new__ModuleSequenceType_resetModified (   self)

Definition at line 479 of file EnablePSetHistory.py.

00480                                                :
00481     self._isModified=False
00482     self._modifications = []
00483 cms._ModuleSequenceType.resetModified = new__ModuleSequenceType_resetModified

def python::EnablePSetHistory::new__place (   self,
  name,
  mod,
  d 
)

Definition at line 61 of file EnablePSetHistory.py.

00062                                   :
00063     self.old__place(name, mod, d)
00064     if self._okToPlace(name, mod, d):
00065         self.__dict__['_Process__modifiedobjects'].append(mod)
00066 cms.Process.old__place=cms.Process._place
00067 cms.Process._place=new__place

def python::EnablePSetHistory::new__placeLooper (   self,
  name,
  mod 
)

Definition at line 74 of file EnablePSetHistory.py.

00075                                      :
00076     self.old__placeLooper(name, mod)
00077     self.__dict__['_Process__modifiedobjects'].append(mod)
00078 cms.Process.old__placeLooper=cms.Process._placeLooper
00079 cms.Process._placeLooper=new__placeLooper

def python::EnablePSetHistory::new__placeService (   self,
  typeName,
  mod 
)

Definition at line 80 of file EnablePSetHistory.py.

00081                                           :
00082     self.old__placeService(typeName, mod)
00083     self.__dict__['_Process__modifiedobjects'].append(mod)
00084 cms.Process.old__placeService=cms.Process._placeService
00085 cms.Process._placeService=new__placeService

def python::EnablePSetHistory::new__placeSource (   self,
  name,
  mod 
)

Definition at line 68 of file EnablePSetHistory.py.

00069                                      :
00070     self.old__placeSource(name, mod)
00071     self.__dict__['_Process__modifiedobjects'].append(mod)
00072 cms.Process.old__placeSource=cms.Process._placeSource
00073 cms.Process._placeSource=new__placeSource

def python::EnablePSetHistory::new__Sequenceable_name (   self)

sequence history ####

Definition at line 437 of file EnablePSetHistory.py.

00438                                 :
00439     return ''
00440 cms._Sequenceable._name = new__Sequenceable_name
00441 
00442 try:
00443     # for backwards-compatibility with CMSSW_3_10_X
00444     from FWCore.ParameterSet.SequenceTypes import _SequenceOperator
00445 
00446     def new__SequenceOperator_name(self):
00447         return str(self._left._name())+str(self._pySymbol)+str(self._right._name())
00448     _SequenceOperator._name = new__SequenceOperator_name    
00449 except:
00450     pass

def python::EnablePSetHistory::new__SequenceIgnore_name (   self)

Definition at line 457 of file EnablePSetHistory.py.

00458                                   :
00459     return '-'+str(self._operand._name())
00460 _SequenceIgnore._name = new__SequenceIgnore_name

def python::EnablePSetHistory::new__SequenceNegation_name (   self)

Definition at line 453 of file EnablePSetHistory.py.

00454                                     :
00455     return '~'+str(self._operand._name())
00456 _SequenceNegation._name = new__SequenceNegation_name    

def python::EnablePSetHistory::new_addAction (   self,
  tool 
)

Definition at line 125 of file EnablePSetHistory.py.

00126                             :
00127     if self.__dict__['_Process__enableRecording'] == 0:
00128         modifiedObjects=self.modifiedObjects()
00129         for m,o in self.dumpModificationsWithObjects():
00130             modifiedObjects+=o
00131         self.__dict__['_Process__history'].append((tool,modifiedObjects))
00132         self.resetModified()
00133         self.resetModifiedObjects()
00134 cms.Process.addAction=new_addAction

def python::EnablePSetHistory::new_checkRecording (   self)

Definition at line 152 of file EnablePSetHistory.py.

00153                             :
00154     return self.__dict__['_Process__enableRecording']==0
00155 cms.Process.checkRecording=new_checkRecording

def python::EnablePSetHistory::new_deleteAction (   self,
  i 
)

Definition at line 135 of file EnablePSetHistory.py.

00136                             :
00137     del self.__dict__['_Process__history'][i]
00138 cms.Process.deleteAction=new_deleteAction

def python::EnablePSetHistory::new_disableRecording (   self)

Definition at line 139 of file EnablePSetHistory.py.

00140                               :
00141     if self.__dict__['_Process__enableRecording'] == 0:
00142         # remember modifications in history
00143         self.__dict__['_Process__history']+=self.dumpModificationsWithObjects()
00144         self.resetModified()
00145         self.resetModifiedObjects()
00146     self.__dict__['_Process__enableRecording'] += 1
00147 cms.Process.disableRecording=new_disableRecording

def python::EnablePSetHistory::new_dumpHistory (   self,
  withImports = True 
)

Definition at line 108 of file EnablePSetHistory.py.

00109                                           :
00110     dumpHistory=[]
00111     for item,objects in self.history():
00112         if isinstance(item,str):
00113             dumpHistory.append(item +"\n")
00114         else: # isTool
00115             dump=item.dumpPython()
00116             if isinstance(dump,tuple):
00117                 if withImports and dump[0] not in dumpHistory:
00118                     dumpHistory.append(dump[0])
00119                 dumpHistory.append(dump[1])
00120             else:
00121                 dumpHistory.append(dump)
00122            
00123     return ''.join(dumpHistory)
00124 cms.Process.dumpHistory=new_dumpHistory

def python::EnablePSetHistory::new_dumpModifications (   self,
  comments = True,
  process = True,
  module = False,
  sequence = True,
  value = True,
  sort = True,
  group = True 
)
Return some text describing all the modifications that have been made.

* comments: print out comments describing the file and line which triggered
            the modification, if determined.
* process: print "process." in front of every name
* module: only print out one entry per top-level module that has been
          changed, rather than the details
* sequence: include changes to sequences
* value: print out the latest value of each name
* sort: whether to sort all the names before printing (otherwise they're in
        more-or-less time order, within each category)

Definition at line 290 of file EnablePSetHistory.py.

00291                                                                                                                             :
00292     """
00293     Return some text describing all the modifications that have been made.
00294 
00295     * comments: print out comments describing the file and line which triggered
00296                 the modification, if determined.
00297     * process: print "process." in front of every name
00298     * module: only print out one entry per top-level module that has been
00299               changed, rather than the details
00300     * sequence: include changes to sequences
00301     * value: print out the latest value of each name
00302     * sort: whether to sort all the names before printing (otherwise they're in
00303             more-or-less time order, within each category)
00304     """
00305     modifications = self.recurseDumpModifications_('', self)
00306     text = []
00307     for name, o in self.items_():
00308         modifications += self.recurseDumpModifications_(name, o)
00309     if not sequence:
00310         modifications = filter(lambda x: not x['type'] == 'seq', modifications)
00311     checkpoint = self.__dict__['_Process__modifiedcheckpoint']
00312     if not checkpoint == None:
00313         modifications = filter(lambda x: any([x['name'].startswith(check) for check in checkpoint]), modifications)
00314     if module:
00315         value = False
00316         comments = False
00317         modules = list(set([m['name'].split('.')[0] for m in modifications]))
00318         if sort:
00319             modules = sorted(modules)
00320         if process:
00321             text = ['process.%s' % m for m in modules]
00322         else:
00323             text = modules
00324     else:
00325         if sort:
00326             modifications = sorted(modifications, key=lambda x: x['name'])
00327         for i, m in enumerate(modifications):
00328             t = ''
00329             if comments:
00330                 if m['action'] == 'replace':
00331                     t += '# %(file)s:%(line)s replace %(old)s->%(new)s\n' % m
00332                 elif m['action'] == 'remove':
00333                     t += '# %(file)s:%(line)s remove %(old)s\n' % m
00334                 elif m['action'] == 'append':
00335                     t += '# %(file)s:%(line)s append %(new)s\n' % m
00336             if not group or i==len(modifications)-1 or not modifications[i+1]['name'] == m['name']:
00337                 if process and value:
00338                     t += 'process.%s = %s' % (m['name'], m['dump'])
00339                 elif value:
00340                     t += '%s = %s' % (m['name'], m['dump'])
00341                 elif process:
00342                     t += 'process.%s' % (m['name'])
00343                 else:
00344                     t += '%s' % (m['name'])
00345             text += [t]
00346     return '\n'.join(text)+'\n'
00347 cms.Process.dumpModifications=new_dumpModifications

def python::EnablePSetHistory::new_dumpModificationsWithObjects (   self)

Definition at line 348 of file EnablePSetHistory.py.

00349                                           :
00350     modifications = []
00351     for name, o in self.items_():
00352         for m in self.recurseDumpModifications_(name, o):            
00353             text = 'process.%s = %s' % (m['name'], m['dump'])
00354             modifications += [(text,[o])]
00355     return modifications
00356 cms.Process.dumpModificationsWithObjects=new_dumpModificationsWithObjects

def python::EnablePSetHistory::new_enableRecording (   self)

Definition at line 148 of file EnablePSetHistory.py.

00149                              :
00150     self.__dict__['_Process__enableRecording'] -= 1
00151 cms.Process.enableRecording=new_enableRecording

def python::EnablePSetHistory::new_history (   self)

Definition at line 98 of file EnablePSetHistory.py.

00099                      :
00100     return self.__dict__['_Process__history']+self.dumpModificationsWithObjects()
00101 cms.Process.history=new_history

def python::EnablePSetHistory::new_items_ (   self)

Definition at line 365 of file EnablePSetHistory.py.

00366                     :
00367     items = []
00368     if self.source:
00369         items += [("source", self.source)]
00370     if self.looper:
00371         items += [("looper", self.looper)]
00372     items += self.moduleItems_()
00373     items += self.outputModules.items()
00374     items += self.sequences.items()
00375     items += self.paths.iteritems()
00376     items += self.endpaths.items()
00377     items += self.services.items()
00378     items += self.es_producers.items()
00379     items += self.es_sources.items()
00380     items += self.es_prefers.items()
00381     items += self.psets.items()
00382     items += self.vpsets.items()
00383     if self.schedule:
00384         items += [("schedule", self.schedule)]
00385     return tuple(items)
00386 cms.Process.items_=new_items_

def python::EnablePSetHistory::new_modificationCheckpoint (   self)
Set a checkpoint, ie get the current list of all known
top-level names and store them. Later, when we print out
modifications we ignore any modifications that do not affect
something in this list.

There is currently no way of clearing this, but I think this
is generally a use-once feature.

Definition at line 264 of file EnablePSetHistory.py.

00265                                     :
00266     """
00267     Set a checkpoint, ie get the current list of all known
00268     top-level names and store them. Later, when we print out
00269     modifications we ignore any modifications that do not affect
00270     something in this list.
00271 
00272     There is currently no way of clearing this, but I think this
00273     is generally a use-once feature.
00274     """
00275     existing_names = set()
00276     for item in self.items_():
00277         existing_names.add(item[0])
00278     self.__dict__['_Process__modifiedcheckpoint'] = list(existing_names)
00279 cms.Process.modificationCheckpoint=new_modificationCheckpoint

def python::EnablePSetHistory::new_modifiedObjects (   self)

Definition at line 53 of file EnablePSetHistory.py.

00054                              :
00055     return self.__dict__['_Process__modifiedobjects']
00056 cms.Process.modifiedObjects=new_modifiedObjects

def python::EnablePSetHistory::new_moduleItems_ (   self)

Definition at line 357 of file EnablePSetHistory.py.

00358                           :
00359     items = []
00360     items += self.producers.items()
00361     items += self.filters.items()
00362     items += self.analyzers.items()
00363     return tuple(items)
00364 cms.Process.moduleItems_=new_moduleItems_

def python::EnablePSetHistory::new_Parameterizable_addParameter (   self,
  name,
  value 
)

Definition at line 396 of file EnablePSetHistory.py.

00397                                                        :
00398   self.old__addParameter(name,value)
00399   stack = auto_inspect()
00400   self._modifications.append({'file':stack[0][1],'line':stack[0][2],'name':name,'old':None,'new':deepcopy(value),'action':'add'})
00401 cms._Parameterizable.old__addParameter = cms._Parameterizable._Parameterizable__addParameter
00402 cms._Parameterizable._Parameterizable__addParameter = new_Parameterizable_addParameter

def python::EnablePSetHistory::new_Parameterizable_init (   self,
  a,
  k 
)

parameterizable history ####

Definition at line 389 of file EnablePSetHistory.py.

00390                                          :
00391   self.__dict__['_modifications'] = []
00392   self.old__init__(*a,**k)
00393   self._modifications = []
00394 cms._Parameterizable.old__init__ = cms._Parameterizable.__init__
00395 cms._Parameterizable.__init__ = new_Parameterizable_init

def python::EnablePSetHistory::new_Parameterizable_resetModified (   self)

Definition at line 421 of file EnablePSetHistory.py.

00422                                            :
00423     self._isModified=False
00424     self._modifications = []
00425     for name in self.parameterNames_():
00426         param = self.__dict__[name]
00427         if isinstance(param, cms._Parameterizable):
00428             param.resetModified()
00429 cms._Parameterizable.resetModified = new_Parameterizable_resetModified

def python::EnablePSetHistory::new_Parameterizable_setattr (   self,
  name,
  value 
)

Definition at line 403 of file EnablePSetHistory.py.

00404                                                   :
00405   if (not self.isFrozen()) and (not name.startswith('_')) and (name in self.__dict__):
00406     stack = auto_inspect()
00407     self._modifications.append({'file':stack[0][1],'line':stack[0][2],'name':name,'old':deepcopy(self.__dict__[name]),'new':deepcopy(value),'action':'replace'})
00408     self._isModified = True
00409   self.old__setattr__(name,value)
00410 cms._Parameterizable.old__setattr__ = cms._Parameterizable.__setattr__
00411 cms._Parameterizable.__setattr__ = new_Parameterizable_setattr

def python::EnablePSetHistory::new_Parameterizeable_delattr (   self,
  name 
)

Definition at line 412 of file EnablePSetHistory.py.

00413                                             :
00414     if not self.isFrozen():
00415         stack = auto_inspect()
00416         self._modifications.append({'file':stack[0][1],'line':stack[0][2],'name':name,'old':deepcopy(self.__dict__[name]), 'new':None,'action':'delete'})
00417     self.old__delattr__(name)
00418 cms._Parameterizable.old__delattr__ = cms._Parameterizable.__delattr__
00419 cms._Parameterizable.__delattr__ = new_Parameterizeable_delattr
00420 

def python::EnablePSetHistory::new_ParameterTypeBase_resetModified (   self)

Definition at line 430 of file EnablePSetHistory.py.

00431                                              :
00432     self._isModified=False
00433     self._modifications = []
00434 cms._ParameterTypeBase.resetModified = new_ParameterTypeBase_resetModified

def python::EnablePSetHistory::new_recurseDumpModifications_ (   self,
  name,
  o 
)
Recursively return a standardised list of modifications
from the object hierarchy.

Definition at line 201 of file EnablePSetHistory.py.

00202                                                 :
00203     """
00204     Recursively return a standardised list of modifications
00205     from the object hierarchy.
00206     """
00207     modifications = []
00208     if isinstance(o, cms._ModuleSequenceType):
00209         if o._isModified:
00210             for mod in o._modifications:
00211                 modifications.append({'name':name,
00212                                       'action':mod['action'],
00213                                       'old': mod['old'],
00214                                       'new': mod['new'],
00215                                       'file': mod['file'],
00216                                       'line': mod['line'],
00217                                       'dump': o.dumpPython({}),
00218                                       'type': 'seq'})
00219     
00220     if isinstance(o, cms._Parameterizable):
00221         for mod in o._modifications:
00222             paramname = mod['name']
00223             if hasattr(o, paramname):
00224                 paramvalue = getattr(o, paramname)
00225             else:
00226                 paramvalue = None
00227             if isinstance(paramvalue,cms._ParameterTypeBase):
00228                 dump = paramvalue.dumpPython()
00229             else:
00230                 dump = paramvalue
00231             modifications.append({'name': '%s.%s' %(name, paramname),
00232                                   'old': mod['old'],
00233                                   'new': mod['new'],
00234                                   'file': mod['file'],
00235                                   'line': mod['line'],
00236                                   'action': mod['action'],
00237                                   'dump': dump,
00238                                   'type': 'param'})
00239             
00240         # Loop over any child elements
00241         for key in o.parameterNames_():
00242             value = getattr(o,key)
00243             modifications += self.recurseDumpModifications_("%s.%s" % (name, key), value)
00244     
00245     if isinstance(o, cms._ValidatingListBase):
00246         for index, item in enumerate(o):
00247             modifications += self.recurseDumpModifications_("%s[%s]" % (name, index), item)
00248     if isinstance(o, cms.Process):
00249         for mod in o.__dict__['_Process__modifications']:
00250             if hasattr(o, mod['name']) and hasattr(getattr(o, mod['name']), 'dumpPython'):
00251                 dump = getattr(o, mod['name']).dumpPython()
00252             else:
00253                 dump = None
00254             modifications.append({'name': mod['name'],
00255                                   'action': mod['action'],
00256                                   'old': mod['old'],
00257                                   'new': mod['new'],
00258                                   'dump': dump,
00259                                   'file': mod['file'],
00260                                   'line': mod['line'],
00261                                   'type': 'process'})
00262     return modifications
00263 cms.Process.recurseDumpModifications_=new_recurseDumpModifications_

def python::EnablePSetHistory::new_recurseResetModified_ (   self,
  o 
)
Empty all the _modifications lists for
all objects beneath this one.

Definition at line 183 of file EnablePSetHistory.py.

00184                                       :
00185     """
00186     Empty all the _modifications lists for
00187     all objects beneath this one.
00188     """
00189     properties = []
00190     if isinstance(o, cms._ModuleSequenceType):
00191         o.resetModified()
00192     if isinstance(o, cms._Parameterizable):
00193         o.resetModified()
00194         for key in o.parameterNames_():
00195             value = getattr(o,key)
00196             self.recurseResetModified_(value)
00197     if isinstance(o, cms._ValidatingListBase):
00198         for index,item in enumerate(o):
00199             self.recurseResetModified_(item)
00200 cms.Process.recurseResetModified_=new_recurseResetModified_

def python::EnablePSetHistory::new_resetHistory (   self)

Definition at line 102 of file EnablePSetHistory.py.

00103                           :
00104     self.__dict__['_Process__history'] = []
00105     self.resetModified()
00106     self.resetModifiedObjects()
00107 cms.Process.resetHistory=new_resetHistory

def python::EnablePSetHistory::new_resetModified (   self)
Empty out all the modification lists, so we only see changes that
happen from now onwards.

Definition at line 280 of file EnablePSetHistory.py.

00281                            :
00282     """
00283     Empty out all the modification lists, so we only see changes that
00284     happen from now onwards.
00285     """
00286     self.__dict__['_Process__modified'] = []
00287     for name, o in self.items_():
00288         self.recurseResetModified_(o)
00289 cms.Process.resetModified=new_resetModified

def python::EnablePSetHistory::new_resetModifiedObjects (   self)

Definition at line 57 of file EnablePSetHistory.py.

00058                                   :
00059     self.__dict__['_Process__modifiedobjects'] = []
00060 cms.Process.resetModifiedObjects=new_resetModifiedObjects

def python::EnablePSetHistory::new_Sequence_name (   self)

Definition at line 461 of file EnablePSetHistory.py.

00462                            :
00463     return '('+str(self._seq._name())+')'
00464 cms.Sequence._name = new_Sequence_name

def python::EnablePSetHistory::new_setattr (   self,
  name,
  value 
)
This catches modifications that occur during process.load,
and only records a modification if there was an existing object
and the version after __setattr__ has a different id().
This does not mean that the object is different, only redefined.
We still really need a recursive-comparison function for parameterizeable
objects to determine if a real change has been made.

Definition at line 156 of file EnablePSetHistory.py.

00157                                   :
00158     """
00159     This catches modifications that occur during process.load,
00160     and only records a modification if there was an existing object
00161     and the version after __setattr__ has a different id().
00162     This does not mean that the object is different, only redefined.
00163     We still really need a recursive-comparison function for parameterizeable
00164     objects to determine if a real change has been made.
00165     """
00166     old = None
00167     existing = False
00168     if not name.startswith('_Process__'):
00169         existing = hasattr(self, name)
00170         if existing:
00171             old = getattr(self, name)
00172     self.old__setattr__(name, value)
00173     if existing:
00174         if id(getattr(self, name)) != id(old):
00175             stack = auto_inspect()
00176             self.__dict__['_Process__modifications'] += [{'name': name,
00177                                                           'old': deepcopy(old), 
00178                                                           'new': deepcopy(getattr(self, name)),
00179                                                           'file':stack[0][1],'line':stack[0][2],
00180                                                           'action': 'replace'}]
00181 cms.Process.old__setattr__ = cms.Process.__setattr__
00182 cms.Process.__setattr__ = new_setattr

def python::EnablePSetHistory::new_setLooper_ (   self,
  lpr 
)

Definition at line 92 of file EnablePSetHistory.py.

00093                              :
00094     self.old_setLooper_(lpr)
00095     self.__dict__['_Process__modifiedobjects'].append(lpr)
00096 cms.Process.old_setLooper_=cms.Process.setLooper_
00097 cms.Process.setLooper_=new_setLooper_

def python::EnablePSetHistory::new_setSchedule_ (   self,
  sch 
)

Definition at line 86 of file EnablePSetHistory.py.

00087                                :
00088     self.old_setSchedule_(sch)
00089     self.__dict__['_Process__modifiedobjects'].append(sch)
00090 cms.Process.old_setSchedule_=cms.Process.setSchedule_
00091 cms.Process.setSchedule_=new_setSchedule_

def python::EnablePSetHistory::new_SortedKeysDict__copy__ (   self)

Definition at line 23 of file EnablePSetHistory.py.

00024                                     :
00025     return self.__class__(self)
00026 typ.SortedKeysDict.__copy__ = new_SortedKeysDict__copy__

def python::EnablePSetHistory::new_SortedKeysDict__deepcopy__ (   self,
  memo = None 
)

Definition at line 27 of file EnablePSetHistory.py.

00028                                                    :
00029     from copy import deepcopy
00030     if memo is None:
00031         memo = {}
00032     d = memo.get(id(self), None)
00033     if d is not None:
00034         return d
00035     memo[id(self)] = d = self.__class__()
00036     d.__init__(deepcopy(self.items(), memo))
00037     return d
00038 typ.SortedKeysDict.__deepcopy__ = new_SortedKeysDict__deepcopy__


Variable Documentation

Definition at line 403 of file EnablePSetHistory.py.

Definition at line 389 of file EnablePSetHistory.py.

Definition at line 4 of file EnablePSetHistory.py.