summaryrefslogtreecommitdiff
path: root/portato/plugin.py
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2008-06-19 11:23:24 +0200
committerRené 'Necoro' Neumann <necoro@necoro.net>2008-06-19 11:23:24 +0200
commit48f046aec4df3b09906ca41e2c75ce7e0fb045a6 (patch)
tree5562fc5377f9592a6293735e8baf78230a1a48a6 /portato/plugin.py
parentbe7f3e89a19cadad856dae717836f9ed3a66c85d (diff)
parent52f04fc6cccffa7cf31a4d7eab9c9b341f77a293 (diff)
downloadportato-48f046aec4df3b09906ca41e2c75ce7e0fb045a6.tar.gz
portato-48f046aec4df3b09906ca41e2c75ce7e0fb045a6.tar.bz2
portato-48f046aec4df3b09906ca41e2c75ce7e0fb045a6.zip
Merged from trunk
Diffstat (limited to 'portato/plugin.py')
-rw-r--r--portato/plugin.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/portato/plugin.py b/portato/plugin.py
index bf9dc91..5926922 100644
--- a/portato/plugin.py
+++ b/portato/plugin.py
@@ -180,12 +180,13 @@ class Plugin:
"""Gets an <hooks>-elements and parses it.
@param hooks: the hooks node
- @type hooks: Node"""
+ @type hooks: NodeList"""
- for h in hooks.getElementsByTagName("hook"):
- hook = Hook(self, str(h.getAttribute("type")), str(h.getAttribute("call")))
- hook.parse_connects(h.getElementsByTagName("connect"))
- self.hooks.append(hook)
+ if hooks:
+ for h in hooks[0].getElementsByTagName("hook"):
+ hook = Hook(self, str(h.getAttribute("type")), str(h.getAttribute("call")))
+ hook.parse_connects(h.getElementsByTagName("connect"))
+ self.hooks.append(hook)
def parse_menus (self, menus):
"""Get a list of <menu>-elements and parses them.
@@ -388,7 +389,7 @@ class PluginQueue:
if frontendOK is None or frontendOK == True:
plugin = Plugin(p, elem.getElementsByTagName("name")[0], elem.getElementsByTagName("author")[0])
- plugin.parse_hooks(elem.getElementsByTagName("hooks")[0])
+ plugin.parse_hooks(elem.getElementsByTagName("hooks"))
plugin.set_import(elem.getElementsByTagName("import"))
plugin.parse_menus(elem.getElementsByTagName("menu"))
plugin.parse_options(elem.getElementsByTagName("options"))