summaryrefslogtreecommitdiffstats
path: root/module/plugins/Plugin.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-07-29 17:05:45 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-07-29 17:05:45 +0200
commit252cf9964a2ebc78a589f75db2a7be0d25cac512 (patch)
tree0f4cd1a7949f8a3dc87eaed35f248170ee421943 /module/plugins/Plugin.py
parentmany new stuff, some things already working (diff)
downloadpyload-252cf9964a2ebc78a589f75db2a7be0d25cac512.tar.xz
more improvements and cleaned some imports
Diffstat (limited to 'module/plugins/Plugin.py')
-rw-r--r--module/plugins/Plugin.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/module/plugins/Plugin.py b/module/plugins/Plugin.py
index 51cd78f2d..e8df540a8 100644
--- a/module/plugins/Plugin.py
+++ b/module/plugins/Plugin.py
@@ -18,7 +18,6 @@
"""
import logging
-import re
from os.path import exists
from os.path import join
@@ -89,8 +88,14 @@ class Plugin(object):
self.pyfile = pyfile
self.thread = None # holds thread in future
+ self.setup()
+
def __call__(self):
return self.__name__
+
+ def setup(self):
+ """ more init stuff if needed """
+ pass
def preprocessing(self, thread):
""" handles important things to do before starting """
@@ -98,6 +103,8 @@ class Plugin(object):
if not self.account:
self.req.clearCookies()
+
+ self.pyfile.setStatus("starting")
return self.process(self.pyfile)
@@ -178,6 +185,9 @@ class Plugin(object):
def download(self, url, get={}, post={}, ref=True, cookies=True):
""" downloads the url content to disk """
+
+ self.pyfile.setStatus("downloading")
+
download_folder = self.config['general']['download_folder']
location = join(download_folder, self.pyfile.package().folder.decode(sys.getfilesystemencoding()))
@@ -187,5 +197,7 @@ class Plugin(object):
newname = self.req.download(url, self.pyfile.name, location, get, post, ref, cookies)
+ self.pyfile.size = self.req.dl_size
+
if newname:
self.pyfile.name = newname