summaryrefslogtreecommitdiffstats
path: root/module/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins')
-rw-r--r--module/plugins/hooks/ContainerDownload.py2
-rw-r--r--module/plugins/hooks/Hook.py16
2 files changed, 18 insertions, 0 deletions
diff --git a/module/plugins/hooks/ContainerDownload.py b/module/plugins/hooks/ContainerDownload.py
index d031cdf69..417b42ee8 100644
--- a/module/plugins/hooks/ContainerDownload.py
+++ b/module/plugins/hooks/ContainerDownload.py
@@ -35,6 +35,8 @@ class ContainerDownload(Hook):
def downloadFinished(self, pyfile):
filename = pyfile.status.filename
+ if not pyfile.url.startswith("http"):
+ return
if filename.endswith(".dlc") or filename.endswith(".ccf") or filename.endswith(".rsdf"):
self.logger.info("ContainerDownload hook: adding container file")
location = abspath(join(pyfile.folder, filename))
diff --git a/module/plugins/hooks/Hook.py b/module/plugins/hooks/Hook.py
index f02432718..09b21ba49 100644
--- a/module/plugins/hooks/Hook.py
+++ b/module/plugins/hooks/Hook.py
@@ -19,10 +19,15 @@
"""
import logging
+from os.path import join
+
+from module.XMLConfigParser import XMLConfigParser
class Hook():
def __init__(self, core):
self.logger = logging.getLogger("log")
+ self.configParser = XMLConfigParser(join("module","config","plugin.xml"), join("module","config","plugin_default.xml"))
+ self.config = {}
props = {}
props['name'] = "Hook"
props['version'] = "0.1"
@@ -32,6 +37,17 @@ class Hook():
self.props = props
self.core = core
+ def readConfig(self):
+ self.configParser.loadData()
+ section = self.props['name']
+ try:
+ self.config = self.configParser.getConfig()[section]
+ except:
+ self.setup()
+
+ def setup(self):
+ pass
+
def downloadStarts(self, pyfile):
pass