summaryrefslogtreecommitdiffstats
path: root/module/XMLConfigParser.py
diff options
context:
space:
mode:
authorGravatar mkaay <mkaay@mkaay.de> 2010-02-08 13:04:21 +0100
committerGravatar mkaay <mkaay@mkaay.de> 2010-02-08 13:04:21 +0100
commit9ab155e95db32e03ca6438df12d38500f9d437f9 (patch)
treecf3ba616032324fc5be9ce572b8f239fec39ac31 /module/XMLConfigParser.py
parentFlashGot + ClickNLoad Support + Webif. improvm.!! pyLoad FTW !! (diff)
downloadpyload-9ab155e95db32e03ca6438df12d38500f9d437f9.tar.xz
fixed click'n'load, added youtube hd option
Diffstat (limited to 'module/XMLConfigParser.py')
-rw-r--r--module/XMLConfigParser.py23
1 files changed, 21 insertions, 2 deletions
diff --git a/module/XMLConfigParser.py b/module/XMLConfigParser.py
index 678338b41..8be2df048 100644
--- a/module/XMLConfigParser.py
+++ b/module/XMLConfigParser.py
@@ -131,11 +131,30 @@ class XMLConfigParser():
self._setAttributes(section, data)
self.saveData()
self.loadData()
+
+ def remove(self, section, option):
+ root = self.root
+ for node in root.childNodes:
+ if node.nodeType == node.ELEMENT_NODE:
+ if section == node.tagName:
+ for opt in node.childNodes:
+ if opt.nodeType == opt.ELEMENT_NODE:
+ if option == opt.tagName:
+ node.removeChild(opt)
+ self.saveData()
+ return
+
def _setAttributes(self, node, data):
option = self.root.getElementsByTagName(node)[0].getElementsByTagName(data["option"])[0]
- option.setAttribute("name", data["name"])
- option.setAttribute("type", data["type"])
+ try:
+ option.setAttribute("name", data["name"])
+ except:
+ pass
+ try:
+ option.setAttribute("type", data["type"])
+ except:
+ pass
try:
option.setAttribute("input", data["input"])
except: