diff options
-rw-r--r-- | module/plugins/hooks/AntiStandby.py | 6 | ||||
-rw-r--r-- | module/plugins/hooks/AntiVirus.py | 6 | ||||
-rw-r--r-- | module/plugins/hooks/BypassCaptcha.py | 5 | ||||
-rw-r--r-- | module/plugins/hooks/Captcha9Kw.py | 5 | ||||
-rw-r--r-- | module/plugins/hooks/CaptchaBrotherhood.py | 5 | ||||
-rw-r--r-- | module/plugins/hooks/ClickNLoad.py | 6 | ||||
-rw-r--r-- | module/plugins/hooks/DeathByCaptcha.py | 6 | ||||
-rw-r--r-- | module/plugins/hooks/ExpertDecoders.py | 5 | ||||
-rw-r--r-- | module/plugins/hooks/ExternalScripts.py | 4 | ||||
-rw-r--r-- | module/plugins/hooks/ExtractArchive.py | 6 | ||||
-rw-r--r-- | module/plugins/hooks/ImageTyperz.py | 5 | ||||
-rw-r--r-- | module/plugins/hooks/MergeFiles.py | 6 | ||||
-rw-r--r-- | module/plugins/hooks/UpdateManager.py | 6 | ||||
-rw-r--r-- | module/plugins/internal/Addon.py | 18 | ||||
-rw-r--r-- | module/plugins/internal/Notifier.py | 6 | ||||
-rw-r--r-- | module/plugins/internal/misc.py | 18 |
16 files changed, 59 insertions, 54 deletions
diff --git a/module/plugins/hooks/AntiStandby.py b/module/plugins/hooks/AntiStandby.py index 732405188..695b22155 100644 --- a/module/plugins/hooks/AntiStandby.py +++ b/module/plugins/hooks/AntiStandby.py @@ -12,8 +12,8 @@ try: except ImportError: pass -from module.plugins.internal.Addon import Addon, Expose -from module.plugins.internal.misc import encode, fsjoin +from module.plugins.internal.Addon import Addon +from module.plugins.internal.misc import encode, Expose, fsjoin class Kernel32(object): @@ -27,7 +27,7 @@ class Kernel32(object): class AntiStandby(Addon): __name__ = "AntiStandby" __type__ = "hook" - __version__ = "0.15" + __version__ = "0.16" __status__ = "testing" __config__ = [("activated", "bool", "Activated" , True ), diff --git a/module/plugins/hooks/AntiVirus.py b/module/plugins/hooks/AntiVirus.py index bafd3f4d3..692e6402d 100644 --- a/module/plugins/hooks/AntiVirus.py +++ b/module/plugins/hooks/AntiVirus.py @@ -9,14 +9,14 @@ try: except ImportError: pass -from module.plugins.internal.Addon import Addon, Expose, threaded -from module.plugins.internal.misc import encode, exists, fsjoin +from module.plugins.internal.Addon import Addon +from module.plugins.internal.misc import encode, exists, fsjoin, Expose, threaded class AntiVirus(Addon): __name__ = "AntiVirus" __type__ = "hook" - __version__ = "0.18" + __version__ = "0.19" __status__ = "broken" #@TODO: add trash option (use Send2Trash lib) diff --git a/module/plugins/hooks/BypassCaptcha.py b/module/plugins/hooks/BypassCaptcha.py index 700eb3b0a..8f9358632 100644 --- a/module/plugins/hooks/BypassCaptcha.py +++ b/module/plugins/hooks/BypassCaptcha.py @@ -4,7 +4,8 @@ import pycurl from module.network.HTTPRequest import BadHeader from module.network.RequestFactory import getRequest as get_request -from module.plugins.internal.Addon import Addon, threaded +from module.plugins.internal.Addon import Addon +from module.plugins.internal.misc import threaded class BypassCaptchaException(Exception): @@ -28,7 +29,7 @@ class BypassCaptchaException(Exception): class BypassCaptcha(Addon): __name__ = "BypassCaptcha" __type__ = "hook" - __version__ = "0.11" + __version__ = "0.12" __status__ = "testing" __config__ = [("activated" , "bool" , "Activated" , False), diff --git a/module/plugins/hooks/Captcha9Kw.py b/module/plugins/hooks/Captcha9Kw.py index 438a29165..b928c5992 100644 --- a/module/plugins/hooks/Captcha9Kw.py +++ b/module/plugins/hooks/Captcha9Kw.py @@ -7,13 +7,14 @@ import re import time from module.network.HTTPRequest import BadHeader -from module.plugins.internal.Addon import Addon, threaded +from module.plugins.internal.Addon import Addon +from module.plugins.internal.misc import threaded class Captcha9Kw(Addon): __name__ = "Captcha9Kw" __type__ = "hook" - __version__ = "0.33" + __version__ = "0.34" __status__ = "testing" __config__ = [("activated" , "bool" , "Activated" , False ), diff --git a/module/plugins/hooks/CaptchaBrotherhood.py b/module/plugins/hooks/CaptchaBrotherhood.py index 74f971439..aef05e31a 100644 --- a/module/plugins/hooks/CaptchaBrotherhood.py +++ b/module/plugins/hooks/CaptchaBrotherhood.py @@ -15,7 +15,8 @@ except ImportError: import Image from module.network.RequestFactory import getRequest as get_request -from module.plugins.internal.Addon import Addon, threaded +from module.plugins.internal.Addon import Addon +from module.plugins.internal.misc import threaded class CaptchaBrotherhoodException(Exception): @@ -39,7 +40,7 @@ class CaptchaBrotherhoodException(Exception): class CaptchaBrotherhood(Addon): __name__ = "CaptchaBrotherhood" __type__ = "hook" - __version__ = "0.13" + __version__ = "0.14" __status__ = "testing" __config__ = [("activated" , "bool" , "Activated" , False), diff --git a/module/plugins/hooks/ClickNLoad.py b/module/plugins/hooks/ClickNLoad.py index cfa0c1f1d..4a71164dd 100644 --- a/module/plugins/hooks/ClickNLoad.py +++ b/module/plugins/hooks/ClickNLoad.py @@ -9,15 +9,15 @@ try: except ImportError: pass -from module.plugins.internal.Addon import Addon, threaded -from module.plugins.internal.misc import forward, lock +from module.plugins.internal.Addon import Addon +from module.plugins.internal.misc import forward, lock, threaded #@TODO: IPv6 support class ClickNLoad(Addon): __name__ = "ClickNLoad" __type__ = "hook" - __version__ = "0.58" + __version__ = "0.59" __status__ = "testing" __config__ = [("activated", "bool" , "Activated" , True ), diff --git a/module/plugins/hooks/DeathByCaptcha.py b/module/plugins/hooks/DeathByCaptcha.py index f8e637aff..389bf47d9 100644 --- a/module/plugins/hooks/DeathByCaptcha.py +++ b/module/plugins/hooks/DeathByCaptcha.py @@ -10,8 +10,8 @@ import pycurl from module.network.HTTPRequest import BadHeader from module.network.RequestFactory import getRequest as get_request -from module.plugins.internal.Addon import Addon, threaded -from module.plugins.internal.misc import json +from module.plugins.internal.Addon import Addon +from module.plugins.internal.misc import json, threaded class DeathByCaptchaException(Exception): @@ -51,7 +51,7 @@ class DeathByCaptchaException(Exception): class DeathByCaptcha(Addon): __name__ = "DeathByCaptcha" __type__ = "hook" - __version__ = "0.12" + __version__ = "0.13" __status__ = "testing" __config__ = [("activated" , "bool" , "Activated" , False), diff --git a/module/plugins/hooks/ExpertDecoders.py b/module/plugins/hooks/ExpertDecoders.py index 9b29aa8c5..57febc53d 100644 --- a/module/plugins/hooks/ExpertDecoders.py +++ b/module/plugins/hooks/ExpertDecoders.py @@ -9,13 +9,14 @@ import pycurl from module.network.HTTPRequest import BadHeader from module.network.RequestFactory import getRequest as get_request -from module.plugins.internal.Addon import Addon, threaded +from module.plugins.internal.Addon import Addon +from module.plugins.internal.misc import threaded class ExpertDecoders(Addon): __name__ = "ExpertDecoders" __type__ = "hook" - __version__ = "0.08" + __version__ = "0.09" __status__ = "testing" __config__ = [("activated" , "bool" , "Activated" , False), diff --git a/module/plugins/hooks/ExternalScripts.py b/module/plugins/hooks/ExternalScripts.py index 0a48f8439..0185b0989 100644 --- a/module/plugins/hooks/ExternalScripts.py +++ b/module/plugins/hooks/ExternalScripts.py @@ -3,8 +3,8 @@ import os import subprocess -from module.plugins.internal.Addon import Addon, Expose -from module.plugins.internal.misc import encode +from module.plugins.internal.Addon import Addon +from module.plugins.internal.misc import encode, Expose class ExternalScripts(Addon): diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py index 782e917b0..6d559bfcb 100644 --- a/module/plugins/hooks/ExtractArchive.py +++ b/module/plugins/hooks/ExtractArchive.py @@ -49,9 +49,9 @@ try: except ImportError: pass -from module.plugins.internal.Addon import Addon, Expose, threaded +from module.plugins.internal.Addon import Addon from module.plugins.internal.Extractor import ArchiveError, CRCError, PasswordError -from module.plugins.internal.misc import encode, exists, fsjoin, uniqify +from module.plugins.internal.misc import encode, exists, Expose, fsjoin, threaded, uniqify class ArchiveQueue(object): @@ -98,7 +98,7 @@ class ArchiveQueue(object): class ExtractArchive(Addon): __name__ = "ExtractArchive" __type__ = "hook" - __version__ = "1.56" + __version__ = "1.57" __status__ = "broken" __config__ = [("activated" , "bool" , "Activated" , True ), diff --git a/module/plugins/hooks/ImageTyperz.py b/module/plugins/hooks/ImageTyperz.py index 7b9ca3a46..8a4c44958 100644 --- a/module/plugins/hooks/ImageTyperz.py +++ b/module/plugins/hooks/ImageTyperz.py @@ -8,7 +8,8 @@ import re import pycurl from module.network.RequestFactory import getRequest as get_request -from module.plugins.internal.Addon import Addon, threaded +from module.plugins.internal.Addon import Addon +from module.plugins.internal.misc import threaded class ImageTyperzException(Exception): @@ -32,7 +33,7 @@ class ImageTyperzException(Exception): class ImageTyperz(Addon): __name__ = "ImageTyperz" __type__ = "hook" - __version__ = "0.12" + __version__ = "0.13" __status__ = "testing" __config__ = [("activated" , "bool" , "Activated" , False), diff --git a/module/plugins/hooks/MergeFiles.py b/module/plugins/hooks/MergeFiles.py index 963f8c15b..ed3758443 100644 --- a/module/plugins/hooks/MergeFiles.py +++ b/module/plugins/hooks/MergeFiles.py @@ -5,14 +5,14 @@ from __future__ import with_statement import os import re -from module.plugins.internal.Addon import Addon, threaded -from module.plugins.internal.misc import fsjoin +from module.plugins.internal.Addon import Addon +from module.plugins.internal.misc import fsjoin, threaded class MergeFiles(Addon): __name__ = "MergeFiles" __type__ = "hook" - __version__ = "0.19" + __version__ = "0.20" __status__ = "testing" __config__ = [("activated", "bool", "Activated", True)] diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index d8635e9c6..181d89e76 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -8,14 +8,14 @@ import re import sys import time -from module.plugins.internal.Addon import Expose, Addon, threaded -from module.plugins.internal.misc import encode, exists, fsjoin +from module.plugins.internal.Addon import Addon +from module.plugins.internal.misc import encode, exists, Expose, fsjoin, threaded class UpdateManager(Addon): __name__ = "UpdateManager" __type__ = "hook" - __version__ = "1.09" + __version__ = "1.10" __status__ = "testing" __config__ = [("activated" , "bool", "Activated" , True ), diff --git a/module/plugins/internal/Addon.py b/module/plugins/internal/Addon.py index cf7321893..8dee04811 100644 --- a/module/plugins/internal/Addon.py +++ b/module/plugins/internal/Addon.py @@ -6,26 +6,10 @@ from module.plugins.internal.Plugin import Plugin from module.plugins.internal.misc import Periodical, isiterable -def threaded(fn): - def run(*args, **kwargs): - hookManager.startThread(fn, *args, **kwargs) - - return run - - -class Expose(object): - """ - Used for decoration to declare rpc services - """ - def __new__(cls, fn, *args, **kwargs): - hookManager.addRPC(fn.__module__, fn.func_name, fn.func_doc) - return fn - - class Addon(Plugin): __name__ = "Addon" __type__ = "hook" #@TODO: Change to `addon` in 0.4.10 - __version__ = "0.51" + __version__ = "0.52" __status__ = "stable" __threaded__ = [] #@TODO: Remove in 0.4.10 diff --git a/module/plugins/internal/Notifier.py b/module/plugins/internal/Notifier.py index 8c79cf7fa..1809d7158 100644 --- a/module/plugins/internal/Notifier.py +++ b/module/plugins/internal/Notifier.py @@ -2,14 +2,14 @@ import time -from module.plugins.internal.Addon import Addon, Expose -from module.plugins.internal.misc import encode, isiterable +from module.plugins.internal.Addon import Addon +from module.plugins.internal.misc import encode, Expose, isiterable class Notifier(Addon): __name__ = "Notifier" __type__ = "hook" - __version__ = "0.07" + __version__ = "0.09" __status__ = "testing" __config__ = [("activated" , "bool", "Activated" , False), diff --git a/module/plugins/internal/misc.py b/module/plugins/internal/misc.py index e62a7d6cd..6f3dd546e 100644 --- a/module/plugins/internal/misc.py +++ b/module/plugins/internal/misc.py @@ -38,7 +38,7 @@ except ImportError: class misc(object): __name__ = "misc" __type__ = "plugin" - __version__ = "0.25" + __version__ = "0.26" __status__ = "stable" __pattern__ = r'^unmatchable$' @@ -123,6 +123,15 @@ class DB(object): self.plugin.pyload.db.delStorage(self.plugin.classname, key) +class Expose(object): + """ + Used for decoration to declare rpc services + """ + def __new__(cls, fn, *args, **kwargs): + hookManager.addRPC(fn.__module__, fn.func_name, fn.func_doc) + return fn + + class Periodical(object): def __init__(self, plugin, task=lambda x: x, interval=None): @@ -231,6 +240,13 @@ def lock(fn): return new +def threaded(fn): + def run(*args, **kwargs): + hookManager.startThread(fn, *args, **kwargs) + + return run + + def format_time(value): dt = datetime.datetime(1, 1, 1) + datetime.timedelta(seconds=abs(int(value))) days = ("%d days and " % (dt.day - 1)) if dt.day > 1 else "" |