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

Constructor & Destructor Documentation

def Config.ModifierChain.__init__ (   self,
  chainedModifiers 
)

Definition at line 1425 of file Config.py.

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

Member Function Documentation

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

Definition at line 1454 of file Config.py.

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

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

References Config.ModifierChain.__chain.

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

Definition at line 1463 of file Config.py.

References Config.ModifierChain.__chain.

Referenced by Config.ModifierChain.__copyIfExclude().

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

Definition at line 1433 of file Config.py.

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

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

References Config.ModifierChain.__chain.

Referenced by Config.ModifierChain.__copyIfExclude().

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

Member Data Documentation

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

Definition at line 1426 of file Config.py.

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