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)
 

Private Member Functions

def __copyIfExclude (self, toExclude)
 
def _applyNewProcessModifiers (self, process)
 
def _isChosen (self)
 
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 1452 of file Config.py.

Constructor & Destructor Documentation

def Config.ModifierChain.__init__ (   self,
  chainedModifiers 
)

Definition at line 1455 of file Config.py.

1455  def __init__(self, *chainedModifiers):
1456  self.__chosen = False
1457  self.__chain = chainedModifiers
def __init__(self, chainedModifiers)
Definition: Config.py:1455

Member Function Documentation

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

Definition at line 1484 of file Config.py.

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

1484  def __copyIfExclude(self,toExclude):
1485  shouldCopy = False
1486  for m in toExclude:
1487  if self._isOrContains(m):
1488  shouldCopy = True
1489  break
1490  if shouldCopy:
1491  return self.copyAndExclude(toExclude)
1492  return self
def __copyIfExclude(self, toExclude)
Definition: Config.py:1484
def copyAndExclude(self, toExclude)
Definition: Config.py:1470
def _isOrContains(self, other)
Definition: Config.py:1493
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 1458 of file Config.py.

References Config.ModifierChain.__chain.

1458  def _applyNewProcessModifiers(self,process):
1459  """Should only be called by cms.Process instances
1460  applies list of accumulated changes to the process"""
1461  for m in self.__chain:
1462  m._applyNewProcessModifiers(process)
def _applyNewProcessModifiers(self, process)
Definition: Config.py:1458
def Config.ModifierChain._isChosen (   self)
private
def Config.ModifierChain._isOrContains (   self,
  other 
)
private

Definition at line 1493 of file Config.py.

References Config.ModifierChain.__chain.

Referenced by Config.ModifierChain.__copyIfExclude().

1493  def _isOrContains(self, other):
1494  if self is other:
1495  return True
1496  for m in self.__chain:
1497  if m._isOrContains(other):
1498  return True
1499  return False
1500 
def _isOrContains(self, other)
Definition: Config.py:1493
def Config.ModifierChain._setChosen (   self)
private
Should only be called by cms.Process instances

Definition at line 1463 of file Config.py.

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

1463  def _setChosen(self):
1464  """Should only be called by cms.Process instances"""
1465  self.__chosen = True
1466  for m in self.__chain:
1467  m._setChosen()
def _setChosen(self)
Definition: Config.py:1463
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 1470 of file Config.py.

References Config.ModifierChain.__chain.

Referenced by Config.ModifierChain.__copyIfExclude().

1470  def copyAndExclude(self, toExclude):
1471  """Creates a new ModifierChain which is a copy of
1472  this ModifierChain but excludes any Modifier or
1473  ModifierChain in the list toExclude.
1474  The exclusion is done recursively down the chain.
1475  """
1476  newMods = []
1477  for m in self.__chain:
1478  if m not in toExclude:
1479  s = m
1480  if isinstance(m,ModifierChain):
1481  s = m.__copyIfExclude(toExclude)
1482  newMods.append(s)
1483  return ModifierChain(*newMods)
def copyAndExclude(self, toExclude)
Definition: Config.py:1470

Member Data Documentation

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

Definition at line 1456 of file Config.py.

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