summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-12-02 11:23:08 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-12-02 11:23:08 +0100
commit84402b1194e99327c75c8762f4754802ca140e6a (patch)
tree2281e553b6ba2c3523cd23add01d2abf28a9036b /module
parentmegaupload decode file info, megaupload/depositfiles folders (diff)
downloadpyload-84402b1194e99327c75c8762f4754802ca140e6a.tar.xz
closed #441
Diffstat (limited to 'module')
-rw-r--r--module/HookManager.py4
-rw-r--r--module/plugins/PluginManager.py2
-rw-r--r--module/plugins/hooks/UpdateManager.py20
-rw-r--r--module/remote/socketbackend/create_ttypes.py6
-rw-r--r--module/remote/socketbackend/ttypes.py90
5 files changed, 66 insertions, 56 deletions
diff --git a/module/HookManager.py b/module/HookManager.py
index 1ecaae1ac..16f692d76 100644
--- a/module/HookManager.py
+++ b/module/HookManager.py
@@ -308,6 +308,8 @@ class HookManager:
try:
f(*args)
except Exception, e:
- self.log.debug("Error calling event handler %s: %s, %s, %s"
+ self.log.warning("Error calling event handler %s: %s, %s, %s"
% (event, f, args, str(e)))
+ if self.core.debug:
+ traceback.print_exc()
diff --git a/module/plugins/PluginManager.py b/module/plugins/PluginManager.py
index 09d5f58e7..f3f5f47bc 100644
--- a/module/plugins/PluginManager.py
+++ b/module/plugins/PluginManager.py
@@ -326,7 +326,7 @@ class PluginManager:
""" reloads and reindexes plugins """
if not type_plugins: return False
- self.log.debug("Reload plugins: %s" % type_plugins)
+ self.log.debug("Request reload of plugins: %s" % type_plugins)
as_dict = {}
for t,n in type_plugins:
diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py
index 8212ddb65..46ca5cc4b 100644
--- a/module/plugins/hooks/UpdateManager.py
+++ b/module/plugins/hooks/UpdateManager.py
@@ -24,6 +24,7 @@ from os import stat
from os.path import join
from time import time
+from module.ConfigParser import IGNORE
from module.network.RequestFactory import getURL
from module.plugins.Hook import threaded, Expose, Hook
@@ -116,12 +117,12 @@ class UpdateManager(Hook):
for plugin in updates:
path, version = plugin.split(":")
- prefix, name = path.split("/")
+ prefix, filename = path.split("/")
- if name.endswith(".pyc"):
- tmp_name = name[:name.find("_")]
+ if filename.endswith(".pyc"):
+ name = filename[:filename.find("_")]
else:
- tmp_name = name.replace(".py", "")
+ name = filename.replace(".py", "")
if prefix.endswith("s"):
type = prefix[:-1]
@@ -130,10 +131,13 @@ class UpdateManager(Hook):
plugins = getattr(self.core.pluginManager, "%sPlugins" % type)
- if tmp_name in plugins:
- if float(plugins[tmp_name]["v"]) >= float(version):
+ if name in plugins:
+ if float(plugins[name]["v"]) >= float(version):
continue
+ if name in IGNORE or (type, name) in IGNORE:
+ continue
+
self.log.info(_("New version of %(type)s|%(name)s : %(version).2f") % {
"type": type,
"name": name,
@@ -143,7 +147,7 @@ class UpdateManager(Hook):
try:
content = getURL("http://get.pyload.org/plugins/get/" + path)
except Exception, e:
- self.logWarning(_("Error when updating %s") % name, str(e))
+ self.logWarning(_("Error when updating %s") % filename, str(e))
continue
m = vre.search(content)
@@ -151,7 +155,7 @@ class UpdateManager(Hook):
self.logWarning(_("Error when updating %s") % name, _("Version mismatch"))
continue
- f = open(join("userplugins", prefix, name), "wb")
+ f = open(join("userplugins", prefix, filename), "wb")
f.write(content)
f.close()
self.updated = True
diff --git a/module/remote/socketbackend/create_ttypes.py b/module/remote/socketbackend/create_ttypes.py
index 0d6192a5a..1bf8856a2 100644
--- a/module/remote/socketbackend/create_ttypes.py
+++ b/module/remote/socketbackend/create_ttypes.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
+import inspect
import sys
from os.path import abspath, dirname, join
@@ -77,7 +78,10 @@ class BaseObject(object):
for name in dir(Iface):
if name.startswith("_"): continue
- f.write("\tdef %s(self):\n\t\tpass\n" % name)
+
+ func = inspect.getargspec(getattr(Iface, name))
+
+ f.write("\tdef %s(%s):\n\t\tpass\n" % (name, ", ".join(func.args)))
f.write("\n")
diff --git a/module/remote/socketbackend/ttypes.py b/module/remote/socketbackend/ttypes.py
index 527dff767..58e638689 100644
--- a/module/remote/socketbackend/ttypes.py
+++ b/module/remote/socketbackend/ttypes.py
@@ -4,7 +4,7 @@
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
class BaseObject(object):
- __slots__ = []
+ __slots__ = []
class Destination:
Collector = 0
@@ -209,41 +209,41 @@ class UserData(BaseObject):
self.templateName = templateName
class Iface:
- def addFiles(self):
+ def addFiles(self, pid, links):
pass
- def addPackage(self):
+ def addPackage(self, name, links, dest):
pass
- def call(self):
+ def call(self, info):
pass
- def checkOnlineStatus(self):
+ def checkOnlineStatus(self, urls):
pass
- def checkOnlineStatusContainer(self):
+ def checkOnlineStatusContainer(self, urls, filename, data):
pass
- def checkURLs(self):
+ def checkURLs(self, urls):
pass
- def deleteFiles(self):
+ def deleteFiles(self, fids):
pass
def deleteFinished(self):
pass
- def deletePackages(self):
+ def deletePackages(self, pids):
pass
def freeSpace(self):
pass
- def generateAndAddPackages(self):
+ def generateAndAddPackages(self, links, dest):
pass
- def generatePackages(self):
+ def generatePackages(self, links):
pass
def getAccountTypes(self):
pass
- def getAccounts(self):
+ def getAccounts(self, refresh):
pass
def getAllInfo(self):
pass
def getAllUserData(self):
pass
- def getCaptchaTask(self):
+ def getCaptchaTask(self, exclusive):
pass
- def getCaptchaTaskStatus(self):
+ def getCaptchaTaskStatus(self, tid):
pass
def getCollector(self):
pass
@@ -251,23 +251,23 @@ class Iface:
pass
def getConfig(self):
pass
- def getConfigValue(self):
+ def getConfigValue(self, category, option, section):
pass
- def getEvents(self):
+ def getEvents(self, uuid):
pass
- def getFileData(self):
+ def getFileData(self, fid):
pass
- def getFileOrder(self):
+ def getFileOrder(self, pid):
pass
- def getInfoByPlugin(self):
+ def getInfoByPlugin(self, plugin):
pass
- def getLog(self):
+ def getLog(self, offset):
pass
- def getPackageData(self):
+ def getPackageData(self, pid):
pass
- def getPackageInfo(self):
+ def getPackageInfo(self, pid):
pass
- def getPackageOrder(self):
+ def getPackageOrder(self, destination):
pass
def getPluginConfig(self):
pass
@@ -279,9 +279,9 @@ class Iface:
pass
def getServices(self):
pass
- def getUserData(self):
+ def getUserData(self, username, password):
pass
- def hasService(self):
+ def hasService(self, plugin, func):
pass
def isCaptchaWaiting(self):
pass
@@ -291,45 +291,45 @@ class Iface:
pass
def kill(self):
pass
- def login(self):
+ def login(self, username, password):
pass
- def moveFiles(self):
+ def moveFiles(self, fids, pid):
pass
- def movePackage(self):
+ def movePackage(self, destination, pid):
pass
- def orderFile(self):
+ def orderFile(self, fid, position):
pass
- def orderPackage(self):
+ def orderPackage(self, pid, position):
pass
- def parseURLs(self):
+ def parseURLs(self, html, url):
pass
def pauseServer(self):
pass
- def pollResults(self):
+ def pollResults(self, rid):
pass
- def pullFromQueue(self):
+ def pullFromQueue(self, pid):
pass
- def pushToQueue(self):
+ def pushToQueue(self, pid):
pass
- def recheckPackage(self):
+ def recheckPackage(self, pid):
pass
- def removeAccount(self):
+ def removeAccount(self, plugin, account):
pass
def restart(self):
pass
def restartFailed(self):
pass
- def restartFile(self):
+ def restartFile(self, fid):
pass
- def restartPackage(self):
+ def restartPackage(self, pid):
pass
- def setCaptchaResult(self):
+ def setCaptchaResult(self, tid, result):
pass
- def setConfigValue(self):
+ def setConfigValue(self, category, option, value, section):
pass
- def setPackageData(self):
+ def setPackageData(self, pid, data):
pass
- def setPackageName(self):
+ def setPackageName(self, pid, name):
pass
def statusDownloads(self):
pass
@@ -337,7 +337,7 @@ class Iface:
pass
def stopAllDownloads(self):
pass
- def stopDownloads(self):
+ def stopDownloads(self, fids):
pass
def togglePause(self):
pass
@@ -345,8 +345,8 @@ class Iface:
pass
def unpauseServer(self):
pass
- def updateAccount(self):
+ def updateAccount(self, plugin, account, password, options):
pass
- def uploadContainer(self):
+ def uploadContainer(self, filename, data):
pass