summaryrefslogtreecommitdiffstats
path: root/module/file_list.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/file_list.py')
-rw-r--r--module/file_list.py36
1 files changed, 35 insertions, 1 deletions
diff --git a/module/file_list.py b/module/file_list.py
index e3c3f68ae..b7455410c 100644
--- a/module/file_list.py
+++ b/module/file_list.py
@@ -23,7 +23,6 @@ LIST_VERSION = 2
from threading import RLock
import cPickle
-from Py_Load_File import PyLoadFile
from module.remote.RequestObject import RequestObject
class File_List(object):
@@ -139,3 +138,38 @@ class File_List(object):
class Data():
def __init__(self, url):
self.url = url
+
+import re
+
+from download_thread import Status
+
+class PyLoadFile:
+ """ represents the url or file
+ """
+ def __init__(self, parent, url):
+ self.parent = parent
+ self.id = None
+ self.url = url
+ self.filename = "filename"
+ self.download_folder = ""
+ self.modul = __import__(self._get_my_plugin())
+ pluginClass = getattr(self.modul, self.modul.__name__)
+ self.plugin = pluginClass(self)
+ self.status = Status(self)
+
+ def _get_my_plugin(self):
+ """ searches the right plugin for an url
+ """
+ for plugin, plugin_pattern in self.parent.plugins_avaible.items():
+ if re.match(plugin_pattern, self.url) != None:
+ return plugin
+
+ return "Plugin"
+
+ def init_download(self):
+
+ if self.parent.config['proxy']['activated']:
+ self.plugin.req.add_proxy(self.parent.config['proxy']['protocol'], self.parent.config['proxy']['adress'])
+
+ #@todo: check dependicies, ocr etc
+