Package pyxsd :: Package elementRepresentatives :: Module enumeration
[hide private]
[frames] | no frames]

Source Code for Module pyxsd.elementRepresentatives.enumeration

 1  from elementRepresentative import ElementRepresentative 
 2   
 3  #============================================================ 
 4  # 
5 -class Enumeration(ElementRepresentative):
6 """ 7 The class for the Enumeration tag. Subclass of *ElementRepresentative*. 8 """
9 - def __init__(self, xsdElement, parent):
10 """ 11 See *ElementRepresentative* for documentation. 12 """ 13 ElementRepresentative.__init__(self, xsdElement, parent) 14 15 self.value = self.xsdElement.get('value') 16 17 self.getContainingType().enumerations.append(self.value)
18 19 #============================================================ 20 #
21 - def getName(self):
22 """ 23 Makes a name like this- `ContainingTypeName`|enuneration|`an id number`. 24 The name on this class is used for almost nothing. 25 """ 26 enumNum = len(self.getContainingType().enumerations) + 1 27 return "%s|enumeration|%i" % (self.getContainingTypeName(), 28 enumNum)
29