summaryrefslogtreecommitdiffstats
path: root/module/plugins/hooks
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/hooks')
-rw-r--r--module/plugins/hooks/AntiStandby.py6
-rw-r--r--module/plugins/hooks/AntiVirus.py12
-rw-r--r--module/plugins/hooks/ClickNLoad.py4
-rw-r--r--module/plugins/hooks/ExtractArchive.py4
-rw-r--r--module/plugins/hooks/IRC.py2
-rw-r--r--module/plugins/hooks/ImageTyperz.py4
-rw-r--r--module/plugins/hooks/LogMarker.py4
-rw-r--r--module/plugins/hooks/SkipRev.py2
-rw-r--r--module/plugins/hooks/UnSkipOnFail.py4
-rw-r--r--module/plugins/hooks/UpdateManager.py6
-rw-r--r--module/plugins/hooks/XFileSharing.py2
11 files changed, 25 insertions, 25 deletions
diff --git a/module/plugins/hooks/AntiStandby.py b/module/plugins/hooks/AntiStandby.py
index 2159e5937..05f33b397 100644
--- a/module/plugins/hooks/AntiStandby.py
+++ b/module/plugins/hooks/AntiStandby.py
@@ -27,7 +27,7 @@ class Kernel32(object):
class AntiStandby(Addon):
__name__ = "AntiStandby"
__type__ = "hook"
- __version__ = "0.14"
+ __version__ = "0.15"
__status__ = "testing"
__config__ = [("activated", "bool", "Activated" , True ),
@@ -57,7 +57,7 @@ class AntiStandby(Addon):
if hdd:
self.periodical.start(self.config.get('interval'), threaded=True)
- if os.name is "nt":
+ if os.name == "nt":
self.win_standby(system, display)
elif sys.platform == "darwin":
@@ -70,7 +70,7 @@ class AntiStandby(Addon):
def deactivate(self):
self.remove(self.TMP_FILE, trash=False)
- if os.name is "nt":
+ if os.name == "nt":
self.win_standby(True)
elif sys.platform == "darwin":
diff --git a/module/plugins/hooks/AntiVirus.py b/module/plugins/hooks/AntiVirus.py
index 1a0f3f8bd..bafd3f4d3 100644
--- a/module/plugins/hooks/AntiVirus.py
+++ b/module/plugins/hooks/AntiVirus.py
@@ -16,7 +16,7 @@ from module.plugins.internal.misc import encode, exists, fsjoin
class AntiVirus(Addon):
__name__ = "AntiVirus"
__type__ = "hook"
- __version__ = "0.16"
+ __version__ = "0.18"
__status__ = "broken"
#@TODO: add trash option (use Send2Trash lib)
@@ -44,7 +44,7 @@ class AntiVirus(Addon):
if not os.path.isfile(avfile):
self.fail(_("Antivirus executable not found"))
- scanfolder = self.config.get('avtarget') is "folder"
+ scanfolder = self.config.get('avtarget') == "folder"
if scanfolder:
dl_folder = self.pyload.config.get("general", "download_folder")
@@ -83,14 +83,14 @@ class AntiVirus(Addon):
action = self.config.get('action')
if scanfolder:
- if action is "Antivirus default":
+ if action == "Antivirus default":
self.log_warning(_("Delete/Quarantine task skipped in folder scan mode"))
return
pyfile.error = _("Infected file")
try:
- if action is "Delete":
+ if action == "Delete":
if not self.config.get('deltotrash'):
os.remove(file)
@@ -111,7 +111,7 @@ class AntiVirus(Addon):
else:
self.log_debug("Successfully moved file to trash")
- elif action is "Quarantine":
+ elif action == "Quarantine":
pyfile.setCustomStatus(_("file moving"))
shutil.move(file, self.config.get('quardir'))
@@ -132,5 +132,5 @@ class AntiVirus(Addon):
def download_failed(self, pyfile):
#: Check if pyfile is still "failed", maybe might has been restarted in meantime
- if pyfile.status is 8 and self.config.get('scanfailed'):
+ if pyfile.status == 8 and self.config.get('scanfailed'):
return self.scan(pyfile)
diff --git a/module/plugins/hooks/ClickNLoad.py b/module/plugins/hooks/ClickNLoad.py
index 83d71d8e3..4ac6b507f 100644
--- a/module/plugins/hooks/ClickNLoad.py
+++ b/module/plugins/hooks/ClickNLoad.py
@@ -16,7 +16,7 @@ from module.plugins.internal.misc import forward, lock
class ClickNLoad(Addon):
__name__ = "ClickNLoad"
__type__ = "hook"
- __version__ = "0.52"
+ __version__ = "0.53"
__status__ = "testing"
__config__ = [("activated", "bool" , "Activated" , True ),
@@ -93,7 +93,7 @@ class ClickNLoad(Addon):
server_socket.connect((webip, webport))
- self.forward(client_socket, server_socket, self.config.get('dest') is "queue")
+ self.forward(client_socket, server_socket, self.config.get('dest') == "queue")
self.forward(server_socket, client_socket)
except socket.timeout:
diff --git a/module/plugins/hooks/ExtractArchive.py b/module/plugins/hooks/ExtractArchive.py
index 28286d02c..782e917b0 100644
--- a/module/plugins/hooks/ExtractArchive.py
+++ b/module/plugins/hooks/ExtractArchive.py
@@ -7,7 +7,7 @@ import sys
# monkey patch bug in python 2.6 and lower
# http://bugs.python.org/issue6122 , http://bugs.python.org/issue1236 , http://bugs.python.org/issue1731717
-if sys.version_info < (2, 7) and os.name is not "nt":
+if sys.version_info < (2, 7) and os.name != "nt":
import errno
import subprocess
@@ -98,7 +98,7 @@ class ArchiveQueue(object):
class ExtractArchive(Addon):
__name__ = "ExtractArchive"
__type__ = "hook"
- __version__ = "1.55"
+ __version__ = "1.56"
__status__ = "broken"
__config__ = [("activated" , "bool" , "Activated" , True ),
diff --git a/module/plugins/hooks/IRC.py b/module/plugins/hooks/IRC.py
index 7dec4b798..2b7bea5fd 100644
--- a/module/plugins/hooks/IRC.py
+++ b/module/plugins/hooks/IRC.py
@@ -219,7 +219,7 @@ class IRC(Thread, Notifier):
lines = ["ID - Name - Status - Speed - ETA - Progress"]
for data in downloads:
- if data.status is 5:
+ if data.status == 5:
temp_progress = data.format_wait
else:
temp_progress = "%d%% (%s)" % (data.percent, data.format_size)
diff --git a/module/plugins/hooks/ImageTyperz.py b/module/plugins/hooks/ImageTyperz.py
index 5afeb4a78..4c43c9189 100644
--- a/module/plugins/hooks/ImageTyperz.py
+++ b/module/plugins/hooks/ImageTyperz.py
@@ -32,7 +32,7 @@ class ImageTyperzException(Exception):
class ImageTyperz(Addon):
__name__ = "ImageTyperz"
__type__ = "hook"
- __version__ = "0.10"
+ __version__ = "0.11"
__status__ = "testing"
__config__ = [("activated" , "bool" , "Activated" , False),
@@ -99,7 +99,7 @@ class ImageTyperz(Addon):
raise ImageTyperzException(res)
else:
data = res.split('|')
- if len(data) is 2:
+ if len(data) == 2:
ticket, result = data
else:
raise ImageTyperzException("Unknown response: %s" % res)
diff --git a/module/plugins/hooks/LogMarker.py b/module/plugins/hooks/LogMarker.py
index 80f7b17fb..e73fa01e6 100644
--- a/module/plugins/hooks/LogMarker.py
+++ b/module/plugins/hooks/LogMarker.py
@@ -9,7 +9,7 @@ from module.plugins.internal.misc import seconds_to_nexthour
class LogMarker(Addon):
__name__ = "LogMarker"
__type__ = "hook"
- __version__ = "0.05"
+ __version__ = "0.06"
__status__ = "testing"
__config__ = [("activated", "bool", "Activated" , False),
@@ -26,7 +26,7 @@ class LogMarker(Addon):
def periodical_task(self):
- if self.config.get('mark_day') and datetime.datetime.today().hour is 0:
+ if self.config.get('mark_day') and datetime.datetime.today().hour == 0:
self.log_info("------------------------------------------------")
self.log_info(_("------------------- DAY MARK -------------------"))
self.log_info("------------------------------------------------")
diff --git a/module/plugins/hooks/SkipRev.py b/module/plugins/hooks/SkipRev.py
index 429737e94..c318e3247 100644
--- a/module/plugins/hooks/SkipRev.py
+++ b/module/plugins/hooks/SkipRev.py
@@ -72,7 +72,7 @@ class SkipRev(Addon):
pyname = re.compile(r'%s\.part\d+\.rev$' % pyfile.name.rsplit('.', 2)[0].replace('.', '\.'))
for fid, fdata in pyfile.package().getChildren().items():
- if fdata['status'] is 4 and pyname.match(fdata['name']):
+ if fdata['status'] == 4 and pyname.match(fdata['name']):
pyfile_new = self._create_pyFile(fdata)
if revtokeep > -1 or pyfile.name.endswith(".rev"):
diff --git a/module/plugins/hooks/UnSkipOnFail.py b/module/plugins/hooks/UnSkipOnFail.py
index db43bca2b..35ff91672 100644
--- a/module/plugins/hooks/UnSkipOnFail.py
+++ b/module/plugins/hooks/UnSkipOnFail.py
@@ -7,7 +7,7 @@ from module.plugins.internal.Addon import Addon
class UnSkipOnFail(Addon):
__name__ = "UnSkipOnFail"
__type__ = "hook"
- __version__ = "0.11"
+ __version__ = "0.12"
__status__ = "testing"
__config__ = [("activated", "bool", "Activated", True)]
@@ -62,7 +62,7 @@ class UnSkipOnFail(Addon):
pdata = self.pyload.api.getPackageData(pinfo.pid)
for link in pdata.links:
#: Check if link == "skipped"
- if link.status is not 4:
+ if link.status != 4:
continue
#: Check if link name collides with pdata's name
diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py
index 817990b0f..28a8ece39 100644
--- a/module/plugins/hooks/UpdateManager.py
+++ b/module/plugins/hooks/UpdateManager.py
@@ -15,7 +15,7 @@ from module.plugins.internal.misc import encode, exists, fsjoin
class UpdateManager(Addon):
__name__ = "UpdateManager"
__type__ = "hook"
- __version__ = "1.06"
+ __version__ = "1.08"
__status__ = "testing"
__config__ = [("activated" , "bool", "Activated" , True ),
@@ -146,7 +146,7 @@ class UpdateManager(Addon):
"""
Check for updates
"""
- if self._update() is not 2 or not self.config.get('autorestart'):
+ if self._update() != 2 or not self.config.get('autorestart'):
return
if not self.pyload.api.statusDownloads():
@@ -345,7 +345,7 @@ class UpdateManager(Addon):
py_filename = fsjoin(basedir, plugin_type, plugin_name + ".py")
pyc_filename = py_filename + "c"
- if plugin_type is "hook":
+ if plugin_type == "hook":
try:
self.manager.deactivateHook(plugin_name)
diff --git a/module/plugins/hooks/XFileSharing.py b/module/plugins/hooks/XFileSharing.py
index 4af246da8..3de4d02eb 100644
--- a/module/plugins/hooks/XFileSharing.py
+++ b/module/plugins/hooks/XFileSharing.py
@@ -84,7 +84,7 @@ class XFileSharing(Addon):
self.log_info(_("Handle %d %s%s: %s") %
(len(plugin_set),
type,
- "" if len(plugin_set) is 1 else "s",
+ "" if len(plugin_set) == 1 else "s",
match_list.replace('\.', '.').replace('|', ', ')))
else:
plugin_list = []