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

Constructor & Destructor Documentation

def Config.ModifierChain.__init__ (   self,
  chainedModifiers 
)

Definition at line 1380 of file Config.py.

1380  def __init__(self, *chainedModifiers):
1381  self.__chosen = False
1382  self.__chain = chainedModifiers
def __init__(self, chainedModifiers)
Definition: Config.py:1380

Member Function Documentation

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

Definition at line 1409 of file Config.py.

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

1409  def __copyIfExclude(self,toExclude):
1410  shouldCopy = False
1411  for m in toExclude:
1412  if self._isOrContains(m):
1413  shouldCopy = True
1414  break
1415  if shouldCopy:
1416  return self.copyAndExclude(toExclude)
1417  return self
def __copyIfExclude(self, toExclude)
Definition: Config.py:1409
def copyAndExclude(self, toExclude)
Definition: Config.py:1395
def _isOrContains(self, other)
Definition: Config.py:1418
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 1383 of file Config.py.

References Config.ModifierChain.__chain.

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

Definition at line 1418 of file Config.py.

References Config.ModifierChain.__chain.

Referenced by Config.ModifierChain.__copyIfExclude().

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

Definition at line 1388 of file Config.py.

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

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

References Config.ModifierChain.__chain.

Referenced by Config.ModifierChain.__copyIfExclude().

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

Definition at line 1393 of file Config.py.

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

1393  def isChosen(self):
1394  return self.__chosen
def isChosen(self)
Definition: Config.py:1393

Member Data Documentation

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

Definition at line 1381 of file Config.py.

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