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 439 of file Mixins.py.

Constructor & Destructor Documentation

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

Definition at line 441 of file Mixins.py.

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

442  def __init__(self,*arg,**args):
443  super(_ValidatingListBase,self).__init__(arg)
444  if 0 != len(args):
445  raise SyntaxError("named arguments ("+','.join([x for x in args])+") passsed to "+str(type(self)))
446  if not self._isValid(iter(self)):
447  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 472 of file Mixins.py.

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

473  def __add__(self,rhs):
474  if not self._isValid(rhs):
475  raise TypeError("wrong type being added to container "+self._labelIfAny())
476  import copy
477  value = copy.copy(self)
478  value.extend(rhs)
return value
def Mixins._ValidatingListBase.__setitem__ (   self,
  key,
  value 
)

Definition at line 448 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().

449  def __setitem__(self,key,value):
450  if isinstance(key,slice):
451  if not self._isValid(value):
452  raise TypeError("wrong type being inserted into this container "+self._labelIfAny())
453  else:
454  if not self._itemIsValid(value):
455  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 456 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().

457  def _isValid(self,seq):
458  # see if strings get reinterpreted as lists
459  if isinstance(seq, str):
460  return False
461  for item in seq:
462  if not self._itemIsValid(item):
463  return False
return True
def Mixins._ValidatingListBase._labelIfAny (   self)
private

Definition at line 483 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().

484  def _labelIfAny(self):
485  result = type(self).__name__
486  if hasattr(self, '__label'):
487  result += ' ' + self.__label
488  return result
def Mixins._ValidatingListBase.append (   self,
  x 
)

Definition at line 464 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.Tag.setString().

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

Definition at line 468 of file Mixins.py.

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

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

469  def extend(self,x):
470  if not self._isValid(x):
471  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 479 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().

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