diff options
Diffstat (limited to 'pyload/manager/thread')
| -rw-r--r-- | pyload/manager/thread/Addon.py | 5 | ||||
| -rw-r--r-- | pyload/manager/thread/Decrypter.py | 2 | ||||
| -rw-r--r-- | pyload/manager/thread/Download.py | 6 | ||||
| -rw-r--r-- | pyload/manager/thread/Info.py | 6 | ||||
| -rw-r--r-- | pyload/manager/thread/Plugin.py | 3 | 
5 files changed, 18 insertions, 4 deletions
| diff --git a/pyload/manager/thread/Addon.py b/pyload/manager/thread/Addon.py index 7feec227e..f3d219989 100644 --- a/pyload/manager/thread/Addon.py +++ b/pyload/manager/thread/Addon.py @@ -20,7 +20,6 @@ from pyload.manager.thread.Plugin import PluginThread  class AddonThread(PluginThread):      """thread for addons""" -    #--------------------------------------------------------------------------      def __init__(self, m, function, args, kwargs):          """Constructor"""          PluginThread.__init__(self, m) @@ -35,20 +34,24 @@ class AddonThread(PluginThread):          self.start() +      def getActiveFiles(self):          return self.active +      def addActive(self, pyfile):          """ Adds a pyfile to active list and thus will be displayed on overview"""          if pyfile not in self.active:              self.active.append(pyfile) +      def finishFile(self, pyfile):          if pyfile in self.active:              self.active.remove(pyfile)          pyfile.finishIfDone() +      def run(self):          try:              try: diff --git a/pyload/manager/thread/Decrypter.py b/pyload/manager/thread/Decrypter.py index 12806163c..308e94f10 100644 --- a/pyload/manager/thread/Decrypter.py +++ b/pyload/manager/thread/Decrypter.py @@ -33,9 +33,11 @@ class DecrypterThread(PluginThread):          self.start() +      def getActiveFiles(self):          return [self.active] +      def run(self):          """run method""" diff --git a/pyload/manager/thread/Download.py b/pyload/manager/thread/Download.py index 37fe844ec..fc76b655e 100644 --- a/pyload/manager/thread/Download.py +++ b/pyload/manager/thread/Download.py @@ -21,8 +21,6 @@ from pyload.plugin.Plugin import Abort, Fail, Reconnect, Retry, SkipDownload  class DownloadThread(PluginThread):      """thread for downloading files from 'real' hoster plugins""" -    #-------------------------------------------------------------------------- -      def __init__(self, manager):          """Constructor"""          PluginThread.__init__(self, manager) @@ -32,7 +30,9 @@ class DownloadThread(PluginThread):          self.start() +      #-------------------------------------------------------------------------- +      def run(self):          """run method"""          pyfile = None @@ -201,10 +201,12 @@ class DownloadThread(PluginThread):              pyfile.finishIfDone()              self.m.core.files.save() +      def put(self, job):          """assing job to thread"""          self.queue.put(job) +      def stop(self):          """stops the thread"""          self.put("quit") diff --git a/pyload/manager/thread/Info.py b/pyload/manager/thread/Info.py index edc9489e9..487c3b924 100644 --- a/pyload/manager/thread/Info.py +++ b/pyload/manager/thread/Info.py @@ -36,6 +36,7 @@ class InfoThread(PluginThread):          self.start() +      def run(self):          """run method""" @@ -120,9 +121,11 @@ class InfoThread(PluginThread):          self.m.timestamp = time() + 5 * 60 +      def updateDB(self, plugin, result):          self.m.core.files.updateFileInfo(result, self.pid) +      def updateResult(self, plugin, result, force=False):          # parse package name and generate result          # accumulate results @@ -144,9 +147,11 @@ class InfoThread(PluginThread):              self.cache = [] +      def updateCache(self, plugin, result):          self.cache.extend(result) +      def fetchForPlugin(self, pluginname, plugin, urls, cb, err=None):          try:              result = []  # result loaded from cache @@ -184,6 +189,7 @@ class InfoThread(PluginThread):                  result = [(url, 0, 3, url) for url in urls]                  cb(pluginname, result) +      def decryptContainer(self, plugin, url):          data = []          # only works on container plugins diff --git a/pyload/manager/thread/Plugin.py b/pyload/manager/thread/Plugin.py index 1e7d7b4e4..155e687d4 100644 --- a/pyload/manager/thread/Plugin.py +++ b/pyload/manager/thread/Plugin.py @@ -23,7 +23,6 @@ from pyload.api import OnlineStatus  class PluginThread(Thread):      """abstract base class for thread types""" -    #--------------------------------------------------------------------------      def __init__(self, manager):          """Constructor"""          Thread.__init__(self) @@ -70,6 +69,7 @@ class PluginThread(Thread):          self.m.core.log.info("Debug Report written to %s" % dump_name) +      def getDebugDump(self, pyfile):          dump = "pyLoad %s Debug Report of %s %s \n\nTRACEBACK:\n %s \n\nFRAMESTACK:\n" % (              self.m.core.api.getServerVersion(), pyfile.pluginname, pyfile.plugin.__version, format_exc()) @@ -124,6 +124,7 @@ class PluginThread(Thread):          return dump +      def clean(self, pyfile):          """ set thread unactive and release pyfile """          self.active = False | 
