diff --git a/pisi/xmlfile.py b/pisi/xmlfile.py index 82926610..c9701f29 100644 --- a/pisi/xmlfile.py +++ b/pisi/xmlfile.py @@ -198,12 +198,6 @@ class autoxml(oo.autosuper): """entry point for metaclass code""" #print 'generating class', name - # add XmlFile as one of the superclasses of cls - #bases = list(bases) - #if not XmlFile in bases: - # bases.append(XmlFile) - bases = (XmlFile) - # standard initialization super(autoxml, cls).__init__(name, bases, dict) @@ -243,7 +237,7 @@ class autoxml(oo.autosuper): if not tag: tag = cls.tag #self.__super.__init__(tag = tag) #FIXME: doesn't work, why? :( - super(cls, self).__init__(tag = tag) + super(cls, self).__init__(tag = tag) # tag for XmlFile support for init in self.__class__.initializers: init(self) # init hook @@ -269,6 +263,8 @@ class autoxml(oo.autosuper): errs = [] for checker in self.__class__.checkers: errs.extend(checker(self, where)) + if hasattr(self, 'check_hook'): + errs.extend(self.check_hook(where)) return errs cls.check = check @@ -287,8 +283,8 @@ class autoxml(oo.autosuper): for x in errs: ctx.ui.warning(x) cls.print_text = print_text - #if not dict.has_key('__str__'): - # cls.__str__ = str + if not dict.has_key('__str__'): + cls.__str__ = print_text def gen_attr_member(cls, attr): """generate readers and writers for an attribute member""" diff --git a/tests/xmlfiletests.py b/tests/xmlfiletests.py index 743c0cfb..0b034807 100644 --- a/tests/xmlfiletests.py +++ b/tests/xmlfiletests.py @@ -45,10 +45,6 @@ class XmlFileTestCase(unittest.TestCase): t_OtherInfo = [ OtherInfo, xmlfile.optional ] a = A() - print A.__class__ - print super(A) - print A.__dict__ - print OtherInfo.__dict__ self.assertEqual(a.href, None) dom = mdom.parse('tests/a.xml') node = getNode(dom, 'A')