summaryrefslogtreecommitdiffstats
path: root/module/remote/thriftbackend/thriftgen
diff options
context:
space:
mode:
Diffstat (limited to 'module/remote/thriftbackend/thriftgen')
-rwxr-xr-xmodule/remote/thriftbackend/thriftgen/pyload/Pyload-remote44
-rw-r--r--module/remote/thriftbackend/thriftgen/pyload/Pyload.py364
-rw-r--r--module/remote/thriftbackend/thriftgen/pyload/ttypes.py108
3 files changed, 466 insertions, 50 deletions
diff --git a/module/remote/thriftbackend/thriftgen/pyload/Pyload-remote b/module/remote/thriftbackend/thriftgen/pyload/Pyload-remote
index 55f9a1823..c2c13d8ed 100755
--- a/module/remote/thriftbackend/thriftgen/pyload/Pyload-remote
+++ b/module/remote/thriftbackend/thriftgen/pyload/Pyload-remote
@@ -42,7 +42,7 @@ if len(sys.argv) <= 1 or sys.argv[1] == '--help':
print ' getConfig()'
print ' getPluginConfig()'
print ' ConfigSection configureSection(string section)'
- print ' void setConfigHandler(PluginName plugin, InteractionID iid, ValueString value)'
+ print ' void setConfigHandler(PluginName plugin, InteractionID iid, JSONString value)'
print ' checkURLs(LinkList urls)'
print ' parseURLs(string html, string url)'
print ' OnlineCheck checkOnlineStatus(LinkList urls)'
@@ -89,7 +89,7 @@ if len(sys.argv) <= 1 or sys.argv[1] == '--help':
print ' void orderFiles( fids, PackageID pid, i16 position)'
print ' bool isInteractionWaiting(i16 mode)'
print ' InteractionTask getInteractionTask(i16 mode)'
- print ' void setInteractionResult(InteractionID iid, ValueString result)'
+ print ' void setInteractionResult(InteractionID iid, JSONString result)'
print ' string generateDownloadLink(FileID fid, i16 timeout)'
print ' getNotifications()'
print ' getAddonHandler()'
@@ -100,11 +100,15 @@ if len(sys.argv) <= 1 or sys.argv[1] == '--help':
print ' void updateAccount(PluginName plugin, string account, string password, options)'
print ' void removeAccount(PluginName plugin, string account)'
print ' bool login(string username, string password)'
- print ' UserData getUserData(string username, string password)'
+ print ' UserData getUserData()'
print ' getAllUserData()'
+ print ' UserData addUser(string username, string password)'
+ print ' void updateUserData(UserData data)'
+ print ' void removeUser(UserID uid)'
+ print ' bool setPassword(string username, string old_password, string new_password)'
print ' getServices()'
print ' bool hasService(PluginName plugin, string func)'
- print ' string call(PluginName plugin, string func, string arguments)'
+ print ' string call(PluginName plugin, string func, JSONString arguments)'
print ' getAllInfo()'
print ' getInfoByPlugin(PluginName plugin)'
print ''
@@ -621,10 +625,10 @@ elif cmd == 'login':
pp.pprint(client.login(args[0],args[1],))
elif cmd == 'getUserData':
- if len(args) != 2:
- print 'getUserData requires 2 args'
+ if len(args) != 0:
+ print 'getUserData requires 0 args'
sys.exit(1)
- pp.pprint(client.getUserData(args[0],args[1],))
+ pp.pprint(client.getUserData())
elif cmd == 'getAllUserData':
if len(args) != 0:
@@ -632,6 +636,30 @@ elif cmd == 'getAllUserData':
sys.exit(1)
pp.pprint(client.getAllUserData())
+elif cmd == 'addUser':
+ if len(args) != 2:
+ print 'addUser requires 2 args'
+ sys.exit(1)
+ pp.pprint(client.addUser(args[0],args[1],))
+
+elif cmd == 'updateUserData':
+ if len(args) != 1:
+ print 'updateUserData requires 1 args'
+ sys.exit(1)
+ pp.pprint(client.updateUserData(eval(args[0]),))
+
+elif cmd == 'removeUser':
+ if len(args) != 1:
+ print 'removeUser requires 1 args'
+ sys.exit(1)
+ pp.pprint(client.removeUser(eval(args[0]),))
+
+elif cmd == 'setPassword':
+ if len(args) != 3:
+ print 'setPassword requires 3 args'
+ sys.exit(1)
+ pp.pprint(client.setPassword(args[0],args[1],args[2],))
+
elif cmd == 'getServices':
if len(args) != 0:
print 'getServices requires 0 args'
@@ -648,7 +676,7 @@ elif cmd == 'call':
if len(args) != 3:
print 'call requires 3 args'
sys.exit(1)
- pp.pprint(client.call(eval(args[0]),args[1],args[2],))
+ pp.pprint(client.call(eval(args[0]),args[1],eval(args[2]),))
elif cmd == 'getAllInfo':
if len(args) != 0:
diff --git a/module/remote/thriftbackend/thriftgen/pyload/Pyload.py b/module/remote/thriftbackend/thriftgen/pyload/Pyload.py
index 51c8621ba..c45663d25 100644
--- a/module/remote/thriftbackend/thriftgen/pyload/Pyload.py
+++ b/module/remote/thriftbackend/thriftgen/pyload/Pyload.py
@@ -9,7 +9,7 @@
from thrift.Thrift import TType, TMessageType, TException
from ttypes import *
from thrift.Thrift import TProcessor
-from thrift.protocol.TBase import TBase, TExceptionBase
+from thrift.protocol.TBase import TBase, TExceptionBase, TApplicationException
class Iface(object):
@@ -508,7 +508,13 @@ class Iface(object):
"""
pass
- def getUserData(self, username, password):
+ def getUserData(self, ):
+ pass
+
+ def getAllUserData(self, ):
+ pass
+
+ def addUser(self, username, password):
"""
Parameters:
- username
@@ -516,7 +522,27 @@ class Iface(object):
"""
pass
- def getAllUserData(self, ):
+ def updateUserData(self, data):
+ """
+ Parameters:
+ - data
+ """
+ pass
+
+ def removeUser(self, uid):
+ """
+ Parameters:
+ - uid
+ """
+ pass
+
+ def setPassword(self, username, old_password, new_password):
+ """
+ Parameters:
+ - username
+ - old_password
+ - new_password
+ """
pass
def getServices(self, ):
@@ -2808,20 +2834,13 @@ class Client(Iface):
return result.success
raise TApplicationException(TApplicationException.MISSING_RESULT, "login failed: unknown result");
- def getUserData(self, username, password):
- """
- Parameters:
- - username
- - password
- """
- self.send_getUserData(username, password)
+ def getUserData(self, ):
+ self.send_getUserData()
return self.recv_getUserData()
- def send_getUserData(self, username, password):
+ def send_getUserData(self, ):
self._oprot.writeMessageBegin('getUserData', TMessageType.CALL, self._seqid)
args = getUserData_args()
- args.username = username
- args.password = password
args.write(self._oprot)
self._oprot.writeMessageEnd()
self._oprot.trans.flush()
@@ -2838,8 +2857,6 @@ class Client(Iface):
self._iprot.readMessageEnd()
if result.success is not None:
return result.success
- if result.ex is not None:
- raise result.ex
raise TApplicationException(TApplicationException.MISSING_RESULT, "getUserData failed: unknown result");
def getAllUserData(self, ):
@@ -2867,6 +2884,128 @@ class Client(Iface):
return result.success
raise TApplicationException(TApplicationException.MISSING_RESULT, "getAllUserData failed: unknown result");
+ def addUser(self, username, password):
+ """
+ Parameters:
+ - username
+ - password
+ """
+ self.send_addUser(username, password)
+ return self.recv_addUser()
+
+ def send_addUser(self, username, password):
+ self._oprot.writeMessageBegin('addUser', TMessageType.CALL, self._seqid)
+ args = addUser_args()
+ args.username = username
+ args.password = password
+ args.write(self._oprot)
+ self._oprot.writeMessageEnd()
+ self._oprot.trans.flush()
+
+ def recv_addUser(self, ):
+ (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(self._iprot)
+ self._iprot.readMessageEnd()
+ raise x
+ result = addUser_result()
+ result.read(self._iprot)
+ self._iprot.readMessageEnd()
+ if result.success is not None:
+ return result.success
+ raise TApplicationException(TApplicationException.MISSING_RESULT, "addUser failed: unknown result");
+
+ def updateUserData(self, data):
+ """
+ Parameters:
+ - data
+ """
+ self.send_updateUserData(data)
+ self.recv_updateUserData()
+
+ def send_updateUserData(self, data):
+ self._oprot.writeMessageBegin('updateUserData', TMessageType.CALL, self._seqid)
+ args = updateUserData_args()
+ args.data = data
+ args.write(self._oprot)
+ self._oprot.writeMessageEnd()
+ self._oprot.trans.flush()
+
+ def recv_updateUserData(self, ):
+ (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(self._iprot)
+ self._iprot.readMessageEnd()
+ raise x
+ result = updateUserData_result()
+ result.read(self._iprot)
+ self._iprot.readMessageEnd()
+ return
+
+ def removeUser(self, uid):
+ """
+ Parameters:
+ - uid
+ """
+ self.send_removeUser(uid)
+ self.recv_removeUser()
+
+ def send_removeUser(self, uid):
+ self._oprot.writeMessageBegin('removeUser', TMessageType.CALL, self._seqid)
+ args = removeUser_args()
+ args.uid = uid
+ args.write(self._oprot)
+ self._oprot.writeMessageEnd()
+ self._oprot.trans.flush()
+
+ def recv_removeUser(self, ):
+ (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(self._iprot)
+ self._iprot.readMessageEnd()
+ raise x
+ result = removeUser_result()
+ result.read(self._iprot)
+ self._iprot.readMessageEnd()
+ return
+
+ def setPassword(self, username, old_password, new_password):
+ """
+ Parameters:
+ - username
+ - old_password
+ - new_password
+ """
+ self.send_setPassword(username, old_password, new_password)
+ return self.recv_setPassword()
+
+ def send_setPassword(self, username, old_password, new_password):
+ self._oprot.writeMessageBegin('setPassword', TMessageType.CALL, self._seqid)
+ args = setPassword_args()
+ args.username = username
+ args.old_password = old_password
+ args.new_password = new_password
+ args.write(self._oprot)
+ self._oprot.writeMessageEnd()
+ self._oprot.trans.flush()
+
+ def recv_setPassword(self, ):
+ (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(self._iprot)
+ self._iprot.readMessageEnd()
+ raise x
+ result = setPassword_result()
+ result.read(self._iprot)
+ self._iprot.readMessageEnd()
+ if result.success is not None:
+ return result.success
+ raise TApplicationException(TApplicationException.MISSING_RESULT, "setPassword failed: unknown result");
+
def getServices(self, ):
self.send_getServices()
return self.recv_getServices()
@@ -3101,6 +3240,10 @@ class Processor(Iface, TProcessor):
self._processMap["login"] = Processor.process_login
self._processMap["getUserData"] = Processor.process_getUserData
self._processMap["getAllUserData"] = Processor.process_getAllUserData
+ self._processMap["addUser"] = Processor.process_addUser
+ self._processMap["updateUserData"] = Processor.process_updateUserData
+ self._processMap["removeUser"] = Processor.process_removeUser
+ self._processMap["setPassword"] = Processor.process_setPassword
self._processMap["getServices"] = Processor.process_getServices
self._processMap["hasService"] = Processor.process_hasService
self._processMap["call"] = Processor.process_call
@@ -4001,10 +4144,7 @@ class Processor(Iface, TProcessor):
args.read(iprot)
iprot.readMessageEnd()
result = getUserData_result()
- try:
- result.success = self._handler.getUserData(args.username, args.password)
- except UserDoesNotExists, ex:
- result.ex = ex
+ result.success = self._handler.getUserData()
oprot.writeMessageBegin("getUserData", TMessageType.REPLY, seqid)
result.write(oprot)
oprot.writeMessageEnd()
@@ -4021,6 +4161,50 @@ class Processor(Iface, TProcessor):
oprot.writeMessageEnd()
oprot.trans.flush()
+ def process_addUser(self, seqid, iprot, oprot):
+ args = addUser_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = addUser_result()
+ result.success = self._handler.addUser(args.username, args.password)
+ oprot.writeMessageBegin("addUser", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_updateUserData(self, seqid, iprot, oprot):
+ args = updateUserData_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = updateUserData_result()
+ self._handler.updateUserData(args.data)
+ oprot.writeMessageBegin("updateUserData", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_removeUser(self, seqid, iprot, oprot):
+ args = removeUser_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = removeUser_result()
+ self._handler.removeUser(args.uid)
+ oprot.writeMessageBegin("removeUser", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_setPassword(self, seqid, iprot, oprot):
+ args = setPassword_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = setPassword_result()
+ result.success = self._handler.setPassword(args.username, args.old_password, args.new_password)
+ oprot.writeMessageBegin("setPassword", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
def process_getServices(self, seqid, iprot, oprot):
args = getServices_args()
args.read(iprot)
@@ -6695,6 +6879,60 @@ class login_result(TBase):
class getUserData_args(TBase):
+
+ __slots__ = [
+ ]
+
+ thrift_spec = (
+ )
+
+
+class getUserData_result(TBase):
+ """
+ Attributes:
+ - success
+ """
+
+ __slots__ = [
+ 'success',
+ ]
+
+ thrift_spec = (
+ (0, TType.STRUCT, 'success', (UserData, UserData.thrift_spec), None, ), # 0
+ )
+
+ def __init__(self, success=None,):
+ 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.I32,None,TType.STRUCT,(UserData, UserData.thrift_spec)), None, ), # 0
+ )
+
+ def __init__(self, success=None,):
+ self.success = success
+
+
+class addUser_args(TBase):
"""
Attributes:
- username
@@ -6717,38 +6955,108 @@ class getUserData_args(TBase):
self.password = password
-class getUserData_result(TBase):
+class addUser_result(TBase):
"""
Attributes:
- success
- - ex
"""
__slots__ = [
'success',
- 'ex',
]
thrift_spec = (
(0, TType.STRUCT, 'success', (UserData, UserData.thrift_spec), None, ), # 0
- (1, TType.STRUCT, 'ex', (UserDoesNotExists, UserDoesNotExists.thrift_spec), None, ), # 1
)
- def __init__(self, success=None, ex=None,):
+ def __init__(self, success=None,):
self.success = success
- self.ex = ex
-class getAllUserData_args(TBase):
+class updateUserData_args(TBase):
+ """
+ Attributes:
+ - data
+ """
__slots__ = [
+ 'data',
]
thrift_spec = (
+ None, # 0
+ (1, TType.STRUCT, 'data', (UserData, UserData.thrift_spec), None, ), # 1
)
+ def __init__(self, data=None,):
+ self.data = data
+
-class getAllUserData_result(TBase):
+class updateUserData_result(TBase):
+
+ __slots__ = [
+ ]
+
+ thrift_spec = (
+ )
+
+
+class removeUser_args(TBase):
+ """
+ Attributes:
+ - uid
+ """
+
+ __slots__ = [
+ 'uid',
+ ]
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.I32, 'uid', None, None, ), # 1
+ )
+
+ def __init__(self, uid=None,):
+ self.uid = uid
+
+
+class removeUser_result(TBase):
+
+ __slots__ = [
+ ]
+
+ thrift_spec = (
+ )
+
+
+class setPassword_args(TBase):
+ """
+ Attributes:
+ - username
+ - old_password
+ - new_password
+ """
+
+ __slots__ = [
+ 'username',
+ 'old_password',
+ 'new_password',
+ ]
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRING, 'username', None, None, ), # 1
+ (2, TType.STRING, 'old_password', None, None, ), # 2
+ (3, TType.STRING, 'new_password', None, None, ), # 3
+ )
+
+ def __init__(self, username=None, old_password=None, new_password=None,):
+ self.username = username
+ self.old_password = old_password
+ self.new_password = new_password
+
+
+class setPassword_result(TBase):
"""
Attributes:
- success
@@ -6759,7 +7067,7 @@ class getAllUserData_result(TBase):
]
thrift_spec = (
- (0, TType.MAP, 'success', (TType.STRING,None,TType.STRUCT,(UserData, UserData.thrift_spec)), None, ), # 0
+ (0, TType.BOOL, 'success', None, None, ), # 0
)
def __init__(self, success=None,):
diff --git a/module/remote/thriftbackend/thriftgen/pyload/ttypes.py b/module/remote/thriftbackend/thriftgen/pyload/ttypes.py
index fbbc599a8..c177a9dd2 100644
--- a/module/remote/thriftbackend/thriftgen/pyload/ttypes.py
+++ b/module/remote/thriftbackend/thriftgen/pyload/ttypes.py
@@ -191,6 +191,58 @@ class Output(TBase):
"Query": 4,
}
+class Permission(TBase):
+ All = 0
+ Add = 1
+ Delete = 2
+ Status = 4
+ List = 16
+ Modify = 32
+ Download = 64
+ Accounts = 128
+ Interaction = 256
+ Addons = 512
+
+ _VALUES_TO_NAMES = {
+ 0: "All",
+ 1: "Add",
+ 2: "Delete",
+ 4: "Status",
+ 16: "List",
+ 32: "Modify",
+ 64: "Download",
+ 128: "Accounts",
+ 256: "Interaction",
+ 512: "Addons",
+ }
+
+ _NAMES_TO_VALUES = {
+ "All": 0,
+ "Add": 1,
+ "Delete": 2,
+ "Status": 4,
+ "List": 16,
+ "Modify": 32,
+ "Download": 64,
+ "Accounts": 128,
+ "Interaction": 256,
+ "Addons": 512,
+ }
+
+class Role(TBase):
+ Admin = 0
+ User = 1
+
+ _VALUES_TO_NAMES = {
+ 0: "Admin",
+ 1: "User",
+ }
+
+ _NAMES_TO_VALUES = {
+ "Admin": 0,
+ "User": 1,
+ }
+
class ProgressInfo(TBase):
"""
@@ -750,35 +802,55 @@ class EventInfo(TBase):
class UserData(TBase):
"""
Attributes:
+ - uid
- name
- email
- role
- permission
+ - folder
+ - traffic
+ - limit
+ - user
- templateName
"""
__slots__ = [
+ 'uid',
'name',
'email',
'role',
'permission',
+ 'folder',
+ 'traffic',
+ 'limit',
+ 'user',
'templateName',
]
thrift_spec = (
None, # 0
- (1, TType.STRING, 'name', None, None, ), # 1
- (2, TType.STRING, 'email', None, None, ), # 2
- (3, TType.I32, 'role', None, None, ), # 3
- (4, TType.I32, 'permission', None, None, ), # 4
- (5, TType.STRING, 'templateName', None, None, ), # 5
+ (1, TType.I32, 'uid', None, None, ), # 1
+ (2, TType.STRING, 'name', None, None, ), # 2
+ (3, TType.STRING, 'email', None, None, ), # 3
+ (4, TType.I16, 'role', None, None, ), # 4
+ (5, TType.I16, 'permission', None, None, ), # 5
+ (6, TType.STRING, 'folder', None, None, ), # 6
+ (7, TType.I64, 'traffic', None, None, ), # 7
+ (8, TType.I16, 'limit', None, None, ), # 8
+ (9, TType.I32, 'user', None, None, ), # 9
+ (10, TType.STRING, 'templateName', None, None, ), # 10
)
- def __init__(self, name=None, email=None, role=None, permission=None, templateName=None,):
+ def __init__(self, uid=None, name=None, email=None, role=None, permission=None, folder=None, traffic=None, limit=None, user=None, templateName=None,):
+ self.uid = uid
self.name = name
self.email = email
self.role = role
self.permission = permission
+ self.folder = folder
+ self.traffic = traffic
+ self.limit = limit
+ self.user = user
self.templateName = templateName
@@ -787,24 +859,28 @@ class AccountInfo(TBase):
Attributes:
- plugin
- loginname
+ - owner
- valid
- validuntil
- trafficleft
- maxtraffic
- premium
- activated
+ - shared
- options
"""
__slots__ = [
'plugin',
'loginname',
+ 'owner',
'valid',
'validuntil',
'trafficleft',
'maxtraffic',
'premium',
'activated',
+ 'shared',
'options',
]
@@ -812,24 +888,28 @@ class AccountInfo(TBase):
None, # 0
(1, TType.STRING, 'plugin', None, None, ), # 1
(2, TType.STRING, 'loginname', None, None, ), # 2
- (3, TType.BOOL, 'valid', None, None, ), # 3
- (4, TType.I64, 'validuntil', None, None, ), # 4
- (5, TType.I64, 'trafficleft', None, None, ), # 5
- (6, TType.I64, 'maxtraffic', None, None, ), # 6
- (7, TType.BOOL, 'premium', None, None, ), # 7
- (8, TType.BOOL, 'activated', None, None, ), # 8
- (9, TType.MAP, 'options', (TType.STRING,None,TType.STRING,None), None, ), # 9
+ (3, TType.I32, 'owner', None, None, ), # 3
+ (4, TType.BOOL, 'valid', None, None, ), # 4
+ (5, TType.I64, 'validuntil', None, None, ), # 5
+ (6, TType.I64, 'trafficleft', None, None, ), # 6
+ (7, TType.I64, 'maxtraffic', None, None, ), # 7
+ (8, TType.BOOL, 'premium', None, None, ), # 8
+ (9, TType.BOOL, 'activated', None, None, ), # 9
+ (10, TType.BOOL, 'shared', None, None, ), # 10
+ (11, TType.MAP, 'options', (TType.STRING,None,TType.STRING,None), None, ), # 11
)
- def __init__(self, plugin=None, loginname=None, valid=None, validuntil=None, trafficleft=None, maxtraffic=None, premium=None, activated=None, options=None,):
+ def __init__(self, plugin=None, loginname=None, owner=None, valid=None, validuntil=None, trafficleft=None, maxtraffic=None, premium=None, activated=None, shared=None, options=None,):
self.plugin = plugin
self.loginname = loginname
+ self.owner = owner
self.valid = valid
self.validuntil = validuntil
self.trafficleft = trafficleft
self.maxtraffic = maxtraffic
self.premium = premium
self.activated = activated
+ self.shared = shared
self.options = options