From 9f7f81e5eb6393d068a47a7395c89d2416db6f89 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 10 Oct 2015 12:32:25 +0200 Subject: Spare code cosmetics (2) --- module/plugins/internal/Account.py | 2 +- module/plugins/internal/Addon.py | 2 +- module/plugins/internal/MultiHoster.py | 4 ++-- module/plugins/internal/Plugin.py | 10 ++-------- module/plugins/internal/SimpleHoster.py | 2 +- module/plugins/internal/UnRar.py | 2 +- module/plugins/internal/XFSHoster.py | 4 ++-- 7 files changed, 10 insertions(+), 16 deletions(-) diff --git a/module/plugins/internal/Account.py b/module/plugins/internal/Account.py index a0c46a6a1..a1ecdd76f 100644 --- a/module/plugins/internal/Account.py +++ b/module/plugins/internal/Account.py @@ -40,7 +40,7 @@ class Account(Plugin): #: Callback of periodical job task self.cb = None - self.interval = None + self.interval = self.PERIODICAL_INTERVAL self.init() diff --git a/module/plugins/internal/Addon.py b/module/plugins/internal/Addon.py index 1c70cd4c9..bdde514c0 100644 --- a/module/plugins/internal/Addon.py +++ b/module/plugins/internal/Addon.py @@ -53,7 +53,7 @@ class Addon(Plugin): #: Callback of periodical job task, used by HookManager self.cb = None - self.interval = None + self.interval = self.PERIODICAL_INTERVAL self.init() self.init_events() diff --git a/module/plugins/internal/MultiHoster.py b/module/plugins/internal/MultiHoster.py index f5c3d091d..231615ae5 100644 --- a/module/plugins/internal/MultiHoster.py +++ b/module/plugins/internal/MultiHoster.py @@ -104,8 +104,8 @@ class MultiHoster(SimpleHoster): self.log_warning(_("Premium download failed")) self.restart(premium=False) - elif self.get_config("revertfailed", True) \ - and "new_module" in self.pyload.pluginManager.hosterPlugins[self.__name__]: + elif self.get_config("revertfailed", True) and \ + self.pyload.pluginManager.hosterPlugins[self.__name__].get('new_module'): hdict = self.pyload.pluginManager.hosterPlugins[self.__name__] tmp_module = hdict['new_module'] diff --git a/module/plugins/internal/Plugin.py b/module/plugins/internal/Plugin.py index faa362dbe..a2392fdcc 100644 --- a/module/plugins/internal/Plugin.py +++ b/module/plugins/internal/Plugin.py @@ -214,11 +214,11 @@ def parse_html_tag_attr_value(attr_name, tag): def parse_html_form(attr_str, html, input_names={}): for form in re.finditer(r"(?P]*%s[^>]*>)(?P.*?)]*>" % attr_str, - html, re.S | re.I): + html, re.I | re.S): inputs = {} action = parse_html_tag_attr_value("action", form.group('TAG')) - for inputtag in re.finditer(r'(<(input|textarea)[^>]*>)([^<]*(?=]*>)([^<]*(?=