diff options
author | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-04-13 17:20:59 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-04-13 17:20:59 +0200 |
commit | e00ef98491f79ae8aa972ae1473dae4a7b78c07e (patch) | |
tree | 31be0c7cdcebb61525bcc387bcf15d265a1c494a /pyload/plugin/addon | |
parent | Fix except (diff) | |
download | pyload-e00ef98491f79ae8aa972ae1473dae4a7b78c07e.tar.xz |
Cleanup
Diffstat (limited to 'pyload/plugin/addon')
-rw-r--r-- | pyload/plugin/addon/AndroidPhoneNotify.py | 2 | ||||
-rw-r--r-- | pyload/plugin/addon/AntiVirus.py | 2 | ||||
-rw-r--r-- | pyload/plugin/addon/ClickNLoad.py | 4 | ||||
-rw-r--r-- | pyload/plugin/addon/DeleteFinished.py | 6 | ||||
-rw-r--r-- | pyload/plugin/addon/ExtractArchive.py | 13 | ||||
-rw-r--r-- | pyload/plugin/addon/IRCInterface.py | 1 | ||||
-rw-r--r-- | pyload/plugin/addon/MergeFiles.py | 2 | ||||
-rw-r--r-- | pyload/plugin/addon/MultiHome.py | 1 | ||||
-rw-r--r-- | pyload/plugin/addon/SkipRev.py | 2 | ||||
-rw-r--r-- | pyload/plugin/addon/UpdateManager.py | 12 | ||||
-rw-r--r-- | pyload/plugin/addon/WindowsPhoneNotify.py | 2 |
11 files changed, 47 insertions, 0 deletions
diff --git a/pyload/plugin/addon/AndroidPhoneNotify.py b/pyload/plugin/addon/AndroidPhoneNotify.py index 8332f668d..3fb291e11 100644 --- a/pyload/plugin/addon/AndroidPhoneNotify.py +++ b/pyload/plugin/addon/AndroidPhoneNotify.py @@ -75,6 +75,8 @@ class AndroidPhoneNotify(Addon): @Expose + + def notify(self, event, msg="", diff --git a/pyload/plugin/addon/AntiVirus.py b/pyload/plugin/addon/AntiVirus.py index 3866014ee..c6628a684 100644 --- a/pyload/plugin/addon/AntiVirus.py +++ b/pyload/plugin/addon/AntiVirus.py @@ -43,6 +43,8 @@ class AntiVirus(Addon): @Expose @threaded + + def scan(self, pyfile, thread): file = fs_encode(pyfile.plugin.lastDownload) filename = os.path.basename(pyfile.plugin.lastDownload) diff --git a/pyload/plugin/addon/ClickNLoad.py b/pyload/plugin/addon/ClickNLoad.py index b6448598a..6a3d5d662 100644 --- a/pyload/plugin/addon/ClickNLoad.py +++ b/pyload/plugin/addon/ClickNLoad.py @@ -48,6 +48,8 @@ class ClickNLoad(Addon): @threaded + + def proxy(self, ip, webport, cnlport): time.sleep(10) #@TODO: Remove in 0.4.10 (implement addon delay on startup) @@ -61,6 +63,8 @@ class ClickNLoad(Addon): @threaded + + def _server(self, ip, webport, cnlport): try: dock_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) diff --git a/pyload/plugin/addon/DeleteFinished.py b/pyload/plugin/addon/DeleteFinished.py index f8f42da1e..c0a2e8752 100644 --- a/pyload/plugin/addon/DeleteFinished.py +++ b/pyload/plugin/addon/DeleteFinished.py @@ -23,6 +23,8 @@ class DeleteFinished(Addon): ## overwritten methods ## + + def setup(self): self.interval = self.MIN_CHECK_INTERVAL @@ -59,6 +61,8 @@ class DeleteFinished(Addon): ## own methods ## @style.queue + + def deleteFinished(self, mode): self.c.execute('DELETE FROM packages WHERE NOT EXISTS(SELECT 1 FROM links WHERE package=packages.id AND status NOT IN (%s))' % mode) self.c.execute('DELETE FROM links WHERE NOT EXISTS(SELECT 1 FROM packages WHERE id=links.package)') @@ -70,6 +74,8 @@ class DeleteFinished(Addon): ## event managing ## + + def addEvent(self, event, func): """Adds an event listener for event name""" if event in self.manager.events: diff --git a/pyload/plugin/addon/ExtractArchive.py b/pyload/plugin/addon/ExtractArchive.py index d94c0ca18..a52b55f0a 100644 --- a/pyload/plugin/addon/ExtractArchive.py +++ b/pyload/plugin/addon/ExtractArchive.py @@ -14,6 +14,7 @@ if sys.version_info < (2, 7) and os.name != "nt": import errno import subprocess + def _eintr_retry_call(func, *args): while True: try: @@ -26,6 +27,8 @@ if sys.version_info < (2, 7) and os.name != "nt": # unsued timeout option for older python version + + def wait(self, timeout=0): """Wait for child process to terminate. Returns returncode attribute.""" @@ -190,6 +193,8 @@ class ExtractArchive(Addon): @threaded + + def extractQueued(self, thread): packages = self.queue.get() while packages: @@ -206,6 +211,8 @@ class ExtractArchive(Addon): @Expose + + def extractPackage(self, *ids): """ Extract packages with given id""" for id in ids: @@ -231,6 +238,8 @@ class ExtractArchive(Addon): @Expose + + def extract(self, ids, thread=None): #@TODO: Use pypack, not pid to improve method usability if not ids: return False @@ -503,6 +512,8 @@ class ExtractArchive(Addon): @Expose + + def getPasswords(self, reload=True): """ List of saved passwords """ if reload: @@ -528,6 +539,8 @@ class ExtractArchive(Addon): @Expose + + def addPassword(self, password): """ Adds a password to saved list""" try: diff --git a/pyload/plugin/addon/IRCInterface.py b/pyload/plugin/addon/IRCInterface.py index 1246c91fa..73998b674 100644 --- a/pyload/plugin/addon/IRCInterface.py +++ b/pyload/plugin/addon/IRCInterface.py @@ -199,6 +199,7 @@ class IRCInterface(Thread, Addon): #### Events + def event_pass(self, args): return [] diff --git a/pyload/plugin/addon/MergeFiles.py b/pyload/plugin/addon/MergeFiles.py index dfc5f41d4..e7da4a82a 100644 --- a/pyload/plugin/addon/MergeFiles.py +++ b/pyload/plugin/addon/MergeFiles.py @@ -26,6 +26,8 @@ class MergeFiles(Addon): @threaded + + def packageFinished(self, pack): files = {} fid_dict = {} diff --git a/pyload/plugin/addon/MultiHome.py b/pyload/plugin/addon/MultiHome.py index 458ddbeca..057764a1e 100644 --- a/pyload/plugin/addon/MultiHome.py +++ b/pyload/plugin/addon/MultiHome.py @@ -43,6 +43,7 @@ class MultiHome(Addon): requestFactory = self.core.requestFactory oldGetRequest = requestFactory.getRequest + def getRequest(pluginName, account=None): iface = self.bestInterface(pluginName, account) if iface: diff --git a/pyload/plugin/addon/SkipRev.py b/pyload/plugin/addon/SkipRev.py index 5209da615..e55d98056 100644 --- a/pyload/plugin/addon/SkipRev.py +++ b/pyload/plugin/addon/SkipRev.py @@ -25,6 +25,8 @@ class SkipRev(Addon): @staticmethod + + def _setup(self): self.pyfile.plugin._setup() if self.pyfile.hasStatus("skipped"): diff --git a/pyload/plugin/addon/UpdateManager.py b/pyload/plugin/addon/UpdateManager.py index 023884029..c7c7ec047 100644 --- a/pyload/plugin/addon/UpdateManager.py +++ b/pyload/plugin/addon/UpdateManager.py @@ -50,12 +50,14 @@ class UpdateManager(Addon): SERVER_URL = "http://updatemanager.pyload.org" if release_status == 5 else None MIN_CHECK_INTERVAL = 3 * 60 * 60 #: 3 hours + def activate(self): if self.checkonstart: self.update() self.initPeriodical() + def setup(self): self.interval = 10 self.info = {'pyload': False, 'version': None, 'plugins': False, 'last_check': time.time()} @@ -67,6 +69,7 @@ class UpdateManager(Addon): else: self.checkonstart = False + def periodical(self): if self.core.debug: if self.getConfig('reloadplugins'): @@ -80,6 +83,8 @@ class UpdateManager(Addon): self.update() @Expose + + def autoreloadPlugins(self): """ reload and reindex all modified plugins """ modules = filter( @@ -108,6 +113,7 @@ class UpdateManager(Addon): return True if self.core.pluginManager.reloadPlugins(reloads) else False + def server_response(self): try: return getURL(self.SERVER_URL, get={'v': self.core.api.getServerVersion()}).splitlines() @@ -117,6 +123,8 @@ class UpdateManager(Addon): @Expose @threaded + + def update(self): """ check for updates """ @@ -127,6 +135,7 @@ class UpdateManager(Addon): else: self.core.api.unpauseServer() + def _update(self): data = self.server_response() @@ -156,6 +165,7 @@ class UpdateManager(Addon): # 2 = Plugins updated, but restart required return exitcode + def _updatePlugins(self, data): """ check for plugin updates """ @@ -266,6 +276,8 @@ class UpdateManager(Addon): return exitcode @Expose + + def removePlugins(self, type_plugins): """ delete plugins from disk """ diff --git a/pyload/plugin/addon/WindowsPhoneNotify.py b/pyload/plugin/addon/WindowsPhoneNotify.py index b1d1c8b0f..f7a5e6ec1 100644 --- a/pyload/plugin/addon/WindowsPhoneNotify.py +++ b/pyload/plugin/addon/WindowsPhoneNotify.py @@ -82,6 +82,8 @@ class WindowsPhoneNotify(Addon): @Expose + + def notify(self, event, msg="", |