diff options
author | Walter Purcaro <vuolter@gmail.com> | 2014-10-03 21:20:20 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-10-03 21:20:20 +0200 |
commit | f6e5359110f4bd5facc04a98f94acbc41b6e5228 (patch) | |
tree | 1f625724951c1b3a848f96c65708f437807f7190 | |
parent | [UpdateManager] Support new plugins structure (diff) | |
download | pyload-f6e5359110f4bd5facc04a98f94acbc41b6e5228.tar.xz |
Update pyload to the new plugins structure
65 files changed, 219 insertions, 215 deletions
diff --git a/docs/docs.conf b/docs/docs.conf index fd2987784..749e09212 100644 --- a/docs/docs.conf +++ b/docs/docs.conf @@ -8,7 +8,7 @@ output: html target: docs docformat: restructuredtext -exclude: pyload\.lib|pyload\.remote\.thriftbackend\.thriftgen|\.pyc|\.pyo|pyload\.plugins\.(accounts|container|crypter|hooks|hoster|internal|ocr) +exclude: pyload\.lib|pyload\.remote\.thriftbackend\.thriftgen|\.pyc|\.pyo|pyload\.plugins\.(account|addon|base|container|crypter|hook|hoster|internal|ocr) name: pyLoad Documentation url: http://docs.pyload.org diff --git a/pyload/Core.py b/pyload/Core.py index 902b6fdb3..6b67f8984 100644 --- a/pyload/Core.py +++ b/pyload/Core.py @@ -377,7 +377,7 @@ class Core(object): # later imported because they would trigger api import, and remote value not set correctly from pyload import api - from pyload.manager.HookManager import HookManager + from pyload.manager.AddonManager import AddonManager from pyload.manager.ThreadManager import ThreadManager if api.activated != self.remote: @@ -393,7 +393,7 @@ class Core(object): self.accountManager = AccountManager(self) self.threadManager = ThreadManager(self) self.captchaManager = CaptchaManager(self) - self.hookManager = HookManager(self) + self.addonManager = AddonManager(self) self.remoteManager = RemoteManager(self) self.js = JsEngine(self) @@ -435,7 +435,7 @@ class Core(object): self.running = True self.log.info(_("Activating Plugins...")) - self.hookManager.coreReady() + self.addonManager.coreReady() self.log.info(_("pyLoad is up and running")) @@ -576,7 +576,7 @@ class Core(object): for pyfile in pyfiles: pyfile.abortDownload() - self.hookManager.coreExiting() + self.addonManager.coreExiting() except: if self.debug: diff --git a/pyload/api/__init__.py b/pyload/api/__init__.py index 9c4740e82..a6927b238 100644 --- a/pyload/api/__init__.py +++ b/pyload/api/__init__.py @@ -145,7 +145,7 @@ class Api(Iface): :param value: new config value :param section: 'plugin' or 'core """ - self.core.hookManager.dispatchEvent("configChanged", category, option, value, section) + self.core.addonManager.dispatchEvent("configChanged", category, option, value, section) if section == "core": self.core.config[category][option] = value @@ -960,12 +960,12 @@ class Api(Iface): @permission(PERMS.STATUS) def getServices(self): - """ A dict of available services, these can be defined by hook plugins. + """ A dict of available services, these can be defined by addon plugins. :return: dict with this style: {"plugin": {"method": "description"}} """ data = {} - for plugin, funcs in self.core.hookManager.methods.iteritems(): + for plugin, funcs in self.core.addonManager.methods.iteritems(): data[plugin] = funcs return data @@ -978,12 +978,12 @@ class Api(Iface): :param func: :return: bool """ - cont = self.core.hookManager.methods + cont = self.core.addonManager.methods return plugin in cont and func in cont[plugin] @permission(PERMS.STATUS) def call(self, info): - """Calls a service (a method in hook plugin). + """Calls a service (a method in addon plugin). :param info: `ServiceCall` :return: result @@ -999,18 +999,18 @@ class Api(Iface): raise ServiceDoesNotExists(plugin, func) try: - ret = self.core.hookManager.callRPC(plugin, func, args, parse) + ret = self.core.addonManager.callRPC(plugin, func, args, parse) return str(ret) except Exception, e: raise ServiceException(e.message) @permission(PERMS.STATUS) def getAllInfo(self): - """Returns all information stored by hook plugins. Values are always strings + """Returns all information stored by addon plugins. Values are always strings :return: {"plugin": {"name": value}} """ - return self.core.hookManager.getAllInfo() + return self.core.addonManager.getAllInfo() @permission(PERMS.STATUS) def getInfoByPlugin(self, plugin): @@ -1019,7 +1019,7 @@ class Api(Iface): :param plugin: pluginname :return: dict of attr names mapped to value {"name": value} """ - return self.core.hookManager.getInfo(plugin) + return self.core.addonManager.getInfo(plugin) def changePassword(self, user, oldpw, newpw): """ changes password for specific user """ diff --git a/pyload/database/FileDatabase.py b/pyload/database/FileDatabase.py index 54e5450e8..3594da685 100644 --- a/pyload/database/FileDatabase.py +++ b/pyload/database/FileDatabase.py @@ -120,7 +120,7 @@ class FileHandler: def addLinks(self, urls, package): """adds links""" - self.core.hookManager.dispatchEvent("linksAdded", urls, package) + self.core.addonManager.dispatchEvent("linksAdded", urls, package) data = self.core.pluginManager.parseUrls(urls) @@ -166,7 +166,7 @@ class FileHandler: self.db.deletePackage(p) self.core.pullManager.addEvent(e) - self.core.hookManager.dispatchEvent("packageDeleted", id) + self.core.addonManager.dispatchEvent("packageDeleted", id) if id in self.packageCache: del self.packageCache[id] @@ -368,7 +368,7 @@ class FileHandler: """checks if all files are finished and dispatch event""" if not self.getQueueCount(True): - self.core.hookManager.dispatchEvent("allDownloadsFinished") + self.core.addonManager.dispatchEvent("allDownloadsFinished") self.core.log.debug("All downloads finished") return True @@ -381,7 +381,7 @@ class FileHandler: self.resetCount() if not self.db.processcount(1, fid): - self.core.hookManager.dispatchEvent("allDownloadsProcessed") + self.core.addonManager.dispatchEvent("allDownloadsProcessed") self.core.log.debug("All downloads processed") return True @@ -528,7 +528,7 @@ class FileHandler: if not ids or (pyfile.id in ids and len(ids) == 1): if not pyfile.package().setFinished: self.core.log.info(_("Package finished: %s") % pyfile.package().name) - self.core.hookManager.packageFinished(pyfile.package()) + self.core.addonManager.packageFinished(pyfile.package()) pyfile.package().setFinished = True diff --git a/pyload/manager/AccountManager.py b/pyload/manager/AccountManager.py index d1958f4b6..ec092d740 100644 --- a/pyload/manager/AccountManager.py +++ b/pyload/manager/AccountManager.py @@ -36,7 +36,7 @@ class AccountManager: if plugin in self.accounts: if plugin not in self.plugins: try: - self.plugins[plugin] = self.core.pluginManager.loadClass("accounts", plugin)(self, self.accounts[plugin]) + self.plugins[plugin] = self.core.pluginManager.loadClass("account", plugin)(self, self.accounts[plugin]) except TypeError: # The account class no longer exists (blacklisted plugin). Skipping the account to avoid crash return None diff --git a/pyload/manager/HookManager.py b/pyload/manager/AddonManager.py index 6f5477aeb..a81e0a74f 100644 --- a/pyload/manager/HookManager.py +++ b/pyload/manager/AddonManager.py @@ -25,21 +25,21 @@ from threading import RLock from types import MethodType -from pyload.manager.thread.PluginThread import HookThread +from pyload.manager.thread.PluginThread import AddonThread from pyload.manager.PluginManager import literal_eval from utils import lock -class HookManager: - """Manages hooks, delegates and handles Events. +class AddonManager: + """Manages addons, delegates and handles Events. Every plugin can define events, \ but some very usefull events are called by the Core. - Contrary to overwriting hook methods you can use event listener, + Contrary to overwriting addon methods you can use event listener, which provides additional entry point in the control flow. Only do very short tasks or use threads. **Known Events:** - Most hook methods exists as events. These are the additional known events. + Most addon methods exists as events. These are the additional known events. ===================== ============== ================================== Name Arguments Description @@ -65,7 +65,7 @@ class HookManager: self.core = core self.config = self.core.config - __builtin__.hookManager = self #needed to let hooks register themself + __builtin__.addonManager = self #needed to let addons register themself self.log = self.core.log self.plugins = [] @@ -77,7 +77,7 @@ class HookManager: #registering callback for config event self.config.pluginCB = MethodType(self.dispatchEvent, "pluginConfigChanged", basestring) - self.addEvent("pluginConfigChanged", self.manageHooks) + self.addEvent("pluginConfigChanged", self.manageAddon) self.lock = RLock() self.createIndex() @@ -87,7 +87,7 @@ class HookManager: try: return func(*args) except Exception, e: - args[0].log.error(_("Error executing hooks: %s") % str(e)) + args[0].log.error(_("Error executing addon: %s") % e) if args[0].core.debug: traceback.print_exc() @@ -119,12 +119,12 @@ class HookManager: active = [] deactive = [] - for pluginname in self.core.pluginManager.hookPlugins: + for pluginname in self.core.pluginManager.addonPlugins: try: - #hookClass = getattr(plugin, plugin.__name__) + # hookClass = getattr(plugin, plugin.__name__) if self.config.getPlugin(pluginname, "activated"): - pluginClass = self.core.pluginManager.loadClass("hooks", pluginname) + pluginClass = self.core.pluginManager.loadClass("addon", pluginname) if not pluginClass: continue plugin = pluginClass(self.core, self) @@ -146,20 +146,20 @@ class HookManager: self.plugins = plugins - def manageHooks(self, plugin, name, value): + def manageAddon(self, plugin, name, value): if name == "activated" and value: - self.activateHook(plugin) + self.activateAddon(plugin) elif name == "activated" and not value: - self.deactivateHook(plugin) + self.deactivateAddon(plugin) - def activateHook(self, plugin): + def activateAddon(self, plugin): #check if already loaded for inst in self.plugins: if inst.__name__ == plugin: return - pluginClass = self.core.pluginManager.loadClass("hooks", plugin) + pluginClass = self.core.pluginManager.loadClass("addon", plugin) if not pluginClass: return @@ -172,23 +172,24 @@ class HookManager: # call core Ready start_new_thread(plugin.coreReady, tuple()) - def deactivateHook(self, plugin): + def deactivateAddon(self, plugin): - hook = None + addon = None for inst in self.plugins: if inst.__name__ == plugin: - hook = inst + addon = inst - if not hook: return + if not addon: + return self.log.debug("Plugin unloaded: %s" % plugin) - hook.unload() + addon.unload() #remove periodic call - self.log.debug("Removed callback %s" % self.core.scheduler.removeJob(hook.cb)) - self.plugins.remove(hook) - del self.pluginMap[hook.__name__] + self.log.debug("Removed callback %s" % self.core.scheduler.removeJob(addon.cb)) + self.plugins.remove(addon) + del self.pluginMap[addon.__name__] @try_catch @@ -256,7 +257,7 @@ class HookManager: self.dispatchEvent("afterReconnecting", ip) def startThread(self, function, *args, **kwargs): - t = HookThread(self.core.threadManager, function, args, kwargs) + t = AddonThread(self.core.threadManager, function, args, kwargs) def activePlugins(self): """ returns all active plugins """ diff --git a/pyload/manager/CaptchaManager.py b/pyload/manager/CaptchaManager.py index 0ba876ae8..06f1347fc 100644 --- a/pyload/manager/CaptchaManager.py +++ b/pyload/manager/CaptchaManager.py @@ -64,7 +64,7 @@ class CaptchaManager: if cli: #client connected -> should solve the captcha task.setWaiting(50) #wait 50 sec for response - for plugin in self.core.hookManager.activePlugins(): + for plugin in self.core.addonManager.activePlugins(): try: plugin.newCaptchaTask(task) except: @@ -87,7 +87,7 @@ class CaptchaTask: self.captchaFormat = format self.captchaFile = file self.captchaResultType = result_type - self.handler = [] #the hook plugins that will take care of the solution + self.handler = [] #: the hook plugins that will take care of the solution self.result = None self.waitUntil = None self.error = None #error message diff --git a/pyload/manager/PluginManager.py b/pyload/manager/PluginManager.py index 56e59237c..939b17347 100644 --- a/pyload/manager/PluginManager.py +++ b/pyload/manager/PluginManager.py @@ -17,7 +17,7 @@ from pyload.config.Parser import IGNORE class PluginManager: ROOT = "pyload.plugins." USERROOT = "userplugins." - TYPES = ("accounts", "container", "crypter", "hooks", "hoster", "internal", "ocr") + TYPES = ("account", "addon", "base", "container", "crypter", "hook", "hoster", "internal", "ocr") PATTERN = re.compile(r'__pattern__.*=.*r("|\')([^"\']+)') VERSION = re.compile(r'__version__.*=.*("|\')([0-9.]+)') @@ -49,14 +49,15 @@ class PluginManager: f = open(join("userplugins", "__init__.py"), "wb") f.close() - self.plugins['crypter'] = self.crypterPlugins = self.parse("crypter", pattern=True) + self.plugins['account'] = self.accountPlugins = self.parse("account") + self.plugins['addon'] = self.addonPlugins = self.parse("addon") + self.plugins['base'] = self.basePlugins = self.parse("base") self.plugins['container'] = self.containerPlugins = self.parse("container", pattern=True) + self.plugins['crypter'] = self.crypterPlugins = self.parse("crypter", pattern=True) + # self.plugins['hook'] = self.hookPlugins = self.parse("hook") self.plugins['hoster'] = self.hosterPlugins = self.parse("hoster", pattern=True) - - self.plugins['ocr'] = self.captchaPlugins = self.parse("ocr") - self.plugins['accounts'] = self.accountPlugins = self.parse("accounts") - self.plugins['hooks'] = self.hookPlugins = self.parse("hooks") self.plugins['internal'] = self.internalPlugins = self.parse("internal") + self.plugins['ocr'] = self.ocrPlugins = self.parse("ocr") self.log.debug("created index of plugins") @@ -154,7 +155,7 @@ class PluginManager: else: config = [list(config)] - if folder == "hooks": + if folder == "addon": append = True for item in config: if item[0] == "activated": append = False @@ -167,7 +168,7 @@ class PluginManager: except: self.log.error("Invalid config in %s: %s" % (name, config)) - elif folder == "hooks": #force config creation + elif folder == "addon": #force config creation desc = self.DESC.findall(content) desc = desc[0][1] if desc else "" config = (["activated", "bool", "Activated", False],) @@ -318,7 +319,7 @@ class PluginManager: as_dict = {} for t,n in type_plugins: - if t in ("hooks", "internal"): #: do not reload hooks or internals, because would cause to much side effects + if t in ("base", "addon", "internal"): #: do not reload them because would cause to much side effects continue elif t in as_dict: as_dict[t].append(n) @@ -339,11 +340,13 @@ class PluginManager: reloaded.append(id) #index creation - self.plugins['crypter'] = self.crypterPlugins = self.parse("crypter", pattern=True) + self.plugins['account'] = self.accountPlugins = self.parse("account") self.plugins['container'] = self.containerPlugins = self.parse("container", pattern=True) + self.plugins['crypter'] = self.crypterPlugins = self.parse("crypter", pattern=True) + # self.plugins['hook'] = self.hookPlugins = self.parse("hook") self.plugins['hoster'] = self.hosterPlugins = self.parse("hoster", pattern=True) - self.plugins['ocr'] = self.captchaPlugins = self.parse("ocr") - self.plugins['accounts'] = self.accountPlugins = self.parse("accounts") + self.plugins['ocr'] = self.ocrPlugins = self.parse("ocr") + if "accounts" in as_dict: #: accounts needs to be reloaded self.core.accountManager.initPlugins() diff --git a/pyload/manager/ThreadManager.py b/pyload/manager/ThreadManager.py index 1073f8040..50af4a93a 100644 --- a/pyload/manager/ThreadManager.py +++ b/pyload/manager/ThreadManager.py @@ -42,8 +42,8 @@ class ThreadManager: self.core = core self.log = core.log - self.threads = [] # thread list - self.localThreads = [] #hook+decrypter threads + self.threads = [] #: thread list + self.localThreads = [] #: addon+decrypter threads self.pause = True @@ -185,7 +185,7 @@ class ThreadManager: ip = self.getIP() - self.core.hookManager.beforeReconnecting(ip) + self.core.addonManager.beforeReconnecting(ip) self.log.debug("Old IP: %s" % ip) @@ -202,7 +202,7 @@ class ThreadManager: reconn.wait() sleep(1) ip = self.getIP() - self.core.hookManager.afterReconnecting(ip) + self.core.addonManager.afterReconnecting(ip) self.log.info(_("Reconnected, new IP: %s") % ip) diff --git a/pyload/manager/thread/PluginThread.py b/pyload/manager/thread/PluginThread.py index 5c274fa46..c5092a207 100644 --- a/pyload/manager/thread/PluginThread.py +++ b/pyload/manager/thread/PluginThread.py @@ -182,11 +182,11 @@ class DownloadThread(PluginThread): self.m.log.info(_("Download starts: %s" % pyfile.name)) # start download - self.m.core.hookManager.downloadPreparing(pyfile) + self.m.core.addonManager.downloadPreparing(pyfile) pyfile.plugin.preprocessing(self) self.m.log.info(_("Download finished: %s") % pyfile.name) - self.m.core.hookManager.downloadFinished(pyfile) + self.m.core.addonManager.downloadFinished(pyfile) self.m.core.files.checkPackageFinished(pyfile) except NotImplementedError: @@ -236,7 +236,7 @@ class DownloadThread(PluginThread): self.m.log.warning(_("Download failed: %(name)s | %(msg)s") % {"name": pyfile.name, "msg": msg}) pyfile.error = msg - self.m.core.hookManager.downloadFailed(pyfile) + self.m.core.addonManager.downloadFailed(pyfile) self.clean(pyfile) continue @@ -277,7 +277,7 @@ class DownloadThread(PluginThread): print_exc() self.writeDebugReport(pyfile) - self.m.core.hookManager.downloadFailed(pyfile) + self.m.core.addonManager.downloadFailed(pyfile) self.clean(pyfile) continue @@ -307,7 +307,7 @@ class DownloadThread(PluginThread): print_exc() self.writeDebugReport(pyfile) - self.m.core.hookManager.downloadFailed(pyfile) + self.m.core.addonManager.downloadFailed(pyfile) self.clean(pyfile) continue @@ -409,7 +409,7 @@ class DecrypterThread(PluginThread): exc_clear() - #self.m.core.hookManager.downloadFinished(pyfile) + #self.m.core.addonManager.downloadFinished(pyfile) #self.m.localThreads.remove(self) @@ -418,8 +418,8 @@ class DecrypterThread(PluginThread): pyfile.delete() -class HookThread(PluginThread): - """thread for hooks""" +class AddonThread(PluginThread): + """thread for addons""" #-------------------------------------------------------------------------- def __init__(self, m, function, args, kwargs): diff --git a/pyload/plugins/Plugin.py b/pyload/plugins/Plugin.py index 6bb325760..7ebaed541 100644 --- a/pyload/plugins/Plugin.py +++ b/pyload/plugins/Plugin.py @@ -205,7 +205,7 @@ class Plugin(Base): self.html = None #: quick caller for API - self.api = self.core.api + self.api = self.core.api self.init() @@ -260,7 +260,7 @@ class Plugin(Base): 10 - not implemented 20 - unknown error """ - #@TODO checksum check hook + #@TODO checksum check addon return True, 10 @@ -362,10 +362,10 @@ class Plugin(Base): temp_file.write(img) temp_file.close() - has_plugin = self.__name__ in self.core.pluginManager.captchaPlugins + has_plugin = self.__name__ in self.core.pluginManager.ocrPlugins if self.core.captcha: - Ocr = self.core.pluginManager.loadClass("captcha", self.__name__) + Ocr = self.core.pluginManager.loadClass("ocr", self.__name__) else: Ocr = None @@ -508,7 +508,7 @@ class Plugin(Base): filename = join(location, name) - self.core.hookManager.dispatchEvent("downloadStarts", self.pyfile, url, filename) + self.core.addonManager.dispatchEvent("downloadStarts", self.pyfile, url, filename) try: newname = self.req.httpDownload(url, filename, get=get, post=post, ref=ref, cookies=cookies, diff --git a/pyload/plugins/account/TusfilesNet.py b/pyload/plugins/account/TusfilesNet.py index c4d912022..b00770a59 100644 --- a/pyload/plugins/account/TusfilesNet.py +++ b/pyload/plugins/account/TusfilesNet.py @@ -14,7 +14,7 @@ class TusfilesNet(Account): __type__ = "account" __version__ = "0.01" - __description__ = """ Tusfile.net account plugin """ + __description__ = """Tusfile.net account plugin""" __author_name__ = "guidobelix" __author_mail__ = "guidobelix@hotmail.it" diff --git a/pyload/plugins/addon/AlldebridCom.py b/pyload/plugins/addon/AlldebridCom.py index 8eade2941..7882b9bc2 100644 --- a/pyload/plugins/addon/AlldebridCom.py +++ b/pyload/plugins/addon/AlldebridCom.py @@ -6,7 +6,7 @@ from pyload.plugins.internal.MultiHoster import MultiHoster class AlldebridCom(MultiHoster): __name__ = "AlldebridCom" - __type__ = "hook" + __type__ = "addon" __version__ = "0.13" __config__ = [("activated", "bool", "Activated", False), @@ -16,7 +16,7 @@ class AlldebridCom(MultiHoster): ("unloadFailing", "bool", "Revert to stanard download if download fails", False), ("interval", "int", "Reload interval in hours (0 to disable)", 24)] - __description__ = """Alldebrid.com hook plugin""" + __description__ = """Alldebrid.com addon plugin""" __author_name__ = "Andy Voigt" __author_mail__ = "spamsales@online.de" diff --git a/pyload/plugins/addon/BypassCaptcha.py b/pyload/plugins/addon/BypassCaptcha.py index fdd1e567c..51b363eed 100644 --- a/pyload/plugins/addon/BypassCaptcha.py +++ b/pyload/plugins/addon/BypassCaptcha.py @@ -5,7 +5,7 @@ from thread import start_new_thread from pyload.network.HTTPRequest import BadHeader from pyload.network.RequestFactory import getURL, getRequest -from pyload.plugins.base.Hook import Hook +from pyload.plugins.base.Addon import Addon class BypassCaptchaException(Exception): @@ -23,9 +23,9 @@ class BypassCaptchaException(Exception): return "<BypassCaptchaException %s>" % self.err -class BypassCaptcha(Hook): +class BypassCaptcha(Addon): __name__ = "BypassCaptcha" - __type__ = "hook" + __type__ = "addon" __version__ = "0.04" __config__ = [("activated", "bool", "Activated", False), diff --git a/pyload/plugins/addon/Captcha9kw.py b/pyload/plugins/addon/Captcha9kw.py index 45890815c..1cd605b5e 100644 --- a/pyload/plugins/addon/Captcha9kw.py +++ b/pyload/plugins/addon/Captcha9kw.py @@ -9,12 +9,12 @@ from thread import start_new_thread from pyload.network.HTTPRequest import BadHeader from pyload.network.RequestFactory import getURL -from pyload.plugins.base.Hook import Hook +from pyload.plugins.base.Addon import Addon -class Captcha9kw(Hook): +class Captcha9kw(Addon): __name__ = "Captcha9kw" - __type__ = "hook" + __type__ = "addon" __version__ = "0.09" __config__ = [("activated", "bool", "Activated", False), diff --git a/pyload/plugins/addon/CaptchaBrotherhood.py b/pyload/plugins/addon/CaptchaBrotherhood.py index 8f6f8d68b..a2c9086c8 100644 --- a/pyload/plugins/addon/CaptchaBrotherhood.py +++ b/pyload/plugins/addon/CaptchaBrotherhood.py @@ -11,7 +11,7 @@ from time import sleep from urllib import urlencode from pyload.network.RequestFactory import getURL, getRequest -from pyload.plugins.base.Hook import Hook +from pyload.plugins.base.Addon import Addon class CaptchaBrotherhoodException(Exception): @@ -29,9 +29,9 @@ class CaptchaBrotherhoodException(Exception): return "<CaptchaBrotherhoodException %s>" % self.err -class CaptchaBrotherhood(Hook): +class CaptchaBrotherhood(Addon): __name__ = "CaptchaBrotherhood" - __type__ = "hook" + __type__ = "addon" __version__ = "0.05" __config__ = [("activated", "bool", "Activated", False), diff --git a/pyload/plugins/addon/Checksum.py b/pyload/plugins/addon/Checksum.py index ae9ee1325..1ce5415ed 100644 --- a/pyload/plugins/addon/Checksum.py +++ b/pyload/plugins/addon/Checksum.py @@ -9,7 +9,7 @@ import zlib from os import remove from os.path import getsize, isfile, splitext -from pyload.plugins.base.Hook import Hook +from pyload.plugins.base.Addon import Addon from pyload.utils import safe_join, fs_encode @@ -37,9 +37,9 @@ def computeChecksum(local_file, algorithm): return None -class Checksum(Hook): +class Checksum(Addon): __name__ = "Checksum" - __type__ = "hook" + __type__ = "addon" __version__ = "0.13" __config__ = [("activated", "bool", "Activated", False), diff --git a/pyload/plugins/addon/ClickAndLoad.py b/pyload/plugins/addon/ClickAndLoad.py index ede970ee8..ae541ca09 100644 --- a/pyload/plugins/addon/ClickAndLoad.py +++ b/pyload/plugins/addon/ClickAndLoad.py @@ -3,12 +3,12 @@ import socket import thread -from pyload.plugins.base.Hook import Hook +from pyload.plugins.base.Addon import Addon -class ClickAndLoad(Hook): +class ClickAndLoad(Addon): __name__ = "ClickAndLoad" - __type__ = "hook" + __type__ = "addon" __version__ = "0.22" __config__ = [("activated", "bool", "Activated", True), diff --git a/pyload/plugins/addon/DeathByCaptcha.py b/pyload/plugins/addon/DeathByCaptcha.py index 6e7a585ad..ed2602e32 100644 --- a/pyload/plugins/addon/DeathByCaptcha.py +++ b/pyload/plugins/addon/DeathByCaptcha.py @@ -12,7 +12,7 @@ from time import sleep from pyload.utils import json_loads from pyload.network.HTTPRequest import BadHeader from pyload.network.RequestFactory import getRequest -from pyload.plugins.base.Hook import Hook +from pyload.plugins.base.Addon import Addon class DeathByCaptchaException(Exception): @@ -44,9 +44,9 @@ class DeathByCaptchaException(Exception): return "<DeathByCaptchaException %s>" % self.err -class DeathByCaptcha(Hook): +class DeathByCaptcha(Addon): __name__ = "DeathByCaptcha" - __type__ = "hook" + __type__ = "addon" __version__ = "0.03" __config__ = [("activated", "bool", "Activated", False), diff --git a/pyload/plugins/addon/DebridItaliaCom.py b/pyload/plugins/addon/DebridItaliaCom.py index 4272b758f..0cb7a6f4f 100644 --- a/pyload/plugins/addon/DebridItaliaCom.py +++ b/pyload/plugins/addon/DebridItaliaCom.py @@ -5,7 +5,7 @@ from pyload.plugins.internal.MultiHoster import MultiHoster class DebridItaliaCom(MultiHoster): __name__ = "DebridItaliaCom" - __type__ = "hook" + __type__ = "addon" __version__ = "0.07" __config__ = [("activated", "bool", "Activated", False), @@ -14,7 +14,7 @@ class DebridItaliaCom(MultiHoster): ("unloadFailing", "bool", "Revert to standard download if download fails", False), ("interval", "int", "Reload interval in hours (0 to disable)", 24)] - __description__ = """Debriditalia.com hook plugin""" + __description__ = """Debriditalia.com addon plugin""" __author_name__ = "stickell" __author_mail__ = "l.stickell@yahoo.it" diff --git a/pyload/plugins/addon/DeleteFinished.py b/pyload/plugins/addon/DeleteFinished.py index 6da42c4e3..eb6992fec 100644 --- a/pyload/plugins/addon/DeleteFinished.py +++ b/pyload/plugins/addon/DeleteFinished.py @@ -1,12 +1,12 @@ # -*- coding: utf-8 -*- from pyload.database import style -from pyload.plugins.base.Hook import Hook +from pyload.plugins.base.Addon import Addon -class DeleteFinished(Hook): +class DeleteFinished(Addon): __name__ = "DeleteFinished" - __type__ = "hook" + __type__ = "addon" __version__ = "1.09" __config__ = [('activated', 'bool', 'Activated', 'False'), diff --git a/pyload/plugins/addon/DownloadScheduler.py b/pyload/plugins/addon/DownloadScheduler.py index 8336953ee..21b756ea6 100644 --- a/pyload/plugins/addon/DownloadScheduler.py +++ b/pyload/plugins/addon/DownloadScheduler.py @@ -4,12 +4,12 @@ import re from time import localtime -from pyload.plugins.base.Hook import Hook +from pyload.plugins.base.Addon import Addon -class DownloadScheduler(Hook): +class DownloadScheduler(Addon): __name__ = "DownloadScheduler" - __type__ = "hook" + __type__ = "addon" __version__ = "0.21" __config__ = [("activated", "bool", "Activated", False), @@ -23,7 +23,7 @@ class DownloadScheduler(Hook): def setup(self): - self.cb = None # callback to scheduler job; will be by removed hookmanager when hook unloaded + self.cb = None # callback to scheduler job; will be by removed hookmanager when addon unloaded def coreReady(self): self.updateSchedule() diff --git a/pyload/plugins/addon/EasybytezCom.py b/pyload/plugins/addon/EasybytezCom.py index 9d1cdc0db..a04111f78 100644 --- a/pyload/plugins/addon/EasybytezCom.py +++ b/pyload/plugins/addon/EasybytezCom.py @@ -7,14 +7,14 @@ from pyload.plugins.internal.MultiHoster import MultiHoster class EasybytezCom(MultiHoster): __name__ = "EasybytezCom" - __type__ = "hook" + __type__ = "addon" __version__ = "0.03" __config__ = [("activated", "bool", "Activated", False), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), ("hosterList", "str", "Hoster list (comma separated)", "")] - __description__ = """EasyBytez.com hook plugin""" + __description__ = """EasyBytez.com addon plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" diff --git a/pyload/plugins/addon/Ev0InFetcher.py b/pyload/plugins/addon/Ev0InFetcher.py index 0df65ceb6..535d16264 100644 --- a/pyload/plugins/addon/Ev0InFetcher.py +++ b/pyload/plugins/addon/Ev0InFetcher.py @@ -4,12 +4,12 @@ import feedparser from time import mktime, time -from pyload.plugins.base.Hook import Hook +from pyload.plugins.base.Addon import Addon -class Ev0InFetcher(Hook): +class Ev0InFetcher(Addon): __name__ = "Ev0InFetcher" - __type__ = "hook" + __type__ = "addon" __version__ = "0.21" __config__ = [("activated", "bool", "Activated", False), diff --git a/pyload/plugins/addon/ExpertDecoders.py b/pyload/plugins/addon/ExpertDecoders.py index 3f0f64f1e..87979a8a8 100644 --- a/pyload/plugins/addon/ExpertDecoders.py +++ b/pyload/plugins/addon/ExpertDecoders.py @@ -9,12 +9,12 @@ from uuid import uuid4 from pyload.network.HTTPRequest import BadHeader from pyload.network.RequestFactory import getURL, getRequest -from pyload.plugins.base.Hook import Hook +from pyload.plugins.base.Addon import Addon -class ExpertDecoders(Hook): +class ExpertDecoders(Addon): __name__ = "ExpertDecoders" - __type__ = "hook" + __type__ = "addon" __version__ = "0.01" __config__ = [("activated", "bool", "Activated", False), diff --git a/pyload/plugins/addon/ExternalScripts.py b/pyload/plugins/addon/ExternalScripts.py index edf2139f7..023c656dc 100644 --- a/pyload/plugins/addon/ExternalScripts.py +++ b/pyload/plugins/addon/ExternalScripts.py @@ -6,13 +6,13 @@ from itertools import chain from os import listdir, access, X_OK, makedirs from os.path import join, exists, basename, abspath -from pyload.plugins.base.Hook import Hook +from pyload.plugins.base.Addon import Addon from pyload.utils import safe_join -class ExternalScripts(Hook): +class ExternalScripts(Addon): __name__ = "ExternalScripts" - __type__ = "hook" + __type__ = "addon" __version__ = "0.24" __config__ = [("activated", "bool", "Activated", True)] diff --git a/pyload/plugins/addon/ExtractArchive.py b/pyload/plugins/addon/ExtractArchive.py index 92db9ce04..20693c83d 100644 --- a/pyload/plugins/addon/ExtractArchive.py +++ b/pyload/plugins/addon/ExtractArchive.py @@ -47,14 +47,14 @@ if os.name != "nt": from os import chown from pwd import getpwnam -from pyload.plugins.base.Hook import Hook, threaded, Expose +from pyload.plugins.base.Addon import Addon, threaded, Expose from pyload.plugins.internal.AbstractExtractor import ArchiveError, CRCError, WrongPassword from pyload.utils import safe_join, fs_encode -class ExtractArchive(Hook): +class ExtractArchive(Addon): __name__ = "ExtractArchive" - __type__ = "hook" + __type__ = "addon" __version__ = "0.17" __config__ = [("activated", "bool", "Activated", True), diff --git a/pyload/plugins/addon/FastixRu.py b/pyload/plugins/addon/FastixRu.py index 9e2abd92a..fed0d57fa 100644 --- a/pyload/plugins/addon/FastixRu.py +++ b/pyload/plugins/addon/FastixRu.py @@ -7,7 +7,7 @@ from pyload.plugins.internal.MultiHoster import MultiHoster class FastixRu(MultiHoster): __name__ = "FastixRu" - __type__ = "hook" + __type__ = "addon" __version__ = "0.02" __config__ = [("activated", "bool", "Activated", False), @@ -15,7 +15,7 @@ class FastixRu(MultiHoster): ("unloadFailing", "bool", "Revert to standard download if download fails", False), ("interval", "int", "Reload interval in hours (0 to disable)", 24)] - __description__ = """Fastix.ru hook plugin""" + __description__ = """Fastix.ru addon plugin""" __author_name__ = "Massimo Rosamilia" __author_mail__ = "max@spiritix.eu" diff --git a/pyload/plugins/addon/FreeWayMe.py b/pyload/plugins/addon/FreeWayMe.py index 635bc3415..e468bd3ab 100644 --- a/pyload/plugins/addon/FreeWayMe.py +++ b/pyload/plugins/addon/FreeWayMe.py @@ -6,7 +6,7 @@ from pyload.plugins.internal.MultiHoster import MultiHoster class FreeWayMe(MultiHoster): __name__ = "FreeWayMe" - __type__ = "hook" + __type__ = "addon" __version__ = "0.11" __config__ = [("activated", "bool", "Activated", False), @@ -15,7 +15,7 @@ class FreeWayMe(MultiHoster): ("unloadFailing", "bool", "Revert to stanard download if download fails", False), ("interval", "int", "Reload interval in hours (0 to disable)", 24)] - __description__ = """FreeWay.me hook plugin""" + __description__ = """FreeWay.me addon plugin""" __author_name__ = "Nicolas Giese" __author_mail__ = "james@free-way.me" diff --git a/pyload/plugins/addon/HotFolder.py b/pyload/plugins/addon/HotFolder.py index 140e6d4a8..0c5008f93 100644 --- a/pyload/plugins/addon/HotFolder.py +++ b/pyload/plugins/addon/HotFolder.py @@ -6,12 +6,12 @@ from os import listdir, makedirs from os.path import exists, isfile, join from shutil import move -from pyload.plugins.base.Hook import Hook +from pyload.plugins.base.Addon import Addon -class HotFolder(Hook): +class HotFolder(Addon): __name__ = "HotFolder" - __type__ = "hook" + __type__ = "addon" __version__ = "0.11" __config__ = [("activated", "bool", "Activated", False), diff --git a/pyload/plugins/addon/IRCInterface.py b/pyload/plugins/addon/IRCInterface.py index 04ae87b05..85175f4da 100644 --- a/pyload/plugins/addon/IRCInterface.py +++ b/pyload/plugins/addon/IRCInterface.py @@ -12,13 +12,13 @@ from traceback import print_exc from pyload.api import PackageDoesNotExists, FileDoesNotExists from pyload.network.RequestFactory import getURL -from pyload.plugins.base.Hook import Hook +from pyload.plugins.base.Addon import Addon from pyload.utils import formatSize -class IRCInterface(Thread, Hook): +class IRCInterface(Thread, Addon): __name__ = "IRCInterface" - __type__ = "hook" + __type__ = "addon" __version__ = "0.11" __config__ = [("activated", "bool", "Activated", False), @@ -39,7 +39,7 @@ class IRCInterface(Thread, Hook): def __init__(self, core, manager): Thread.__init__(self) - Hook.__init__(self, core, manager) + Addon.__init__(self, core, manager) self.setDaemon(True) # self.sm = core.server_methods self.api = core.api # todo, only use api diff --git a/pyload/plugins/addon/ImageTyperz.py b/pyload/plugins/addon/ImageTyperz.py index 7317f234d..916638192 100644 --- a/pyload/plugins/addon/ImageTyperz.py +++ b/pyload/plugins/addon/ImageTyperz.py @@ -9,7 +9,7 @@ from pycurl import FORM_FILE, LOW_SPEED_TIME from thread import start_new_thread from pyload.network.RequestFactory import getURL, getRequest -from pyload.plugins.base.Hook import Hook +from pyload.plugins.base.Addon import Addon class ImageTyperzException(Exception): @@ -27,9 +27,9 @@ class ImageTyperzException(Exception): return "<ImageTyperzException %s>" % self.err -class ImageTyperz(Hook): +class ImageTyperz(Addon): __name__ = "ImageTyperz" - __type__ = "hook" + __type__ = "addon" __version__ = "0.04" __config__ = [("activated", "bool", "Activated", False), diff --git a/pyload/plugins/addon/LinkdecrypterCom.py b/pyload/plugins/addon/LinkdecrypterCom.py index 418ec4ac4..6c59ee5c6 100644 --- a/pyload/plugins/addon/LinkdecrypterCom.py +++ b/pyload/plugins/addon/LinkdecrypterCom.py @@ -3,18 +3,18 @@ import re from pyload.network.RequestFactory import getURL -from pyload.plugins.base.Hook import Hook +from pyload.plugins.base.Addon import Addon from pyload.utils import remove_chars -class LinkdecrypterCom(Hook): +class LinkdecrypterCom(Addon): __name__ = "LinkdecrypterCom" - __type__ = "hook" + __type__ = "addon" __version__ = "0.19" __config__ = [("activated", "bool", "Activated", False)] - __description__ = """Linkdecrypter.com hook plugin""" + __description__ = """Linkdecrypter.com addon plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" diff --git a/pyload/plugins/addon/LinksnappyCom.py b/pyload/plugins/addon/LinksnappyCom.py index 9086e3c2a..4a89b75d1 100644 --- a/pyload/plugins/addon/LinksnappyCom.py +++ b/pyload/plugins/addon/LinksnappyCom.py @@ -7,7 +7,7 @@ from pyload.plugins.internal.MultiHoster import MultiHoster class LinksnappyCom(MultiHoster): __name__ = "LinksnappyCom" - __type__ = "hook" + __type__ = "addon" __version__ = "0.01" __config__ = [("activated", "bool", "Activated", False), @@ -16,7 +16,7 @@ class LinksnappyCom(MultiHoster): ("unloadFailing", "bool", "Revert to standard download if download fails", False), ("interval", "int", "Reload interval in hours (0 to disable)", 24)] - __description__ = """Linksnappy.com hook plugin""" + __description__ = """Linksnappy.com addon plugin""" __author_name__ = "stickell" __author_mail__ = "l.stickell@yahoo.it" diff --git a/pyload/plugins/addon/MegaDebridEu.py b/pyload/plugins/addon/MegaDebridEu.py index 0345e47fa..3faa823bf 100644 --- a/pyload/plugins/addon/MegaDebridEu.py +++ b/pyload/plugins/addon/MegaDebridEu.py @@ -7,13 +7,13 @@ from pyload.plugins.internal.MultiHoster import MultiHoster class MegaDebridEu(MultiHoster): __name__ = "MegaDebridEu" - __type__ = "hook" + __type__ = "addon" __version__ = "0.02" __config__ = [("activated", "bool", "Activated", False), ("unloadFailing", "bool", "Revert to standard download if download fails", False)] - __description__ = """mega-debrid.eu hook plugin""" + __description__ = """mega-debrid.eu addon plugin""" __author_name__ = "D.Ducatel" __author_mail__ = "dducatel@je-geek.fr" diff --git a/pyload/plugins/addon/MergeFiles.py b/pyload/plugins/addon/MergeFiles.py index 5a39cef65..16c88bcdd 100644 --- a/pyload/plugins/addon/MergeFiles.py +++ b/pyload/plugins/addon/MergeFiles.py @@ -4,13 +4,13 @@ import os import re import traceback -from pyload.plugins.base.Hook import Hook, threaded +from pyload.plugins.base.Addon import Addon, threaded from pyload.utils import safe_join, fs_encode -class MergeFiles(Hook): +class MergeFiles(Addon): __name__ = "MergeFiles" - __type__ = "hook" + __type__ = "addon" __version__ = "0.12" __config__ = [("activated", "bool", "Activated", False)] diff --git a/pyload/plugins/addon/MultiHome.py b/pyload/plugins/addon/MultiHome.py index 771c3549b..2aa60ecc3 100644 --- a/pyload/plugins/addon/MultiHome.py +++ b/pyload/plugins/addon/MultiHome.py @@ -2,12 +2,12 @@ from time import time -from pyload.plugins.base.Hook import Hook +from pyload.plugins.base.Addon import Addon -class MultiHome(Hook): +class MultiHome(Addon): __name__ = "MultiHome" - __type__ = "hook" + __type__ = "addon" __version__ = "0.11" __config__ = [("activated", "bool", "Activated", False), diff --git a/pyload/plugins/addon/MultishareCz.py b/pyload/plugins/addon/MultishareCz.py index 9e1bd50a4..34ba3760a 100644 --- a/pyload/plugins/addon/MultishareCz.py +++ b/pyload/plugins/addon/MultishareCz.py @@ -8,14 +8,14 @@ from pyload.plugins.internal.MultiHoster import MultiHoster class MultishareCz(MultiHoster): __name__ = "MultishareCz" - __type__ = "hook" + __type__ = "addon" __version__ = "0.04" __config__ = [("activated", "bool", "Activated", False), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), ("hosterList", "str", "Hoster list (comma separated)", "uloz.to")] - __description__ = """MultiShare.cz hook plugin""" + __description__ = """MultiShare.cz addon plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" diff --git a/pyload/plugins/addon/MyfastfileCom.py b/pyload/plugins/addon/MyfastfileCom.py index 216dcaf5d..40f5fb680 100644 --- a/pyload/plugins/addon/MyfastfileCom.py +++ b/pyload/plugins/addon/MyfastfileCom.py @@ -7,7 +7,7 @@ from pyload.utils import json_loads class MyfastfileCom(MultiHoster): __name__ = "MyfastfileCom" - __type__ = "hook" + __type__ = "addon" __version__ = "0.02" __config__ = [("activated", "bool", "Activated", False), @@ -16,7 +16,7 @@ class MyfastfileCom(MultiHoster): ("unloadFailing", "bool", "Revert to standard download if download fails", False), ("interval", "int", "Reload interval in hours (0 to disable)", 24)] - __description__ = """Myfastfile.com hook plugin""" + __description__ = """Myfastfile.com addon plugin""" __author_name__ = "stickell" __author_mail__ = "l.stickell@yahoo.it" diff --git a/pyload/plugins/addon/OverLoadMe.py b/pyload/plugins/addon/OverLoadMe.py index fae4209f8..87f4b5852 100644 --- a/pyload/plugins/addon/OverLoadMe.py +++ b/pyload/plugins/addon/OverLoadMe.py @@ -6,7 +6,7 @@ from pyload.plugins.internal.MultiHoster import MultiHoster class OverLoadMe(MultiHoster): __name__ = "OverLoadMe" - __type__ = "hook" + __type__ = "addon" __version__ = "0.01" __config__ = [("activated", "bool", "Activated", False), @@ -16,7 +16,7 @@ class OverLoadMe(MultiHoster): ("unloadFailing", "bool", "Revert to standard download if download fails", False), ("interval", "int", "Reload interval in hours (0 to disable)", 12)] - __description__ = """Over-Load.me hook plugin""" + __description__ = """Over-Load.me addon plugin""" __author_name__ = "marley" __author_mail__ = "marley@over-load.me" diff --git a/pyload/plugins/addon/PremiumTo.py b/pyload/plugins/addon/PremiumTo.py index b95b15b53..761731435 100644 --- a/pyload/plugins/addon/PremiumTo.py +++ b/pyload/plugins/addon/PremiumTo.py @@ -6,14 +6,14 @@ from pyload.plugins.internal.MultiHoster import MultiHoster class PremiumTo(MultiHoster): __name__ = "PremiumTo" - __type__ = "hook" + __type__ = "addon" __version__ = "0.04" __config__ = [("activated", "bool", "Activated", False), ("hosterListMode", "all;listed;unlisted", "Use for downloads from supported hosters:", "all"), ("hosterList", "str", "Hoster list (comma separated)", "")] - __description__ = """Premium.to hook plugin""" + __description__ = """Premium.to addon plugin""" __author_name__ = ("RaNaN", "zoidberg", "stickell") __author_mail__ = ("RaNaN@pyload.org", "zoidberg@mujmail.cz", "l.stickell@yahoo.it") diff --git a/pyload/plugins/addon/PremiumizeMe.py b/pyload/plugins/addon/PremiumizeMe.py index b6d89adb6..05ff781e6 100644 --- a/pyload/plugins/addon/PremiumizeMe.py +++ b/pyload/plugins/addon/PremiumizeMe.py @@ -7,7 +7,7 @@ from pyload.plugins.internal.MultiHoster import MultiHoster class PremiumizeMe(MultiHoster): __name__ = "PremiumizeMe" - __type__ = "hook" + __type__ = "addon" __version__ = "0.12" __config__ = [("activated", "bool", "Activated", False), @@ -16,7 +16,7 @@ class PremiumizeMe(MultiHoster): ("unloadFailing", "bool", "Revert to stanard download if download fails", False), ("interval", "int", "Reload interval in hours (0 to disable)", 24)] - __description__ = """Premiumize.me hook plugin""" + __description__ = """Premiumize.me addon plugin""" __author_name__ = "Florian Franzen" __author_mail__ = "FlorianFranzen@gmail.com" diff --git a/pyload/plugins/addon/RPNetBiz.py b/pyload/plugins/addon/RPNetBiz.py index b46e326e6..8f3fd298f 100644 --- a/pyload/plugins/addon/RPNetBiz.py +++ b/pyload/plugins/addon/RPNetBiz.py @@ -7,7 +7,7 @@ from pyload.plugins.internal.MultiHoster import MultiHoster class RPNetBiz(MultiHoster): __name__ = "RPNetBiz" - __type__ = "hook" + __type__ = "addon" __version__ = "0.1" __config__ = [("activated", "bool", "Activated", False), @@ -16,7 +16,7 @@ class RPNetBiz(MultiHoster): ("unloadFailing", "bool", "Revert to stanard download if download fails", False), ("interval", "int", "Reload interval in hours (0 to disable)", 24)] - __description__ = """RPNet.biz hook plugin""" + __description__ = """RPNet.biz addon plugin""" __author_name__ = "Dman" __author_mail__ = "dmanugm@gmail.com" diff --git a/pyload/plugins/addon/RealdebridCom.py b/pyload/plugins/addon/RealdebridCom.py index c1c519ace..cb56052a9 100644 --- a/pyload/plugins/addon/RealdebridCom.py +++ b/pyload/plugins/addon/RealdebridCom.py @@ -6,7 +6,7 @@ from pyload.plugins.internal.MultiHoster import MultiHoster class RealdebridCom(MultiHoster): __name__ = "RealdebridCom" - __type__ = "hook" + __type__ = "addon" __version__ = "0.43" __config__ = [("activated", "bool", "Activated", False), @@ -16,7 +16,7 @@ class RealdebridCom(MultiHoster): ("unloadFailing", "bool", "Revert to stanard download if download fails", False), ("interval", "int", "Reload interval in hours (0 to disable)", 24)] - __description__ = """Real-Debrid.com hook plugin""" + __description__ = """Real-Debrid.com addon plugin""" __author_name__ = "Devirex Hazzard" __author_mail__ = "naibaf_11@yahoo.de" diff --git a/pyload/plugins/addon/RehostTo.py b/pyload/plugins/addon/RehostTo.py index 059f36284..87196ff09 100644 --- a/pyload/plugins/addon/RehostTo.py +++ b/pyload/plugins/addon/RehostTo.py @@ -6,7 +6,7 @@ from pyload.plugins.internal.MultiHoster import MultiHoster class RehostTo(MultiHoster): __name__ = "RehostTo" - __type__ = "hook" + __type__ = "addon" __version__ = "0.43" __config__ = [("activated", "bool", "Activated", False), @@ -15,7 +15,7 @@ class RehostTo(MultiHoster): ("unloadFailing", "bool", "Revert to stanard download if download fails", False), ("interval", "int", "Reload interval in hours (0 to disable)", 24)] - __description__ = """Rehost.to hook plugin""" + __description__ = """Rehost.to addon plugin""" __author_name__ = "RaNaN" __author_mail__ = "RaNaN@pyload.org" diff --git a/pyload/plugins/addon/RestartFailed.py b/pyload/plugins/addon/RestartFailed.py index e1a11db3f..db3a61523 100644 --- a/pyload/plugins/addon/RestartFailed.py +++ b/pyload/plugins/addon/RestartFailed.py @@ -1,11 +1,11 @@ # -*- coding: utf-8 -*- -from pyload.plugins.base.Hook import Hook +from pyload.plugins.base.Addon import Addon -class RestartFailed(Hook): +class RestartFailed(Addon): __name__ = "RestartFailed" - __type__ = "hook" + __type__ = "addon" __version__ = "1.55" __config__ = [("activated", "bool", "Activated", False), diff --git a/pyload/plugins/addon/SimplyPremiumCom.py b/pyload/plugins/addon/SimplyPremiumCom.py index f0df36b22..3bed0cd2b 100644 --- a/pyload/plugins/addon/SimplyPremiumCom.py +++ b/pyload/plugins/addon/SimplyPremiumCom.py @@ -7,7 +7,7 @@ from pyload.plugins.internal.MultiHoster import MultiHoster class SimplyPremiumCom(MultiHoster): __name__ = "SimplyPremiumCom" - __type__ = "hook" + __type__ = "addon" __version__ = "0.02" __config__ = [("activated", "bool", "Activated", "False"), @@ -16,7 +16,7 @@ class SimplyPremiumCom(MultiHoster): ("unloadFailing", "bool", "Revert to standard download if download fails", "False"), ("interval", "int", "Reload interval in hours (0 to disable)", "24")] - __description__ = """Simply-Premium.com hook plugin""" + __description__ = """Simply-Premium.com addon plugin""" __author_name__ = "EvolutionClip" __author_mail__ = "evolutionclip@live.de" diff --git a/pyload/plugins/addon/SimplydebridCom.py b/pyload/plugins/addon/SimplydebridCom.py index f7c899a48..212a56a45 100644 --- a/pyload/plugins/addon/SimplydebridCom.py +++ b/pyload/plugins/addon/SimplydebridCom.py @@ -6,14 +6,14 @@ from pyload.plugins.internal.MultiHoster import MultiHoster class SimplydebridCom(MultiHoster): __name__ = "SimplydebridCom" - __type__ = "hook" + __type__ = "addon" __version__ = "0.01" __config__ = [("activated", "bool", "Activated", False), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), ("hosterList", "str", "Hoster list (comma separated)", "")] - __description__ = """Simply-Debrid.com hook plugin""" + __description__ = """Simply-Debrid.com addon plugin""" __author_name__ = "Kagenoshin" __author_mail__ = "kagenoshin@gmx.ch" diff --git a/pyload/plugins/addon/UnSkipOnFail.py b/pyload/plugins/addon/UnSkipOnFail.py index 5d2db34ae..27662cad3 100644 --- a/pyload/plugins/addon/UnSkipOnFail.py +++ b/pyload/plugins/addon/UnSkipOnFail.py @@ -3,13 +3,13 @@ from os.path import basename from pyload.datatypes.PyFile import PyFile -from pyload.plugins.base.Hook import Hook +from pyload.plugins.base.Addon import Addon from pyload.utils import fs_encode -class UnSkipOnFail(Hook): +class UnSkipOnFail(Addon): __name__ = "UnSkipOnFail" - __type__ = "hook" + __type__ = "addon" __version__ = "0.01" __config__ = [("activated", "bool", "Activated", True)] diff --git a/pyload/plugins/addon/UnrestrictLi.py b/pyload/plugins/addon/UnrestrictLi.py index 2ca5ad907..237814f3e 100644 --- a/pyload/plugins/addon/UnrestrictLi.py +++ b/pyload/plugins/addon/UnrestrictLi.py @@ -7,7 +7,7 @@ from pyload.plugins.internal.MultiHoster import MultiHoster class UnrestrictLi(MultiHoster): __name__ = "UnrestrictLi" - __type__ = "hook" + __type__ = "addon" __version__ = "0.02" __config__ = [("activated", "bool", "Activated", False), @@ -17,7 +17,7 @@ class UnrestrictLi(MultiHoster): ("interval", "int", "Reload interval in hours (0 to disable)", 24), ("history", "bool", "Delete History", False)] - __description__ = """Unrestrict.li hook plugin""" + __description__ = """Unrestrict.li addon plugin""" __author_name__ = "stickell" __author_mail__ = "l.stickell@yahoo.it" diff --git a/pyload/plugins/addon/WindowsPhoneToastNotify.py b/pyload/plugins/addon/WindowsPhoneToastNotify.py index 968b3ffa5..a35e28e3b 100644 --- a/pyload/plugins/addon/WindowsPhoneToastNotify.py +++ b/pyload/plugins/addon/WindowsPhoneToastNotify.py @@ -3,12 +3,12 @@ import httplib import time -from pyload.plugins.base.Hook import Hook +from pyload.plugins.base.Addon import Addon -class WindowsPhoneToastNotify(Hook): +class WindowsPhoneToastNotify(Addon): __name__ = "WindowsPhoneToastNotify" - __type__ = "hook" + __type__ = "addon" __version__ = "0.02" __config__ = [("activated", "bool", "Activated", False), diff --git a/pyload/plugins/addon/XFileSharingPro.py b/pyload/plugins/addon/XFileSharingPro.py index e926d6655..7e46f7430 100644 --- a/pyload/plugins/addon/XFileSharingPro.py +++ b/pyload/plugins/addon/XFileSharingPro.py @@ -2,12 +2,12 @@ import re -from pyload.plugins.base.Hook import Hook +from pyload.plugins.base.Addon import Addon -class XFileSharingPro(Hook): +class XFileSharingPro(Addon): __name__ = "XFileSharingPro" - __type__ = "hook" + __type__ = "addon" __version__ = "0.12" __config__ = [("activated", "bool", "Activated", True), @@ -15,7 +15,7 @@ class XFileSharingPro(Hook): ("includeList", "str", "Include hosters (comma separated)", ""), ("excludeList", "str", "Exclude hosters (comma separated)", "")] - __description__ = """XFileSharingPro hook plugin""" + __description__ = """XFileSharingPro addon plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" diff --git a/pyload/plugins/addon/XMPPInterface.py b/pyload/plugins/addon/XMPPInterface.py index 4a01493a6..f442cc0d0 100644 --- a/pyload/plugins/addon/XMPPInterface.py +++ b/pyload/plugins/addon/XMPPInterface.py @@ -6,12 +6,12 @@ from pyxmpp.interface import implements from pyxmpp.interfaces import * from pyxmpp.jabber.client import JabberClient -from pyload.plugins.hooks.IRCInterface import IRCInterface +from pyload.plugins.addon.IRCInterface import IRCInterface class XMPPInterface(IRCInterface, JabberClient): __name__ = "XMPPInterface" - __type__ = "hook" + __type__ = "addon" __version__ = "0.11" __config__ = [("activated", "bool", "Activated", False), diff --git a/pyload/plugins/addon/ZeveraCom.py b/pyload/plugins/addon/ZeveraCom.py index 155143f64..8f784ba9b 100644 --- a/pyload/plugins/addon/ZeveraCom.py +++ b/pyload/plugins/addon/ZeveraCom.py @@ -6,14 +6,14 @@ from pyload.plugins.internal.MultiHoster import MultiHoster class ZeveraCom(MultiHoster): __name__ = "ZeveraCom" - __type__ = "hook" + __type__ = "addon" __version__ = "0.02" __config__ = [("activated", "bool", "Activated", False), ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), ("hosterList", "str", "Hoster list (comma separated)", "")] - __description__ = """Real-Debrid.com hook plugin""" + __description__ = """Real-Debrid.com addon plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" diff --git a/pyload/plugins/base/Hook.py b/pyload/plugins/base/Addon.py index b9ffbc647..a0b8b9782 100644 --- a/pyload/plugins/base/Hook.py +++ b/pyload/plugins/base/Addon.py @@ -9,28 +9,28 @@ class Expose(object): """ used for decoration to declare rpc services """ def __new__(cls, f, *args, **kwargs): - hookManager.addRPC(f.__module__, f.func_name, f.func_doc) + addonManager.addRPC(f.__module__, f.func_name, f.func_doc) return f def threaded(f): def run(*args,**kwargs): - hookManager.startThread(f, *args, **kwargs) + addonManager.startThread(f, *args, **kwargs) return run -class Hook(Base): +class Addon(Base): """ - Base class for hook plugins. + Base class for addon plugins. """ - __name__ = "Hook" - __type__ = "hook" + __name__ = "Addon" + __type__ = "addon" __version__ = "0.2" __config__ = [("name", "type", "desc", "default")] - __description__ = """Interface for hook""" + __description__ = """Interface for addon""" __author_name__ = ("mkaay", "RaNaN") __author_mail__ = ("mkaay@mkaay.de", "RaNaN@pyload.org") @@ -54,7 +54,7 @@ class Hook(Base): #: Callback of periodical job task, used by hookmanager self.cb = None - #: `HookManager` + #: `AddonManager` self.manager = manager #register events @@ -87,7 +87,7 @@ class Hook(Base): try: if self.isActivated(): self.periodical() except Exception, e: - self.logError(_("Error executing hooks: %s") % str(e)) + self.logError(_("Error executing addon: %s") % e) if self.core.debug: print_exc() @@ -95,18 +95,18 @@ class Hook(Base): def __repr__(self): - return "<Hook %s>" % self.__name__ + return "<Addon %s>" % self.__name__ def setup(self): """ more init stuff if needed """ pass def unload(self): - """ called when hook was deactivated """ + """ called when addon was deactivated """ pass def isActivated(self): - """ checks if hook is activated""" + """ checks if addon is activated""" return self.config.getPlugin(self.__name__, "activated") diff --git a/pyload/plugins/crypter/MultiuploadCom.py b/pyload/plugins/crypter/MultiuploadCom.py index 754247ec7..148d76b8f 100644 --- a/pyload/plugins/crypter/MultiuploadCom.py +++ b/pyload/plugins/crypter/MultiuploadCom.py @@ -10,6 +10,6 @@ class MultiuploadCom(DeadCrypter): __pattern__ = r'http://(?:www\.)?multiupload\.(com|nl)/\w+' - __description__ = """ MultiUpload.com decrypter plugin """ + __description__ = """MultiUpload.com decrypter plugin""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" diff --git a/pyload/plugins/crypter/UploadableChFolder.py b/pyload/plugins/crypter/UploadableChFolder.py index 3be8b0167..acc56580c 100644 --- a/pyload/plugins/crypter/UploadableChFolder.py +++ b/pyload/plugins/crypter/UploadableChFolder.py @@ -10,7 +10,7 @@ class UploadableChFolder(SimpleCrypter): __pattern__ = r'http://(?:www\.)?uploadable\.ch/list/\w+' - __description__ = """ Uploadable.ch folder decrypter plugin """ + __description__ = """Uploadable.ch folder decrypter plugin""" __author_name__ = ("guidobelix", "Walter Purcaro") __author_mail__ = ("guidobelix@hotmail.it", "vuolter@gmail.com") diff --git a/pyload/plugins/hoster/LoadTo.py b/pyload/plugins/hoster/LoadTo.py index ebaaa3d0d..8798819e3 100644 --- a/pyload/plugins/hoster/LoadTo.py +++ b/pyload/plugins/hoster/LoadTo.py @@ -17,7 +17,7 @@ class LoadTo(SimpleHoster): __pattern__ = r'http://(?:www\.)?load\.to/\w+' - __description__ = """ Load.to hoster plugin """ + __description__ = """Load.to hoster plugin""" __author_name__ = ("halfman", "stickell") __author_mail__ = ("Pulpan3@gmail.com", "l.stickell@yahoo.it") diff --git a/pyload/plugins/hoster/LomafileCom.py b/pyload/plugins/hoster/LomafileCom.py index 3b75a79ab..2ae6973c8 100644 --- a/pyload/plugins/hoster/LomafileCom.py +++ b/pyload/plugins/hoster/LomafileCom.py @@ -12,7 +12,7 @@ class LomafileCom(SimpleHoster): __pattern__ = r'https?://lomafile\.com/.+/[\w\.]+' - __description__ = """ Lomafile.com hoster plugin """ + __description__ = """Lomafile.com hoster plugin""" __author_name__ = "nath_schwarz" __author_mail__ = "nathan.notwhite@gmail.com" diff --git a/pyload/plugins/hoster/TurbobitNet.py b/pyload/plugins/hoster/TurbobitNet.py index 5dd01fad5..cc9cf16d3 100644 --- a/pyload/plugins/hoster/TurbobitNet.py +++ b/pyload/plugins/hoster/TurbobitNet.py @@ -21,7 +21,7 @@ class TurbobitNet(SimpleHoster): __pattern__ = r'http://(?:www\.)?turbobit\.net/(?:download/free/)?(?P<ID>\w+)' - __description__ = """ Turbobit.net hoster plugin """ + __description__ = """Turbobit.net hoster plugin""" __author_name__ = ("zoidberg", "prOq") __author_mail__ = ("zoidberg@mujmail.cz", None) diff --git a/pyload/plugins/internal/AbstractExtractor.py b/pyload/plugins/internal/AbstractExtractor.py index d1d1a09cb..39bc46b1e 100644 --- a/pyload/plugins/internal/AbstractExtractor.py +++ b/pyload/plugins/internal/AbstractExtractor.py @@ -39,7 +39,7 @@ class AbtractExtractor: def __init__(self, m, file, out, fullpath, overwrite, excludefiles, renice): """Initialize extractor for specific file - :param m: ExtractArchive Hook plugin + :param m: ExtractArchive Addon plugin :param file: Absolute filepath :param out: Absolute path to destination directory :param fullpath: extract to fullpath diff --git a/pyload/plugins/internal/DeadCrypter.py b/pyload/plugins/internal/DeadCrypter.py index c9e1eded1..2d4dfc7e6 100644 --- a/pyload/plugins/internal/DeadCrypter.py +++ b/pyload/plugins/internal/DeadCrypter.py @@ -10,7 +10,7 @@ class DeadCrypter(_Crypter): __pattern__ = None - __description__ = """ Crypter is no longer available """ + __description__ = """Crypter is no longer available""" __author_name__ = "stickell" __author_mail__ = "l.stickell@yahoo.it" diff --git a/pyload/plugins/internal/DeadHoster.py b/pyload/plugins/internal/DeadHoster.py index a7b873d30..72fd356bd 100644 --- a/pyload/plugins/internal/DeadHoster.py +++ b/pyload/plugins/internal/DeadHoster.py @@ -18,7 +18,7 @@ class DeadHoster(_Hoster): __pattern__ = None - __description__ = """ Hoster is no longer available """ + __description__ = """Hoster is no longer available""" __author_name__ = "zoidberg" __author_mail__ = "zoidberg@mujmail.cz" diff --git a/pyload/plugins/internal/MultiHoster.py b/pyload/plugins/internal/MultiHoster.py index 48345eeca..c94f87493 100644 --- a/pyload/plugins/internal/MultiHoster.py +++ b/pyload/plugins/internal/MultiHoster.py @@ -2,13 +2,13 @@ import re -from pyload.plugins.base.Hook import Hook +from pyload.plugins.base.Addon import Addon from pyload.utils import remove_chars -class MultiHoster(Hook): +class MultiHoster(Addon): __name__ = "MultiHoster" - __type__ = "hook" + __type__ = "addon" __version__ = "0.20" __description__ = """Generic MultiHoster plugin""" diff --git a/pyload/plugins/internal/UpdateManager.py b/pyload/plugins/internal/UpdateManager.py index 50a965228..7848fa2de 100644 --- a/pyload/plugins/internal/UpdateManager.py +++ b/pyload/plugins/internal/UpdateManager.py @@ -7,13 +7,13 @@ from operator import itemgetter from os import path, remove, stat from pyload.network.RequestFactory import getURL -from pyload.plugins.base.Hook import Expose, Hook, threaded +from pyload.plugins.base.Addon import Expose, Addon, threaded from pyload.utils import safe_join -class UpdateManager(Hook): +class UpdateManager(Addon): __name__ = "UpdateManager" - __type__ = "hook" + __type__ = "addon" __version__ = "0.36" __config__ = [("activated", "bool", "Activated", True), @@ -22,7 +22,7 @@ class UpdateManager(Hook): ("reloadplugins", "bool", "Monitor plugins for code changes (debug mode only)", True), ("nodebugupdate", "bool", "Don't check for updates in debug mode", True)] - __description__ = """ Check for updates """ + __description__ = """Check for updates""" __author_name__ = "Walter Purcaro" __author_mail__ = "vuolter@gmail.com" @@ -287,7 +287,7 @@ class UpdateManager(Hook): if path.isfile(filename): try: if type == "addon": - self.manager.deactivateHook(name) + self.manager.deactivateAddon(name) remove(filename) except Exception, e: self.logDebug("Error deleting: %s" % path.basename(filename), e) |