summaryrefslogtreecommitdiffstats
path: root/module/plugins/hooks
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-10-23 03:05:49 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-10-23 03:05:49 +0200
commit8dc2f1eb8853471d2a0de6617b95f0a0768f0287 (patch)
treeb4165cd3a4de7205e709f72ef79aa32f00e29dfe /module/plugins/hooks
parent[Dereferer] Improve a bit (diff)
downloadpyload-8dc2f1eb8853471d2a0de6617b95f0a0768f0287.tar.xz
Boring code cosmetics (3)
Diffstat (limited to 'module/plugins/hooks')
-rw-r--r--module/plugins/hooks/AntiVirus.py3
-rw-r--r--module/plugins/hooks/LogMarker.py2
-rw-r--r--module/plugins/hooks/UpdateManager.py3
-rw-r--r--module/plugins/hooks/UserAgentSwitcher.py12
4 files changed, 9 insertions, 11 deletions
diff --git a/module/plugins/hooks/AntiVirus.py b/module/plugins/hooks/AntiVirus.py
index b9a7e93bf..049e92ab8 100644
--- a/module/plugins/hooks/AntiVirus.py
+++ b/module/plugins/hooks/AntiVirus.py
@@ -10,8 +10,7 @@ except ImportError:
pass
from module.plugins.internal.Addon import Addon, Expose, threaded
-from module.plugins.internal.Plugin import exists
-from module.plugins.internal.utils import encode, fs_join
+from module.plugins.internal.utils import encode, exists, fs_join
class AntiVirus(Addon):
diff --git a/module/plugins/hooks/LogMarker.py b/module/plugins/hooks/LogMarker.py
index 4bf8e290a..829db4d41 100644
--- a/module/plugins/hooks/LogMarker.py
+++ b/module/plugins/hooks/LogMarker.py
@@ -3,7 +3,7 @@
import datetime
from module.plugins.internal.Addon import Addon, Expose
-from module.plugins.internal.Plugin import seconds_to_nexthour
+from module.plugins.internal.utils import seconds_to_nexthour
class LogMarker(Addon):
diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py
index b2f5c9648..13f8a3704 100644
--- a/module/plugins/hooks/UpdateManager.py
+++ b/module/plugins/hooks/UpdateManager.py
@@ -9,8 +9,7 @@ import sys
import time
from module.plugins.internal.Addon import Expose, Addon, threaded
-from module.plugins.internal.Plugin import exists
-from module.plugins.internal.utils import encode, fs_join
+from module.plugins.internal.utils import encode, exists, fs_join
class UpdateManager(Addon):
diff --git a/module/plugins/hooks/UserAgentSwitcher.py b/module/plugins/hooks/UserAgentSwitcher.py
index bd51b30bd..402dd001d 100644
--- a/module/plugins/hooks/UserAgentSwitcher.py
+++ b/module/plugins/hooks/UserAgentSwitcher.py
@@ -3,7 +3,7 @@
import pycurl
from module.plugins.internal.Addon import Addon
-from module.plugins.internal.Plugin import encode
+from module.plugins.internal.utils import encode
class UserAgentSwitcher(Addon):
@@ -12,10 +12,10 @@ class UserAgentSwitcher(Addon):
__version__ = "0.12"
__status__ = "testing"
- __config__ = [("activated" , "bool", "Activated" , True ),
- ("connecttimeout", "int" , "Connection timeout in seconds" , 60 ),
- ("maxredirs" , "int" , "Maximum number of redirects to follow" , 10 ),
- ("useragent" , "str" , "Custom user-agent string" , "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0")]
+ __config__ = [("activated" , "bool", "Activated" , True ),
+ ("connecttimeout", "int" , "Max timeout for link connection in seconds", 60 ),
+ ("maxredirs" , "int" , "Maximum number of redirects to follow" , 10 ),
+ ("useragent" , "str" , "Custom user-agent string" , "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0")]
__description__ = """Custom user-agent"""
__license__ = "GPLv3"
@@ -34,5 +34,5 @@ class UserAgentSwitcher(Addon):
pyfile.plugin.req.http.c.setopt(pycurl.MAXREDIRS, maxredirs)
if useragent:
- self.log_debug("Use custom user-agent string: " + useragent)
+ self.log_debug("Use custom user-agent string `%s`" % useragent)
pyfile.plugin.req.http.c.setopt(pycurl.USERAGENT, encode(useragent))