CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
Config.ModifierChain Class Reference
Inheritance diagram for Config.ModifierChain:

Public Member Functions

def __init__ (self, chainedModifiers)
 
def copyAndExclude (self, toExclude)
 
def isChosen (self)
 

Private Member Functions

def __copyIfExclude (self, toExclude)
 
def _applyNewProcessModifiers (self, process)
 
def _isOrContains (self, other)
 
def _setChosen (self)
 

Private Attributes

 __chain
 
 __chosen
 

Detailed Description

A Modifier made up of a list of Modifiers

Definition at line 1226 of file Config.py.

Constructor & Destructor Documentation

def Config.ModifierChain.__init__ (   self,
  chainedModifiers 
)

Definition at line 1229 of file Config.py.

1229  def __init__(self, *chainedModifiers):
1230  self.__chosen = False
1231  self.__chain = chainedModifiers
def __init__(self, chainedModifiers)
Definition: Config.py:1229

Member Function Documentation

def Config.ModifierChain.__copyIfExclude (   self,
  toExclude 
)
private

Definition at line 1258 of file Config.py.

References Config.Modifier._isOrContains(), Config.ModifierChain._isOrContains(), and Config.ModifierChain.copyAndExclude().

1258  def __copyIfExclude(self,toExclude):
1259  shouldCopy = False
1260  for m in toExclude:
1261  if self._isOrContains(m):
1262  shouldCopy = True
1263  break
1264  if shouldCopy:
1265  return self.copyAndExclude(toExclude)
1266  return self
def __copyIfExclude(self, toExclude)
Definition: Config.py:1258
def copyAndExclude(self, toExclude)
Definition: Config.py:1244
def _isOrContains(self, other)
Definition: Config.py:1267
def Config.ModifierChain._applyNewProcessModifiers (   self,
  process 
)
private
Should only be called by cms.Process instances
applies list of accumulated changes to the process

Definition at line 1232 of file Config.py.

References Config.ModifierChain.__chain.

1232  def _applyNewProcessModifiers(self,process):
1233  """Should only be called by cms.Process instances
1234  applies list of accumulated changes to the process"""
1235  for m in self.__chain:
1236  m._applyNewProcessModifiers(process)
def _applyNewProcessModifiers(self, process)
Definition: Config.py:1232
def Config.ModifierChain._isOrContains (   self,
  other 
)
private

Definition at line 1267 of file Config.py.

References Config.ModifierChain.__chain.

Referenced by Config.ModifierChain.__copyIfExclude().

1267  def _isOrContains(self, other):
1268  if self is other:
1269  return True
1270  for m in self.__chain:
1271  if m._isOrContains(other):
1272  return True
1273  return False
1274 
def _isOrContains(self, other)
Definition: Config.py:1267
def Config.ModifierChain._setChosen (   self)
private
Should only be called by cms.Process instances

Definition at line 1237 of file Config.py.

References Config.ModifierChain.__chain, Config.Modifier.__chosen, and Config.ModifierChain.__chosen.

1237  def _setChosen(self):
1238  """Should only be called by cms.Process instances"""
1239  self.__chosen = True
1240  for m in self.__chain:
1241  m._setChosen()
def _setChosen(self)
Definition: Config.py:1237
def Config.ModifierChain.copyAndExclude (   self,
  toExclude 
)
Creates a new ModifierChain which is a copy of
  this ModifierChain but excludes any Modifier or
  ModifierChain in the list toExclude.
  The exclusion is done recursively down the chain.

Definition at line 1244 of file Config.py.

References Config.ModifierChain.__chain.

Referenced by Config.ModifierChain.__copyIfExclude().

1244  def copyAndExclude(self, toExclude):
1245  """Creates a new ModifierChain which is a copy of
1246  this ModifierChain but excludes any Modifier or
1247  ModifierChain in the list toExclude.
1248  The exclusion is done recursively down the chain.
1249  """
1250  newMods = []
1251  for m in self.__chain:
1252  if m not in toExclude:
1253  s = m
1254  if isinstance(m,ModifierChain):
1255  s = m.__copyIfExclude(toExclude)
1256  newMods.append(s)
1257  return ModifierChain(*newMods)
def copyAndExclude(self, toExclude)
Definition: Config.py:1244
def Config.ModifierChain.isChosen (   self)

Definition at line 1242 of file Config.py.

References Config.Modifier.__chosen, and Config.ModifierChain.__chosen.

1242  def isChosen(self):
1243  return self.__chosen
def isChosen(self)
Definition: Config.py:1242

Member Data Documentation

Config.ModifierChain.__chain
private
Config.ModifierChain.__chosen
private

Definition at line 1230 of file Config.py.

Referenced by Config.ModifierChain._setChosen(), and Config.ModifierChain.isChosen().