Esempio n. 1
0
 def __getitem__(self, i):
     #    if (i>=0) and (i<len(self)):
     #      return self.item(i)
     #    raise IndexError
     if i < 0:
         i += _cODP.ODPNodeList_getLength(self.this)
     if (i >= 0) and (i < _cODP.ODPNodeList_getLength(self.this)):
         return _ntype(_cODP.ODPNodeList_item(self.this, i))
     raise IndexError
Esempio n. 2
0
 def __len__(self):
     return int(_cODP.ODPNodeList_getLength(self.this))
Esempio n. 3
0
 def __getattr__(self, name):
     if name == "length":
         return _cODP.ODPNodeList_getLength(self.this)
     raise AttributeError, name