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

Constructor & Destructor Documentation

def Config.ModifierChain.__init__ (   self,
  chainedModifiers 
)

Definition at line 1426 of file Config.py.

1426  def __init__(self, *chainedModifiers):
1427  self.__chosen = False
1428  self.__chain = chainedModifiers
def __init__(self, chainedModifiers)
Definition: Config.py:1426

Member Function Documentation

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

Definition at line 1455 of file Config.py.

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

1455  def __copyIfExclude(self,toExclude):
1456  shouldCopy = False
1457  for m in toExclude:
1458  if self._isOrContains(m):
1459  shouldCopy = True
1460  break
1461  if shouldCopy:
1462  return self.copyAndExclude(toExclude)
1463  return self
def __copyIfExclude(self, toExclude)
Definition: Config.py:1455
def copyAndExclude(self, toExclude)
Definition: Config.py:1441
def _isOrContains(self, other)
Definition: Config.py:1464
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 1429 of file Config.py.

References Config.ModifierChain.__chain.

1429  def _applyNewProcessModifiers(self,process):
1430  """Should only be called by cms.Process instances
1431  applies list of accumulated changes to the process"""
1432  for m in self.__chain:
1433  m._applyNewProcessModifiers(process)
def _applyNewProcessModifiers(self, process)
Definition: Config.py:1429
def Config.ModifierChain._isOrContains (   self,
  other 
)
private

Definition at line 1464 of file Config.py.

References Config.ModifierChain.__chain.

Referenced by Config.ModifierChain.__copyIfExclude().

1464  def _isOrContains(self, other):
1465  if self is other:
1466  return True
1467  for m in self.__chain:
1468  if m._isOrContains(other):
1469  return True
1470  return False
1471 
def _isOrContains(self, other)
Definition: Config.py:1464
def Config.ModifierChain._setChosen (   self)
private
Should only be called by cms.Process instances

Definition at line 1434 of file Config.py.

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

1434  def _setChosen(self):
1435  """Should only be called by cms.Process instances"""
1436  self.__chosen = True
1437  for m in self.__chain:
1438  m._setChosen()
def _setChosen(self)
Definition: Config.py:1434
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 1441 of file Config.py.

References Config.ModifierChain.__chain.

Referenced by Config.ModifierChain.__copyIfExclude().

1441  def copyAndExclude(self, toExclude):
1442  """Creates a new ModifierChain which is a copy of
1443  this ModifierChain but excludes any Modifier or
1444  ModifierChain in the list toExclude.
1445  The exclusion is done recursively down the chain.
1446  """
1447  newMods = []
1448  for m in self.__chain:
1449  if m not in toExclude:
1450  s = m
1451  if isinstance(m,ModifierChain):
1452  s = m.__copyIfExclude(toExclude)
1453  newMods.append(s)
1454  return ModifierChain(*newMods)
def copyAndExclude(self, toExclude)
Definition: Config.py:1441
def Config.ModifierChain.isChosen (   self)

Member Data Documentation

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

Definition at line 1427 of file Config.py.

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