* 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.
This commit is contained in:
+1
-1
@@ -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):
|
||||
|
||||
+1
-1
@@ -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)
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"""
|
||||
|
||||
Reference in New Issue
Block a user