CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes
diclist.diclist Class Reference
Inheritance diagram for diclist.diclist:

Public Member Functions

def __getitem__
 
def __init__
 
def __setitem__
 
def add
 

Public Attributes

 dico
 

Detailed Description

Definition at line 4 of file diclist.py.

Constructor & Destructor Documentation

def diclist.diclist.__init__ (   self)

Definition at line 6 of file diclist.py.

6 
7  def __init__(self):
8  super( diclist, self).__init__()
9  self.dico = {}
def __init__
Definition: diclist.py:6

Member Function Documentation

def diclist.diclist.__getitem__ (   self,
  index 
)
These functions are quite risky...cannot use an integer as key...

Definition at line 16 of file diclist.py.

References diclist.diclist.dico.

16 
17  def __getitem__(self, index):
18  '''These functions are quite risky...cannot use an integer as key...'''
19  try:
20  # index = int( index )
21  return super(diclist, self).__getitem__(index)
22  except TypeError, ValueError:
23  return super(diclist, self).__getitem__( self.dico[index] )
def __getitem__
Definition: diclist.py:16
def diclist.diclist.__setitem__ (   self,
  index,
  value 
)
These functions are quite risky...

Definition at line 24 of file diclist.py.

References diclist.diclist.dico.

24 
25  def __setitem__(self, index, value):
26  '''These functions are quite risky...'''
27  try:
28  # why did I add this cast? it's casting string to int...
29  # index = int( index )
30  return super(diclist, self).__setitem__(index, value)
31  except TypeError,ValueError:
32  return super(diclist, self).__setitem__( self.dico[index], value )
def __setitem__
Definition: diclist.py:24
def diclist.diclist.add (   self,
  key,
  value 
)

Definition at line 10 of file diclist.py.

References python.seqvaluedict.seqdict.append(), PhysicsTools::SourceVariableSet.append(), ecaldqm::Dependency.append(), cms::Digest.append(), L1GtVhdlTemplateFile.append(), cond::IOVEditor.append(), NoRecordException< TrackerDigiGeometryRecord >.append(), NoRecordException< MuonGeometryRecord >.append(), cms::Exception.append(), NoProxyException< DataT >.append(), Vispa.Views.PropertyView.PropertyView.append(), psClasses.BuildTreeNodeList.append(), svgfig.SVG.append(), psClasses.queueNode.append(), Json::Value.append(), Mixins._ValidatingListBase.append(), and diclist.diclist.dico.

Referenced by counter.Counter.register().

10 
11  def add( self, key, value ):
12  if key in self.dico:
13  raise ValueError("key '{key}' already exists".format(key=key) )
14  self.dico[key] = len(self)
15  self.append(value)

Member Data Documentation

diclist.diclist.dico

Definition at line 8 of file diclist.py.

Referenced by diclist.diclist.__getitem__(), diclist.diclist.__setitem__(), diclist.diclist.add(), and counter.Counter.inc().