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 1373 of file Config.py.

Constructor & Destructor Documentation

def Config.ModifierChain.__init__ (   self,
  chainedModifiers 
)

Definition at line 1376 of file Config.py.

1376  def __init__(self, *chainedModifiers):
1377  self.__chosen = False
1378  self.__chain = chainedModifiers
def __init__(self, chainedModifiers)
Definition: Config.py:1376

Member Function Documentation

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

Definition at line 1405 of file Config.py.

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

1405  def __copyIfExclude(self,toExclude):
1406  shouldCopy = False
1407  for m in toExclude:
1408  if self._isOrContains(m):
1409  shouldCopy = True
1410  break
1411  if shouldCopy:
1412  return self.copyAndExclude(toExclude)
1413  return self
def __copyIfExclude(self, toExclude)
Definition: Config.py:1405
def copyAndExclude(self, toExclude)
Definition: Config.py:1391
def _isOrContains(self, other)
Definition: Config.py:1414
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 1379 of file Config.py.

References Config.ModifierChain.__chain.

1379  def _applyNewProcessModifiers(self,process):
1380  """Should only be called by cms.Process instances
1381  applies list of accumulated changes to the process"""
1382  for m in self.__chain:
1383  m._applyNewProcessModifiers(process)
def _applyNewProcessModifiers(self, process)
Definition: Config.py:1379
def Config.ModifierChain._isOrContains (   self,
  other 
)
private

Definition at line 1414 of file Config.py.

References Config.ModifierChain.__chain.

Referenced by Config.ModifierChain.__copyIfExclude().

1414  def _isOrContains(self, other):
1415  if self is other:
1416  return True
1417  for m in self.__chain:
1418  if m._isOrContains(other):
1419  return True
1420  return False
1421 
def _isOrContains(self, other)
Definition: Config.py:1414
def Config.ModifierChain._setChosen (   self)
private
Should only be called by cms.Process instances

Definition at line 1384 of file Config.py.

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

1384  def _setChosen(self):
1385  """Should only be called by cms.Process instances"""
1386  self.__chosen = True
1387  for m in self.__chain:
1388  m._setChosen()
def _setChosen(self)
Definition: Config.py:1384
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 1391 of file Config.py.

References Config.ModifierChain.__chain.

Referenced by Config.ModifierChain.__copyIfExclude().

1391  def copyAndExclude(self, toExclude):
1392  """Creates a new ModifierChain which is a copy of
1393  this ModifierChain but excludes any Modifier or
1394  ModifierChain in the list toExclude.
1395  The exclusion is done recursively down the chain.
1396  """
1397  newMods = []
1398  for m in self.__chain:
1399  if m not in toExclude:
1400  s = m
1401  if isinstance(m,ModifierChain):
1402  s = m.__copyIfExclude(toExclude)
1403  newMods.append(s)
1404  return ModifierChain(*newMods)
def copyAndExclude(self, toExclude)
Definition: Config.py:1391
def Config.ModifierChain.isChosen (   self)

Definition at line 1389 of file Config.py.

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

1389  def isChosen(self):
1390  return self.__chosen
def isChosen(self)
Definition: Config.py:1389

Member Data Documentation

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

Definition at line 1377 of file Config.py.

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