summaryrefslogtreecommitdiffstats
path: root/module/plugins/hooks
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-10-04 20:24:30 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-10-04 20:24:30 +0200
commit5db85c41e9f92b35d71396f8bf12ad84f37127f6 (patch)
tree09a6112406b4260079582b30e3239c762b4038b3 /module/plugins/hooks
parentFixpack (3) (diff)
downloadpyload-5db85c41e9f92b35d71396f8bf12ad84f37127f6.tar.xz
Small code cosmetics
Diffstat (limited to 'module/plugins/hooks')
-rw-r--r--module/plugins/hooks/AndroidPhoneNotify.py6
-rw-r--r--module/plugins/hooks/DeleteFinished.py8
-rw-r--r--module/plugins/hooks/ExternalScripts.py15
-rw-r--r--module/plugins/hooks/ExtractArchive.py4
-rw-r--r--module/plugins/hooks/WindowsPhoneNotify.py6
-rw-r--r--module/plugins/hooks/XFileSharingPro.py12
6 files changed, 19 insertions, 32 deletions
diff --git a/module/plugins/hooks/AndroidPhoneNotify.py b/module/plugins/hooks/AndroidPhoneNotify.py
index f79f226e4..aa9bc591b 100644
--- a/module/plugins/hooks/AndroidPhoneNotify.py
+++ b/module/plugins/hooks/AndroidPhoneNotify.py
@@ -8,7 +8,7 @@ from module.plugins.internal.Addon import Addon, Expose
class AndroidPhoneNotify(Addon):
__name__ = "AndroidPhoneNotify"
__type__ = "hook"
- __version__ = "0.10"
+ __version__ = "0.11"
__status__ = "testing"
__config__ = [("apikey" , "str" , "API key" , "" ),
@@ -28,8 +28,8 @@ class AndroidPhoneNotify(Addon):
def init(self):
- self.event_list = ["plugin_updated"]
- self.event_map = {'allDownloadsProcessed': "all_downloads_processed"}
+ self.event_map = {'allDownloadsProcessed': "all_downloads_processed",
+ 'plugin_updated' : "plugin_updated" }
self.last_notify = 0
self.notifications = 0
diff --git a/module/plugins/hooks/DeleteFinished.py b/module/plugins/hooks/DeleteFinished.py
index a38966476..4c29d5fdf 100644
--- a/module/plugins/hooks/DeleteFinished.py
+++ b/module/plugins/hooks/DeleteFinished.py
@@ -37,20 +37,12 @@ class DeleteFinished(Addon):
self.add_event('package_finished', self.wakeup)
- # def plugin_config_changed(self, plugin, name, value):
- # if name == "interval" and value is not self.interval:
- # self.interval = value * 3600
- # self.init_periodical()
-
-
def deactivate(self):
self.manager.removeEvent('package_finished', self.wakeup)
def activate(self):
self.info['sleep'] = True
- # interval = self.get_config('interval')
- # self.plugin_config_changed(self.__name__, 'interval', interval)
self.interval = max(self.MIN_CHECK_INTERVAL, self.get_config('interval') * 60 * 60)
self.add_event('package_finished', self.wakeup)
diff --git a/module/plugins/hooks/ExternalScripts.py b/module/plugins/hooks/ExternalScripts.py
index 09fe59d0a..3459eb3aa 100644
--- a/module/plugins/hooks/ExternalScripts.py
+++ b/module/plugins/hooks/ExternalScripts.py
@@ -28,12 +28,15 @@ class ExternalScripts(Addon):
def init(self):
self.scripts = {}
- self.event_list = ["archive_extract_failed", "archive_extracted" ,
- "package_extract_failed", "package_extracted" ,
- "all_archives_extracted", "all_archives_processed"]
- self.event_map = {'allDownloadsFinished' : "all_downloads_finished" ,
- 'allDownloadsProcessed': "all_downloads_processed",
- 'packageDeleted' : "package_deleted" }
+ self.event_map = {'allDownloadsFinished' : "all_downloads_finished" ,
+ 'allDownloadsProcessed' : "all_downloads_processed",
+ 'packageDeleted' : "package_deleted" ,
+ 'archive_extract_failed': "archive_extract_failed" ,
+ 'archive_extracted' : "archive_extracted" ,
+ 'package_extract_failed': "package_extract_failed" ,
+ 'package_extracted' : "package_extracted" ,
+ 'all_archives_extracted': "all_archives_extracted" ,
+ 'all_archives_processed': "all_archives_processed" }
folders = ["pyload_start", "pyload_restart", "pyload_stop",
"before_reconnect", "after_reconnect",
diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py
index 9c662a897..59df2746c 100644
--- a/module/plugins/hooks/ExtractArchive.py
+++ b/module/plugins/hooks/ExtractArchive.py
@@ -137,8 +137,8 @@ class ExtractArchive(Addon):
def init(self):
- self.event_map = {'allDownloadsProcessed': "all_downloads_processed",
- 'packageDeleted' : "package_deleted" }
+ self.event_map = {'allDownloadsProcessed': "all_downloads_processed",
+ 'packageDeleted' : "package_deleted" }
self.queue = ArchiveQueue(self, "Queue")
self.failed = ArchiveQueue(self, "Failed")
diff --git a/module/plugins/hooks/WindowsPhoneNotify.py b/module/plugins/hooks/WindowsPhoneNotify.py
index 900d94a04..52fff88b8 100644
--- a/module/plugins/hooks/WindowsPhoneNotify.py
+++ b/module/plugins/hooks/WindowsPhoneNotify.py
@@ -9,7 +9,7 @@ from module.plugins.internal.Addon import Addon, Expose
class WindowsPhoneNotify(Addon):
__name__ = "WindowsPhoneNotify"
__type__ = "hook"
- __version__ = "0.12"
+ __version__ = "0.13"
__status__ = "testing"
__config__ = [("push-id" , "str" , "Push ID" , "" ),
@@ -30,8 +30,8 @@ class WindowsPhoneNotify(Addon):
def init(self):
- self.event_list = ["plugin_updated"]
- self.event_map = {'allDownloadsProcessed': "all_downloads_processed"}
+ self.event_map = {'allDownloadsProcessed': "all_downloads_processed",
+ 'plugin_updated' : "plugin_updated" }
self.last_notify = 0
self.notifications = 0
diff --git a/module/plugins/hooks/XFileSharingPro.py b/module/plugins/hooks/XFileSharingPro.py
index 70bafba67..a96074328 100644
--- a/module/plugins/hooks/XFileSharingPro.py
+++ b/module/plugins/hooks/XFileSharingPro.py
@@ -23,9 +23,9 @@ class XFileSharingPro(Hook):
__authors__ = [("Walter Purcaro", "vuolter@gmail.com")]
- regexp = {'hoster' : (r'https?://(?:www\.)?(?:\w+\.)*?(?P<DOMAIN>(?:[\d.]+|[\w\-^_]{3,}(?:\.[a-zA-Z]{2,}){1,2})(?:\:\d+)?)/(?:embed-)?\w{12}(?:\W|$)',
+ regexp = {'hoster' : (r'https?://(?:www\.)?(?:\w+\.)*?(?P<DOMAIN>(?:[\d.]+|[\w-^_]{3,}(?:\.[a-zA-Z]{2,}){1,2})(?:\:\d+)?)/(?:embed-)?\w{12}(?:\W|$)',
r'https?://(?:[^/]+\.)?(?P<DOMAIN>%s)/(?:embed-)?\w+'),
- 'crypter': (r'https?://(?:www\.)?(?:\w+\.)*?(?P<DOMAIN>(?:[\d.]+|[\w\-^_]{3,}(?:\.[a-zA-Z]{2,}){1,2})(?:\:\d+)?)/(?:user|folder)s?/\w+',
+ 'crypter': (r'https?://(?:www\.)?(?:\w+\.)*?(?P<DOMAIN>(?:[\d.]+|[\w-^_]{3,}(?:\.[a-zA-Z]{2,}){1,2})(?:\:\d+)?)/(?:user|folder)s?/\w+',
r'https?://(?:[^/]+\.)?(?P<DOMAIN>%s)/(?:user|folder)s?/\w+')}
BUILTIN_HOSTERS = [#WORKING HOSTERS:
@@ -46,14 +46,6 @@ class XFileSharingPro(Hook):
BUILTIN_CRYPTERS = ["junocloud.me", "rapidfileshare.net"]
- # def plugin_config_changed(self, plugin, name, value):
- # self.load_pattern()
-
-
- # def init(self):
- # self.event_map = {'pluginConfigChanged': "plugin_config_changed"}
-
-
def activate(self):
self.load_pattern()