diff options
author | spoob <spoob@gmx.de> | 2010-01-09 22:05:15 +0100 |
---|---|---|
committer | spoob <spoob@gmx.de> | 2010-01-09 22:05:15 +0100 |
commit | ad532495edc4103129bf86b53dec81038babe063 (patch) | |
tree | cc7aaa1b3a7dada6bd75699e8c4ef180ac148e86 /module/XMLConfigParser.py | |
parent | Hooks can set Attributes (diff) | |
download | pyload-ad532495edc4103129bf86b53dec81038babe063.tar.xz |
Hooks Config Incomplete
Diffstat (limited to 'module/XMLConfigParser.py')
-rw-r--r-- | module/XMLConfigParser.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/module/XMLConfigParser.py b/module/XMLConfigParser.py index 5f58c834b..678338b41 100644 --- a/module/XMLConfigParser.py +++ b/module/XMLConfigParser.py @@ -48,6 +48,7 @@ class XMLConfigParser(): if not self.xml.documentElement.getAttribute("version") == self.version: print "Cant Update %s" % self.file exit() #ok? + self.root = self.xml.documentElement self._read_config() def _copyConfig(self): @@ -115,7 +116,6 @@ class XMLConfigParser(): if opt.nodeType == opt.ELEMENT_NODE: if data["option"] == opt.tagName: replace = opt - self._setAttributes(node, data) text = self.xml.createTextNode(str(value)) if replace: replace.replaceChild(text, replace.firstChild) @@ -128,13 +128,12 @@ class XMLConfigParser(): newSection = self.xml.createElement(section) newSection.appendChild(newNode) root.appendChild(newSection) - self._setAttributes(newSection, data) + self._setAttributes(section, data) self.saveData() self.loadData() def _setAttributes(self, node, data): - node.setAttribute("name", node.tagName) - option = node.getElementsByTagName(data["option"])[0] + option = self.root.getElementsByTagName(node)[0].getElementsByTagName(data["option"])[0] option.setAttribute("name", data["name"]) option.setAttribute("type", data["type"]) try: |