summaryrefslogtreecommitdiffstats
path: root/module/remote
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-10-02 16:50:03 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-10-02 16:50:03 +0200
commiteb034e731f610705c10f4b182772183fdefd8e28 (patch)
treea9e7887df443451bdc133717c225a77a2f0663b8 /module/remote
parentpurged old plugins (diff)
downloadpyload-eb034e731f610705c10f4b182772183fdefd8e28.tar.xz
closed #365, #396, #397
Diffstat (limited to 'module/remote')
-rw-r--r--module/remote/thriftbackend/pyload.thrift3
-rwxr-xr-xmodule/remote/thriftbackend/thriftgen/pyload/Pyload-remote7
-rw-r--r--module/remote/thriftbackend/thriftgen/pyload/Pyload.py67
-rw-r--r--module/remote/thriftbackend/thriftgen/pyload/ttypes.py10
4 files changed, 81 insertions, 6 deletions
diff --git a/module/remote/thriftbackend/pyload.thrift b/module/remote/thriftbackend/pyload.thrift
index 128ba6240..03eb1d4eb 100644
--- a/module/remote/thriftbackend/pyload.thrift
+++ b/module/remote/thriftbackend/pyload.thrift
@@ -130,7 +130,7 @@ struct UserData {
2: string email,
3: i32 role,
4: i32 permission,
- 5: string template
+ 5: string templateName
}
struct AccountInfo {
@@ -276,6 +276,7 @@ service Pyload {
//auth
bool login(1: string username, 2: string password),
UserData getUserData(1: string username, 2:string password),
+ map<string, UserData> getAllUserData(),
//services
diff --git a/module/remote/thriftbackend/thriftgen/pyload/Pyload-remote b/module/remote/thriftbackend/thriftgen/pyload/Pyload-remote
index 0251fbeae..8c3390438 100755
--- a/module/remote/thriftbackend/thriftgen/pyload/Pyload-remote
+++ b/module/remote/thriftbackend/thriftgen/pyload/Pyload-remote
@@ -87,6 +87,7 @@ if len(sys.argv) <= 1 or sys.argv[1] == '--help':
print ' void removeAccount(PluginName plugin, string account)'
print ' bool login(string username, string password)'
print ' UserData getUserData(string username, string password)'
+ print ' getAllUserData()'
print ' getServices()'
print ' bool hasService(PluginName plugin, string func)'
print ' string call(ServiceCall info)'
@@ -526,6 +527,12 @@ elif cmd == 'getUserData':
sys.exit(1)
pp.pprint(client.getUserData(args[0],args[1],))
+elif cmd == 'getAllUserData':
+ if len(args) != 0:
+ print 'getAllUserData requires 0 args'
+ sys.exit(1)
+ pp.pprint(client.getAllUserData())
+
elif cmd == 'getServices':
if len(args) != 0:
print 'getServices requires 0 args'
diff --git a/module/remote/thriftbackend/thriftgen/pyload/Pyload.py b/module/remote/thriftbackend/thriftgen/pyload/Pyload.py
index eef9e38e5..d54cfaedd 100644
--- a/module/remote/thriftbackend/thriftgen/pyload/Pyload.py
+++ b/module/remote/thriftbackend/thriftgen/pyload/Pyload.py
@@ -395,6 +395,9 @@ class Iface(object):
"""
pass
+ def getAllUserData(self, ):
+ pass
+
def getServices(self, ):
pass
@@ -2242,6 +2245,31 @@ class Client(Iface):
return result.success
raise TApplicationException(TApplicationException.MISSING_RESULT, "getUserData failed: unknown result");
+ def getAllUserData(self, ):
+ self.send_getAllUserData()
+ return self.recv_getAllUserData()
+
+ def send_getAllUserData(self, ):
+ self._oprot.writeMessageBegin('getAllUserData', TMessageType.CALL, self._seqid)
+ args = getAllUserData_args()
+ args.write(self._oprot)
+ self._oprot.writeMessageEnd()
+ self._oprot.trans.flush()
+
+ def recv_getAllUserData(self, ):
+ (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(self._iprot)
+ self._iprot.readMessageEnd()
+ raise x
+ result = getAllUserData_result()
+ result.read(self._iprot)
+ self._iprot.readMessageEnd()
+ if result.success is not None:
+ return result.success
+ raise TApplicationException(TApplicationException.MISSING_RESULT, "getAllUserData failed: unknown result");
+
def getServices(self, ):
self.send_getServices()
return self.recv_getServices()
@@ -2457,6 +2485,7 @@ class Processor(Iface, TProcessor):
self._processMap["removeAccount"] = Processor.process_removeAccount
self._processMap["login"] = Processor.process_login
self._processMap["getUserData"] = Processor.process_getUserData
+ self._processMap["getAllUserData"] = Processor.process_getAllUserData
self._processMap["getServices"] = Processor.process_getServices
self._processMap["hasService"] = Processor.process_hasService
self._processMap["call"] = Processor.process_call
@@ -3194,6 +3223,17 @@ class Processor(Iface, TProcessor):
oprot.writeMessageEnd()
oprot.trans.flush()
+ def process_getAllUserData(self, seqid, iprot, oprot):
+ args = getAllUserData_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = getAllUserData_result()
+ result.success = self._handler.getAllUserData()
+ oprot.writeMessageBegin("getAllUserData", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
def process_getServices(self, seqid, iprot, oprot):
args = getServices_args()
args.read(iprot)
@@ -5278,6 +5318,33 @@ class getUserData_result(TBase):
self.success = success
+class getAllUserData_args(TBase):
+
+ __slots__ = [
+ ]
+
+ thrift_spec = (
+ )
+
+
+class getAllUserData_result(TBase):
+ """
+ Attributes:
+ - success
+ """
+
+ __slots__ = [
+ 'success',
+ ]
+
+ thrift_spec = (
+ (0, TType.MAP, 'success', (TType.STRING,None,TType.STRUCT,(UserData, UserData.thrift_spec)), None, ), # 0
+ )
+
+ def __init__(self, success=None,):
+ self.success = success
+
+
class getServices_args(TBase):
__slots__ = [
diff --git a/module/remote/thriftbackend/thriftgen/pyload/ttypes.py b/module/remote/thriftbackend/thriftgen/pyload/ttypes.py
index 78b2acc09..204090577 100644
--- a/module/remote/thriftbackend/thriftgen/pyload/ttypes.py
+++ b/module/remote/thriftbackend/thriftgen/pyload/ttypes.py
@@ -472,7 +472,7 @@ class UserData(TBase):
- email
- role
- permission
- - template
+ - templateName
"""
__slots__ = [
@@ -480,7 +480,7 @@ class UserData(TBase):
'email',
'role',
'permission',
- 'template',
+ 'templateName',
]
thrift_spec = (
@@ -489,15 +489,15 @@ class UserData(TBase):
(2, TType.STRING, 'email', None, None, ), # 2
(3, TType.I32, 'role', None, None, ), # 3
(4, TType.I32, 'permission', None, None, ), # 4
- (5, TType.STRING, 'template', None, None, ), # 5
+ (5, TType.STRING, 'templateName', None, None, ), # 5
)
- def __init__(self, name=None, email=None, role=None, permission=None, template=None,):
+ def __init__(self, name=None, email=None, role=None, permission=None, templateName=None,):
self.name = name
self.email = email
self.role = role
self.permission = permission
- self.template = template
+ self.templateName = templateName
class AccountInfo(TBase):