CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions
Mixins._ValidatingListBase Class Reference
Inheritance diagram for Mixins._ValidatingListBase:
Mixins._ValidatingParameterListBase Mixins.TestList SequenceTypes.Schedule Types.vbool Types.vdouble Types.VESInputTag Types.VEventID Types.VEventRange Types.VInputTag Types.vint32 Types.vint64 Types.VLuminosityBlockID Types.VLuminosityBlockRange Types.VPSet Types.vstring Types.vuint32 Types.vuint64

Public Member Functions

def __add__
 
def __init__
 
def __setitem__
 
def append
 
def extend
 
def insert
 

Private Member Functions

def _isValid
 
def _labelIfAny
 

Detailed Description

Base class for a list which enforces that its entries pass a 'validity' test

Definition at line 493 of file Mixins.py.

Constructor & Destructor Documentation

def Mixins._ValidatingListBase.__init__ (   self,
  arg,
  args 
)

Definition at line 495 of file Mixins.py.

References Mixins.UsingBlock._isValid(), Mixins._ValidatingListBase._isValid(), and join().

496  def __init__(self,*arg,**args):
497  super(_ValidatingListBase,self).__init__(arg)
498  if 0 != len(args):
499  raise SyntaxError("named arguments ("+','.join([x for x in args])+") passsed to "+str(type(self)))
500  if not self._isValid(iter(self)):
501  raise TypeError("wrong types ("+','.join([str(type(value)) for value in iter(self)])+
") added to "+str(type(self)))
static std::string join(char **cmd)
Definition: RemoteFile.cc:18

Member Function Documentation

def Mixins._ValidatingListBase.__add__ (   self,
  rhs 
)

Definition at line 526 of file Mixins.py.

References Mixins.UsingBlock._isValid(), Mixins._ValidatingListBase._isValid(), and Mixins._ValidatingListBase._labelIfAny().

Referenced by counter.Counter.__iadd__(), and average.Average.__iadd__().

527  def __add__(self,rhs):
528  if not self._isValid(rhs):
529  raise TypeError("wrong type being added to container "+self._labelIfAny())
530  import copy
531  value = copy.copy(self)
532  value.extend(rhs)
return value
def Mixins._ValidatingListBase.__setitem__ (   self,
  key,
  value 
)

Definition at line 502 of file Mixins.py.

References Mixins.UsingBlock._isValid(), Mixins._ValidatingListBase._isValid(), SequenceTypes.Schedule._itemIsValid(), Mixins.TestList._itemIsValid(), Types.vint32._itemIsValid(), Types.vuint32._itemIsValid(), Types.vint64._itemIsValid(), Types.vuint64._itemIsValid(), Types.vdouble._itemIsValid(), Types.vbool._itemIsValid(), Types.vstring._itemIsValid(), Types.VLuminosityBlockID._itemIsValid(), Types.VInputTag._itemIsValid(), Types.VESInputTag._itemIsValid(), Types.VEventID._itemIsValid(), Types.VLuminosityBlockRange._itemIsValid(), Types.VEventRange._itemIsValid(), Types.VPSet._itemIsValid(), and Mixins._ValidatingListBase._labelIfAny().

503  def __setitem__(self,key,value):
504  if isinstance(key,slice):
505  if not self._isValid(value):
506  raise TypeError("wrong type being inserted into this container "+self._labelIfAny())
507  else:
508  if not self._itemIsValid(value):
509  raise TypeError("can not insert the type "+str(type(value))+" in container "+self._labelIfAny())
super(_ValidatingListBase,self).__setitem__(key,value)
def Mixins._ValidatingListBase._isValid (   self,
  seq 
)
private

Definition at line 510 of file Mixins.py.

References SequenceTypes.Schedule._itemIsValid(), Mixins.TestList._itemIsValid(), Types.vint32._itemIsValid(), Types.vuint32._itemIsValid(), Types.vint64._itemIsValid(), Types.vuint64._itemIsValid(), Types.vdouble._itemIsValid(), Types.vbool._itemIsValid(), Types.vstring._itemIsValid(), Types.VLuminosityBlockID._itemIsValid(), Types.VInputTag._itemIsValid(), Types.VESInputTag._itemIsValid(), Types.VEventID._itemIsValid(), Types.VLuminosityBlockRange._itemIsValid(), Types.VEventRange._itemIsValid(), and Types.VPSet._itemIsValid().

