Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
#===============================================================================
""" Provide additional functionality on __getattr__ to directly access the simple tree node's attribute. Very generic for most of xml-ed data.
Taylored to Ganga-xml data. """
## ET instance is given
## Path to tree is given. ## Faster iter version else: raise ValueError('Unknown constructor arg: %r'%arg)
"""Return member attribute "name" of itself."""
# print '__getattr__: key=', key # print '__getattr__, abort1', key # Don't use AttributeError since it'll confuse python that the earlier # (property) call is missing and fallback to here with wrong intention. raise ValueError('Attribute not found: '+key) ## Simple value ## Object (Class) raise ValueError('Attribute has no value node: %r'%key)
## At correct location, the dict's key is expected to be nested # such as MetadataDict return self.data[key] # return KeyError('Key not found: %r'%key)
## Delegation return self._tree.findall(arg) return self._tree.remove(arg)
#=============================================================================== |