summaryrefslogtreecommitdiffstats
path: root/pyload/plugins/addon
diff options
context:
space:
mode:
Diffstat (limited to 'pyload/plugins/addon')
-rw-r--r--pyload/plugins/addon/Checksum.py7
-rw-r--r--pyload/plugins/addon/DownloadScheduler.py7
-rw-r--r--pyload/plugins/addon/ExternalScripts.py7
-rw-r--r--pyload/plugins/addon/ExtractArchive.py7
-rw-r--r--pyload/plugins/addon/IRCInterface.py10
-rw-r--r--pyload/plugins/addon/MergeFiles.py74
-rw-r--r--pyload/plugins/addon/MultiHome.py10
-rw-r--r--pyload/plugins/addon/SkipRev.py33
-rw-r--r--pyload/plugins/addon/UnSkipOnFail.py7
-rw-r--r--pyload/plugins/addon/WindowsPhoneToastNotify.py10
10 files changed, 109 insertions, 63 deletions
diff --git a/pyload/plugins/addon/Checksum.py b/pyload/plugins/addon/Checksum.py
index 84024ce83..11154ac0f 100644
--- a/pyload/plugins/addon/Checksum.py
+++ b/pyload/plugins/addon/Checksum.py
@@ -40,7 +40,7 @@ def computeChecksum(local_file, algorithm):
class Checksum(Addon):
__name__ = "Checksum"
__type__ = "addon"
- __version__ = "0.14"
+ __version__ = "0.15"
__config__ = [("activated" , "bool" , "Activated" , True ),
("check_checksum", "bool" , "Check checksum? (If False only size will be verified)", True ),
@@ -63,6 +63,11 @@ class Checksum(Addon):
'default': r'^(?P<hash>[0-9A-Fa-f]+)\s+\*?(?P<name>.+)$'}
+ #@TODO: Remove in 0.4.10
+ def initPeriodical(self):
+ pass
+
+
def coreReady(self):
if not self.getConfig("check_checksum"):
self.logInfo(_("Checksum validation is disabled in plugin configuration"))
diff --git a/pyload/plugins/addon/DownloadScheduler.py b/pyload/plugins/addon/DownloadScheduler.py
index a35bba04e..ba7b14467 100644
--- a/pyload/plugins/addon/DownloadScheduler.py
+++ b/pyload/plugins/addon/DownloadScheduler.py
@@ -10,7 +10,7 @@ from pyload.plugins.internal.Addon import Addon
class DownloadScheduler(Addon):
__name__ = "DownloadScheduler"
__type__ = "addon"
- __version__ = "0.21"
+ __version__ = "0.22"
__config__ = [("timetable", "str" , "List time periods as hh:mm full or number(kB/s)" , "0:00 full, 7:00 250, 10:00 0, 17:00 150"),
("abort" , "bool", "Abort active downloads when start period with speed 0", False )]
@@ -21,6 +21,11 @@ class DownloadScheduler(Addon):
("stickell", "l.stickell@yahoo.it")]
+ #@TODO: Remove in 0.4.10
+ def initPeriodical(self):
+ pass
+
+
def setup(self):
self.cb = None #: callback to scheduler job; will be by removed AddonManager when addon unloaded
diff --git a/pyload/plugins/addon/ExternalScripts.py b/pyload/plugins/addon/ExternalScripts.py
index 05aeecff6..1360e52de 100644
--- a/pyload/plugins/addon/ExternalScripts.py
+++ b/pyload/plugins/addon/ExternalScripts.py
@@ -13,7 +13,7 @@ from pyload.utils import safe_join
class ExternalScripts(Addon):
__name__ = "ExternalScripts"
__type__ = "addon"
- __version__ = "0.24"
+ __version__ = "0.25"
__config__ = [("activated", "bool", "Activated", True)]
@@ -29,6 +29,11 @@ class ExternalScripts(Addon):
"allDownloadsFinished", "allDownloadsProcessed"]
+ #@TODO: Remove in 0.4.10
+ def initPeriodical(self):
+ pass
+
+
def setup(self):
self.scripts = {}
diff --git a/pyload/plugins/addon/ExtractArchive.py b/pyload/plugins/addon/ExtractArchive.py
index eef8f00ef..938de0447 100644
--- a/pyload/plugins/addon/ExtractArchive.py
+++ b/pyload/plugins/addon/ExtractArchive.py
@@ -59,7 +59,7 @@ from pyload.utils import safe_join, fs_encode
class ExtractArchive(Addon):
__name__ = "ExtractArchive"
__type__ = "addon"
- __version__ = "0.18"
+ __version__ = "0.19"
__config__ = [("activated" , "bool" , "Activated" , True ),
("fullpath" , "bool" , "Extract full path" , True ),
@@ -83,6 +83,11 @@ class ExtractArchive(Addon):
event_list = ["allDownloadsProcessed"]
+ #@TODO: Remove in 0.4.10
+ def initPeriodical(self):
+ pass
+
+
def setup(self):
self.plugins = []
self.passwords = []
diff --git a/pyload/plugins/addon/IRCInterface.py b/pyload/plugins/addon/IRCInterface.py
index 5b3178852..5392b01a8 100644
--- a/pyload/plugins/addon/IRCInterface.py
+++ b/pyload/plugins/addon/IRCInterface.py
@@ -20,10 +20,9 @@ from pyload.utils import formatSize
class IRCInterface(Thread, Addon):
__name__ = "IRCInterface"
__type__ = "addon"
- __version__ = "0.12"
+ __version__ = "0.13"
- __config__ = [("activated", "bool", "Activated", False),
- ("host" , "str" , "IRC-Server Address" , "Enter your server here!"),
+ __config__ = [("host" , "str" , "IRC-Server Address" , "Enter your server here!"),
("port" , "int" , "IRC-Server Port" , 6667 ),
("ident" , "str" , "Clients ident" , "pyload-irc" ),
("realname" , "str" , "Realname" , "pyload-irc" ),
@@ -45,6 +44,11 @@ class IRCInterface(Thread, Addon):
self.setDaemon(True)
+ #@TODO: Remove in 0.4.10
+ def initPeriodical(self):
+ pass
+
+
def coreReady(self):
self.abort = False
self.more = []
diff --git a/pyload/plugins/addon/MergeFiles.py b/pyload/plugins/addon/MergeFiles.py
index 2483135f4..2efc221dc 100644
--- a/pyload/plugins/addon/MergeFiles.py
+++ b/pyload/plugins/addon/MergeFiles.py
@@ -1,5 +1,7 @@
# -*- coding: utf-8 -*-
+from __future__ import with_statement
+
import os
import re
@@ -12,7 +14,7 @@ from pyload.utils import safe_join, fs_encode
class MergeFiles(Addon):
__name__ = "MergeFiles"
__type__ = "addon"
- __version__ = "0.12"
+ __version__ = "0.13"
__config__ = [("activated", "bool", "Activated", True)]
@@ -24,6 +26,11 @@ class MergeFiles(Addon):
BUFFER_SIZE = 4096
+ #@TODO: Remove in 0.4.10
+ def initPeriodical(self):
+ pass
+
+
def setup(self):
# nothing to do
pass
@@ -48,36 +55,37 @@ class MergeFiles(Addon):
for name, file_list in files.iteritems():
self.logInfo(_("Starting merging of"), name)
- final_file = open(safe_join(download_folder, name), "wb")
-
- for splitted_file in file_list:
- self.logDebug("Merging part", splitted_file)
- pyfile = self.core.files.getFile(fid_dict[splitted_file])
- pyfile.setStatus("processing")
- try:
- s_file = open(os.path.join(download_folder, splitted_file), "rb")
- size_written = 0
- s_file_size = int(os.path.getsize(os.path.join(download_folder, splitted_file)))
-
- while True:
- f_buffer = s_file.read(self.BUFFER_SIZE)
- if f_buffer:
- final_file.write(f_buffer)
- size_written += self.BUFFER_SIZE
- pyfile.setProgress((size_written * 100) / s_file_size)
- else:
- break
-
- s_file.close()
- self.logDebug("Finished merging part", splitted_file)
-
- except Exception, e:
- print_exc()
-
- finally:
- pyfile.setProgress(100)
- pyfile.setStatus("finished")
- pyfile.release()
-
- final_file.close()
+
+ final_file = open(save_join(download_folder, name), "wb")
+ for splitted_file in file_list:
+ self.logDebug("Merging part", splitted_file)
+
+ pyfile = self.core.files.getFile(fid_dict[splitted_file])
+
+ pyfile.setStatus("processing")
+
+ try:
+ with open(os.path.join(download_folder, splitted_file), "rb") as s_file:
+ size_written = 0
+ s_file_size = int(os.path.getsize(os.path.join(download_folder, splitted_file)))
+
+ while True:
+ f_buffer = s_file.read(self.BUFFER_SIZE)
+ if f_buffer:
+ final_file.write(f_buffer)
+ size_written += self.BUFFER_SIZE
+ pyfile.setProgress((size_written * 100) / s_file_size)
+ else:
+ break
+
+ self.logDebug("Finished merging part", splitted_file)
+
+ except Exception, e:
+ print_exc()
+
+ finally:
+ pyfile.setProgress(100)
+ pyfile.setStatus("finished")
+ pyfile.release()
+
self.logInfo(_("Finished merging of"), name)
diff --git a/pyload/plugins/addon/MultiHome.py b/pyload/plugins/addon/MultiHome.py
index 4371125dc..bcb51254d 100644
--- a/pyload/plugins/addon/MultiHome.py
+++ b/pyload/plugins/addon/MultiHome.py
@@ -8,16 +8,20 @@ from pyload.plugins.internal.Addon import Addon
class MultiHome(Addon):
__name__ = "MultiHome"
__type__ = "addon"
- __version__ = "0.11"
+ __version__ = "0.12"
- __config__ = [("activated" , "bool", "Activated" , False ),
- ("interfaces", "str" , "Interfaces", "None")]
+ __config__ = [("interfaces", "str" , "Interfaces", "None")]
__description__ = """Ip address changer"""
__license__ = "GPLv3"
__authors__ = [("mkaay", "mkaay@mkaay.de")]
+ #@TODO: Remove in 0.4.10
+ def initPeriodical(self):
+ pass
+
+
def setup(self):
self.register = {}
self.interfaces = []
diff --git a/pyload/plugins/addon/SkipRev.py b/pyload/plugins/addon/SkipRev.py
index 0c14282a1..66ddc89d2 100644
--- a/pyload/plugins/addon/SkipRev.py
+++ b/pyload/plugins/addon/SkipRev.py
@@ -1,9 +1,7 @@
# -*- coding: utf-8 -*-
-import re
-
from urllib import unquote
-from urlparse import urljoin, urlparse
+from urlparse import urlparse
from pyload.plugins.internal.Addon import Addon
from pyload.plugins.Plugin import SkipDownload
@@ -12,17 +10,20 @@ from pyload.plugins.Plugin import SkipDownload
class SkipRev(Adoon):
__name__ = "SkipRev"
__type__ = "addon"
- __version__ = "0.13"
+ __version__ = "0.14"
- __config__ = [("auto", "bool", "Automatically keep all rev files needed by package", True),
- ("tokeep", "int" , "Min number of rev files to keep for package" , 1),
- ("unskip", "bool", "Restart a skipped rev when download fails" , True)]
+ __config__ = [("tokeep", "int", "Number of rev files to keep for package (-1 to auto)", -1)]
__description__ = """Skip files ending with extension rev"""
__license__ = "GPLv3"
__authors__ = [("Walter Purcaro", "vuolter@gmail.com")]
+ #@TODO: Remove in 0.4.10
+ def initPeriodical(self):
+ pass
+
+
def _setup(self):
super(self.pyfile.plugin, self).setup()
if self.pyfile.hasStatus("skipped"):
@@ -55,11 +56,11 @@ class SkipRev(Adoon):
tokeep = self.getConfig("tokeep")
- if tokeep > 0:
+ if tokeep:
saved = [True for link in pyfile.package().getChildren() \
if link.name.endswith(".rev") and (link.hasStatus("finished") or link.hasStatus("downloading"))].count(True)
- if saved < tokeep:
+ if not saved or saved < tokeep: #: keep one rev at least in auto mode
return
pyfile.setCustomStatus("SkipRev", "skipped")
@@ -67,15 +68,15 @@ class SkipRev(Adoon):
def downloadFailed(self, pyfile):
- if self.getConfig("auto") is False:
-
- if self.getConfig("unskip") is False:
- return
+ tokeep = self.getConfig("tokeep")
- if not pyfile.name.endswith(".rev"):
- return
+ if not tokeep:
+ return
for link in pyfile.package().getChildren():
if link.hasStatus("skipped") and link.name.endswith(".rev"):
- link.setCustomStatus("unskipped", "queued")
+ if tokeep > -1 or pyfile.name.endswith(".rev"):
+ link.setStatus("queued")
+ else:
+ link.setCustomStatus("unskipped", "queued")
return
diff --git a/pyload/plugins/addon/UnSkipOnFail.py b/pyload/plugins/addon/UnSkipOnFail.py
index 0bccca75f..a0b3ec540 100644
--- a/pyload/plugins/addon/UnSkipOnFail.py
+++ b/pyload/plugins/addon/UnSkipOnFail.py
@@ -10,7 +10,7 @@ from pyload.utils import fs_encode
class UnSkipOnFail(Addon):
__name__ = "UnSkipOnFail"
__type__ = "addon"
- __version__ = "0.01"
+ __version__ = "0.02"
__config__ = [("activated", "bool", "Activated", True)]
@@ -19,6 +19,11 @@ class UnSkipOnFail(Addon):
__authors__ = [("hagg", None)]
+ #@TODO: Remove in 0.4.10
+ def initPeriodical(self):
+ pass
+
+
def downloadFailed(self, pyfile):
pyfile_name = basename(pyfile.name)
pid = pyfile.package().id
diff --git a/pyload/plugins/addon/WindowsPhoneToastNotify.py b/pyload/plugins/addon/WindowsPhoneToastNotify.py
index 5b62c49a8..fbaa89ea4 100644
--- a/pyload/plugins/addon/WindowsPhoneToastNotify.py
+++ b/pyload/plugins/addon/WindowsPhoneToastNotify.py
@@ -9,10 +9,9 @@ from pyload.plugins.internal.Addon import Addon
class WindowsPhoneToastNotify(Addon):
__name__ = "WindowsPhoneToastNotify"
__type__ = "addon"
- __version__ = "0.02"
+ __version__ = "0.03"
- __config__ = [("activated" , "bool", "Activated" , False),
- ("force" , "bool", "Force even if client is connected" , False),
+ __config__ = [("force" , "bool", "Force even if client is connected" , False),
("pushId" , "str" , "pushId" , "" ),
("pushUrl" , "str" , "pushUrl" , "" ),
("pushTimeout", "int" , "Timeout between notifications in seconds", 0 )]
@@ -22,6 +21,11 @@ class WindowsPhoneToastNotify(Addon):
__authors__ = [("Andy Voigt", "phone-support@hotmail.de")]
+ #@TODO: Remove in 0.4.10
+ def initPeriodical(self):
+ pass
+
+
def getXmlData(self):
myxml = ("<?xml version='1.0' encoding='utf-8'?> <wp:Notification xmlns:wp='WPNotification'> "
"<wp:Toast> <wp:Text1>Pyload Mobile</wp:Text1> <wp:Text2>Captcha waiting!</wp:Text2> "