summaryrefslogtreecommitdiffstats
path: root/pyload/remote
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-11-22 23:00:43 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-11-22 23:00:43 +0100
commit7a386102e272abf12fc8a03733538421b2711045 (patch)
tree4d1f1ef511bf3e3b3d95f78d35067885deffc01e /pyload/remote
parentfixed and improved last pull request (diff)
downloadpyload-7a386102e272abf12fc8a03733538421b2711045.tar.xz
improved addonManager, new property to expose addon information, new functionality to interact with addons
Diffstat (limited to 'pyload/remote')
-rw-r--r--pyload/remote/apitypes.py18
-rw-r--r--pyload/remote/apitypes_debug.py9
-rw-r--r--pyload/remote/pyload.thrift19
3 files changed, 26 insertions, 20 deletions
diff --git a/pyload/remote/apitypes.py b/pyload/remote/apitypes.py
index 287a5f096..6a7d2f063 100644
--- a/pyload/remote/apitypes.py
+++ b/pyload/remote/apitypes.py
@@ -114,20 +114,22 @@ class AccountInfo(BaseObject):
self.config = config
class AddonInfo(BaseObject):
- __slots__ = ['func_name', 'description', 'value']
+ __slots__ = ['name', 'description', 'value']
- def __init__(self, func_name=None, description=None, value=None):
- self.func_name = func_name
+ def __init__(self, name=None, description=None, value=None):
+ self.name = name
self.description = description
self.value = value
class AddonService(BaseObject):
- __slots__ = ['func_name', 'description', 'arguments', 'media']
+ __slots__ = ['func_name', 'label', 'description', 'arguments', 'pack', 'media']
- def __init__(self, func_name=None, description=None, arguments=None, media=None):
+ def __init__(self, func_name=None, label=None, description=None, arguments=None, pack=None, media=None):
self.func_name = func_name
+ self.label = label
self.description = description
self.arguments = arguments
+ self.pack = pack
self.media = media
class ConfigHolder(BaseObject):
@@ -419,6 +421,8 @@ class Iface(object):
pass
def getAllFiles(self):
pass
+ def getAllInfo(self):
+ pass
def getAllUserData(self):
pass
def getAvailablePlugins(self):
@@ -437,6 +441,8 @@ class Iface(object):
pass
def getFilteredFiles(self, state):
pass
+ def getInfoByPlugin(self, plugin):
+ pass
def getInteractionTasks(self, mode):
pass
def getLog(self, offset):
@@ -457,8 +463,6 @@ class Iface(object):
pass
def getWSAddress(self):
pass
- def hasAddonHandler(self, plugin, func):
- pass
def isInteractionWaiting(self, mode):
pass
def loadConfig(self, name):
diff --git a/pyload/remote/apitypes_debug.py b/pyload/remote/apitypes_debug.py
index 74ea8a6a8..14b0cc98e 100644
--- a/pyload/remote/apitypes_debug.py
+++ b/pyload/remote/apitypes_debug.py
@@ -20,7 +20,7 @@ enums = [
classes = {
'AccountInfo' : [basestring, basestring, int, bool, int, int, int, bool, bool, bool, (list, ConfigItem)],
'AddonInfo' : [basestring, basestring, basestring],
- 'AddonService' : [basestring, basestring, (list, basestring), (None, int)],
+ 'AddonService' : [basestring, basestring, basestring, (list, basestring), bool, int],
'ConfigHolder' : [basestring, basestring, basestring, basestring, (list, ConfigItem), (None, (list, AddonInfo))],
'ConfigInfo' : [basestring, basestring, basestring, basestring, bool, (None, bool)],
'ConfigItem' : [basestring, basestring, basestring, Input, basestring],
@@ -53,8 +53,8 @@ methods = {
'addPackageChild': int,
'addPackageP': int,
'addUser': UserData,
- 'callAddon': None,
- 'callAddonHandler': None,
+ 'callAddon': basestring,
+ 'callAddonHandler': basestring,
'checkContainer': OnlineCheck,
'checkHTML': OnlineCheck,
'checkLinks': OnlineCheck,
@@ -72,6 +72,7 @@ methods = {
'getAccounts': (list, AccountInfo),
'getAddonHandler': (dict, basestring, list),
'getAllFiles': TreeCollection,
+ 'getAllInfo': (dict, basestring, list),
'getAllUserData': (dict, int, UserData),
'getAvailablePlugins': (list, ConfigInfo),
'getConfig': (dict, basestring, ConfigHolder),
@@ -81,6 +82,7 @@ methods = {
'getFileTree': TreeCollection,
'getFilteredFileTree': TreeCollection,
'getFilteredFiles': TreeCollection,
+ 'getInfoByPlugin': (list, AddonInfo),
'getInteractionTasks': (list, InteractionTask),
'getLog': (list, basestring),
'getPackageContent': TreeCollection,
@@ -91,7 +93,6 @@ methods = {
'getServerVersion': basestring,
'getUserData': UserData,
'getWSAddress': basestring,
- 'hasAddonHandler': bool,
'isInteractionWaiting': bool,
'loadConfig': ConfigHolder,
'login': bool,
diff --git a/pyload/remote/pyload.thrift b/pyload/remote/pyload.thrift
index 9bcc2ce89..07782ef42 100644
--- a/pyload/remote/pyload.thrift
+++ b/pyload/remote/pyload.thrift
@@ -226,13 +226,15 @@ struct InteractionTask {
struct AddonService {
1: string func_name,
- 2: string description,
- 3: list<string> arguments,
- 4: optional i16 media,
+ 2: string label,
+ 3: string description,
+ 4: list<string> arguments,
+ 5: bool pack,
+ 6: i16 media,
}
struct AddonInfo {
- 1: string func_name,
+ 1: string name,
2: string description,
3: JSONString value,
}
@@ -511,17 +513,16 @@ service Pyload {
// Addon Methods
///////////////////////
- //map<PluginName, list<AddonInfo>> getAllInfo(),
- //list<AddonInfo> getInfoByPlugin(1: PluginName plugin),
+ map<PluginName, list<AddonInfo>> getAllInfo(),
+ list<AddonInfo> getInfoByPlugin(1: PluginName plugin),
map<PluginName, list<AddonService>> getAddonHandler(),
- bool hasAddonHandler(1: PluginName plugin, 2: string func),
- void callAddon(1: PluginName plugin, 2: string func, 3: list<JSONString> arguments)
+ JSONString callAddon(1: PluginName plugin, 2: string func, 3: list<JSONString> arguments)
throws (1: ServiceDoesNotExists e, 2: ServiceException ex),
// special variant of callAddon that works on the media types, acccepting integer
- void callAddonHandler(1: PluginName plugin, 2: string func, 3: PackageID pid_or_fid)
+ JSONString callAddonHandler(1: PluginName plugin, 2: string func, 3: PackageID pid_or_fid)
throws (1: ServiceDoesNotExists e, 2: ServiceException ex),