summaryrefslogtreecommitdiffstats
path: root/module/remote/thriftbackend/thriftgen
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-02-14 14:26:29 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-02-14 14:26:29 +0100
commite811e55a8e8e451c6fc7b723f26a6351f997a14e (patch)
tree026b350bd54b40aa73ec115ff9b83800351e1a8d /module/remote/thriftbackend/thriftgen
parentlittle SO fix (diff)
downloadpyload-e811e55a8e8e451c6fc7b723f26a6351f997a14e.tar.xz
some parts of cli working again
Diffstat (limited to 'module/remote/thriftbackend/thriftgen')
-rw-r--r--module/remote/thriftbackend/thriftgen/pyload/Pyload.py44
-rw-r--r--module/remote/thriftbackend/thriftgen/pyload/ttypes.py124
2 files changed, 164 insertions, 4 deletions
diff --git a/module/remote/thriftbackend/thriftgen/pyload/Pyload.py b/module/remote/thriftbackend/thriftgen/pyload/Pyload.py
index 19e972559..7c2372745 100644
--- a/module/remote/thriftbackend/thriftgen/pyload/Pyload.py
+++ b/module/remote/thriftbackend/thriftgen/pyload/Pyload.py
@@ -843,6 +843,8 @@ class Client(Iface):
self._iprot.readMessageEnd()
if result.success != None:
return result.success
+ if result.e != None:
+ raise result.e
raise TApplicationException(TApplicationException.MISSING_RESULT, "getPackageData failed: unknown result");
def getFileData(self, fid):
@@ -873,6 +875,8 @@ class Client(Iface):
self._iprot.readMessageEnd()
if result.success != None:
return result.success
+ if result.e != None:
+ raise result.e
raise TApplicationException(TApplicationException.MISSING_RESULT, "getFileData failed: unknown result");
def deleteFiles(self, fids):
@@ -2111,7 +2115,10 @@ class Processor(Iface, TProcessor):
args.read(iprot)
iprot.readMessageEnd()
result = getPackageData_result()
- result.success = self._handler.getPackageData(args.pid)
+ try:
+ result.success = self._handler.getPackageData(args.pid)
+ except PackageDoesNotExists, e:
+ result.e = e
oprot.writeMessageBegin("getPackageData", TMessageType.REPLY, seqid)
result.write(oprot)
oprot.writeMessageEnd()
@@ -2122,7 +2129,10 @@ class Processor(Iface, TProcessor):
args.read(iprot)
iprot.readMessageEnd()
result = getFileData_result()
- result.success = self._handler.getFileData(args.fid)
+ try:
+ result.success = self._handler.getFileData(args.fid)
+ except FileDoesNotExists, e:
+ result.e = e
oprot.writeMessageBegin("getFileData", TMessageType.REPLY, seqid)
result.write(oprot)
oprot.writeMessageEnd()
@@ -4501,14 +4511,17 @@ class getPackageData_result:
"""
Attributes:
- success
+ - e
"""
thrift_spec = (
(0, TType.STRUCT, 'success', (PackageData, PackageData.thrift_spec), None, ), # 0
+ (1, TType.STRUCT, 'e', (PackageDoesNotExists, PackageDoesNotExists.thrift_spec), None, ), # 1
)
- def __init__(self, success=None,):
+ def __init__(self, success=None, e=None,):
self.success = success
+ self.e = e
def read(self, iprot):
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
@@ -4525,6 +4538,12 @@ class getPackageData_result:
self.success.read(iprot)
else:
iprot.skip(ftype)
+ elif fid == 1:
+ if ftype == TType.STRUCT:
+ self.e = PackageDoesNotExists()
+ self.e.read(iprot)
+ else:
+ iprot.skip(ftype)
else:
iprot.skip(ftype)
iprot.readFieldEnd()
@@ -4539,6 +4558,10 @@ class getPackageData_result:
oprot.writeFieldBegin('success', TType.STRUCT, 0)
self.success.write(oprot)
oprot.writeFieldEnd()
+ if self.e != None:
+ oprot.writeFieldBegin('e', TType.STRUCT, 1)
+ self.e.write(oprot)
+ oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
def validate(self):
@@ -4619,14 +4642,17 @@ class getFileData_result:
"""
Attributes:
- success
+ - e
"""
thrift_spec = (
(0, TType.STRUCT, 'success', (FileData, FileData.thrift_spec), None, ), # 0
+ (1, TType.STRUCT, 'e', (FileDoesNotExists, FileDoesNotExists.thrift_spec), None, ), # 1
)
- def __init__(self, success=None,):
+ def __init__(self, success=None, e=None,):
self.success = success
+ self.e = e
def read(self, iprot):
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
@@ -4643,6 +4669,12 @@ class getFileData_result:
self.success.read(iprot)
else:
iprot.skip(ftype)
+ elif fid == 1:
+ if ftype == TType.STRUCT:
+ self.e = FileDoesNotExists()
+ self.e.read(iprot)
+ else:
+ iprot.skip(ftype)
else:
iprot.skip(ftype)
iprot.readFieldEnd()
@@ -4657,6 +4689,10 @@ class getFileData_result:
oprot.writeFieldBegin('success', TType.STRUCT, 0)
self.success.write(oprot)
oprot.writeFieldEnd()
+ if self.e != None:
+ oprot.writeFieldBegin('e', TType.STRUCT, 1)
+ self.e.write(oprot)
+ oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
def validate(self):
diff --git a/module/remote/thriftbackend/thriftgen/pyload/ttypes.py b/module/remote/thriftbackend/thriftgen/pyload/ttypes.py
index 10964d127..370858d4e 100644
--- a/module/remote/thriftbackend/thriftgen/pyload/ttypes.py
+++ b/module/remote/thriftbackend/thriftgen/pyload/ttypes.py
@@ -1689,3 +1689,127 @@ class AccountData:
def __ne__(self, other):
return not (self == other)
+
+class PackageDoesNotExists(Exception):
+ """
+ Attributes:
+ - pid
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.I32, 'pid', None, None, ), # 1
+ )
+
+ def __init__(self, pid=None,):
+ self.pid = pid
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.I32:
+ self.pid = iprot.readI32();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('PackageDoesNotExists')
+ if self.pid != None:
+ oprot.writeFieldBegin('pid', TType.I32, 1)
+ oprot.writeI32(self.pid)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __str__(self):
+ return repr(self)
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class FileDoesNotExists(Exception):
+ """
+ Attributes:
+ - fid
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.I32, 'fid', None, None, ), # 1
+ )
+
+ def __init__(self, fid=None,):
+ self.fid = fid
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.I32:
+ self.fid = iprot.readI32();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('FileDoesNotExists')
+ if self.fid != None:
+ oprot.writeFieldBegin('fid', TType.I32, 1)
+ oprot.writeI32(self.fid)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __str__(self):
+ return repr(self)
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)