Referenced by Mixins._ValidatingListBase.__add__(), Mixins._ValidatingListBase.__init__(), Mixins._ValidatingListBase.__setitem__(), Mixins._ValidatingListBase.extend(), and Mixins._SimpleParameterTypeBase.setValue().

511  def _isValid(self,seq):
512  # see if strings get reinterpreted as lists
513  if isinstance(seq, str):
514  return False
515  for item in seq:
516  if not self._itemIsValid(item):
517  return False
return True
def Mixins._ValidatingListBase._labelIfAny (   self)
private

Definition at line 537 of file Mixins.py.

References SequenceVisitors.PathValidator.__label, SequenceVisitors.EndPathValidator.__label, and Mixins._Labelable.__label.

Referenced by Mixins._ValidatingListBase.__add__(), Mixins._ValidatingListBase.__setitem__(), Mixins._ValidatingListBase.append(), Mixins._ValidatingListBase.extend(), and Mixins._ValidatingListBase.insert().

538  def _labelIfAny(self):
539  result = type(self).__name__
540  if hasattr(self, '__label'):
541  result += ' ' + self.__label
542  return result
def Mixins._ValidatingListBase.append (   self,
  x 
)

Definition at line 518 of file Mixins.py.

References SequenceTypes.Schedule._itemIsValid(), Mixins.TestList._itemIsValid(), Types.vint32._itemIsValid(), Types.vuint32._itemIsValid(), Types.vint64._itemIsValid(), Types.vuint64._itemIsValid(), Types.vdouble._itemIsValid(), Types.vbool._itemIsValid(), Types.vstring._itemIsValid(), Types.VLuminosityBlockID._itemIsValid(), Types.VInputTag._itemIsValid(), Types.VESInputTag._itemIsValid(), Types.VEventID._itemIsValid(), Types.VLuminosityBlockRange._itemIsValid(), Types.VEventRange._itemIsValid(), Types.VPSet._itemIsValid(), and Mixins._ValidatingListBase._labelIfAny().

Referenced by diclist.diclist.add(), and BeautifulSoup.Tag.setString().

519  def append(self,x):
520  if not self._itemIsValid(x):
521  raise TypeError("wrong type being appended to container "+self._labelIfAny())
super(_ValidatingListBase,self).append(x)
def Mixins._ValidatingListBase.extend (   self,
  x 
)

Definition at line 522 of file Mixins.py.

References Mixins.UsingBlock._isValid(), Mixins._ValidatingListBase._isValid(), and Mixins._ValidatingListBase._labelIfAny().

Referenced by MatrixUtil.WF.__init__(), and Mixins._ValidatingParameterListBase.setValue().

523  def extend(self,x):
524  if not self._isValid(x):
525  raise TypeError("wrong type being extended to container "+self._labelIfAny())
super(_ValidatingListBase,self).extend(x)
def Mixins._ValidatingListBase.insert (   self,
  i,
  x 
)

Definition at line 533 of file Mixins.py.

References SequenceTypes.Schedule._itemIsValid(), Mixins.TestList._itemIsValid(), Types.vint32._itemIsValid(), Types.vuint32._itemIsValid(), Types.vint64._itemIsValid(), Types.vuint64._itemIsValid(), Types.vdouble._itemIsValid(), Types.vbool._itemIsValid(), Types.vstring._itemIsValid(), Types.VLuminosityBlockID._itemIsValid(), Types.VInputTag._itemIsValid(), Types.VESInputTag._itemIsValid(), Types.VEventID._itemIsValid(), Types.VLuminosityBlockRange._itemIsValid(), Types.VEventRange._itemIsValid(), Types.VPSet._itemIsValid(), and Mixins._ValidatingListBase._labelIfAny().

Referenced by BeautifulSoup.PageElement._invert().

534  def insert(self,i,x):
535  if not self._itemIsValid(x):
536  raise TypeError("wrong type being inserted to container "+self._labelIfAny())
super(_ValidatingListBase,self).insert(i,x)