def __init__(self, root, definitions=None): """ @param root: An XML root element. @type root: L{Element} @param definitions: A definitions object. @type definitions: L{Definitions} """ Object.__init__(self) self.root = root pmd = SFactory.metadata() pmd.excludes = ['root'] pmd.wrappers = dict(qname=lambda x: repr(x)) self.__metadata__.__print__ = pmd
def __init__(self, root, definitions): """ @param root: An XML root element. @type root: L{Element} @param definitions: A definitions object. @type definitions: L{Definitions} """ NamedObject.__init__(self, root, definitions) pmd = SFactory.metadata() pmd.wrappers = \ dict(element=lambda x: repr(x), type=lambda x: repr(x)) self.__metadata__.__print__ = pmd tns = definitions.tns self.element = self.__getref('element', tns) self.type = self.__getref('type', tns)