From 405fbbdff6e6157e1002d7a283d424a3a0fc4cb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eray=20=C3=96zkural?= Date: Mon, 14 Nov 2005 15:39:33 +0000 Subject: [PATCH] * fix several component typos and small bugs, now I could test * workaround: do not try to initialize members of an autoxml class derived from xmlfile. turn off xmlfile_support for members, that is. --- pisi/component.py | 2 +- pisi/index.py | 2 +- pisi/pxml/autoxml.py | 12 +++++++++--- pisi/pxml/xmlfilecdom.py | 1 - 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/pisi/component.py b/pisi/component.py index 86b7dcf2..ed7844af 100644 --- a/pisi/component.py +++ b/pisi/component.py @@ -100,7 +100,7 @@ class ComponentDB(object): return list def add_component(self, component): - self.d[name] = component.name + self.d[component.name] = component def add_package(self, component_name, package): if not self.has_component(component_name): diff --git a/pisi/index.py b/pisi/index.py index ef6a9971..77f9e5e8 100644 --- a/pisi/index.py +++ b/pisi/index.py @@ -80,7 +80,7 @@ class Index(XmlFile): pkgdb = packagedb.get_db(repo) pkgdb.clear() for comp in self.components: - compdb.add_component(pkg) + ctx.componentdb.add_component(comp) for pkg in self.packages: pkgdb.add_package(pkg) diff --git a/pisi/pxml/autoxml.py b/pisi/pxml/autoxml.py index bdb3e3e5..69b3f430 100644 --- a/pisi/pxml/autoxml.py +++ b/pisi/pxml/autoxml.py @@ -297,10 +297,16 @@ class autoxml(oo.autosuper, oo.autoprop): # generate top-level helper functions cls.initializers = inits def initialize(self, **args): - if not args.has_key('tag'): - tag = cls.tag if xmlfile_support: - XmlFile.__init__(self, tag = tag) + # totally dailywtf + #if args.has_key('tag'): + # tag = args['tag'] + #else: + # tag = self.__class__.tag # ought to be autoxml + #XmlFile.__init__(self, tag = tag) + #workaround: init only top level xmlfile, not the parts + if not args.has_key('tag'): + XmlFile.__init__(self, tag = cls.tag) for base in cls.autoxml_bases: base.__init__(self) #super(cls, self).__init__(tag = tag) cooperative shit disabled for now diff --git a/pisi/pxml/xmlfilecdom.py b/pisi/pxml/xmlfilecdom.py index 7aea90bc..2f65dbbb 100644 --- a/pisi/pxml/xmlfilecdom.py +++ b/pisi/pxml/xmlfilecdom.py @@ -61,7 +61,6 @@ class XmlFile(object): def unlink(self): """deallocate DOM structure""" del self.doc - #self.doc = None # why? def rootNode(self): """returns root document element"""