diff options
| author | 2011-02-10 17:53:25 +0100 | |
|---|---|---|
| committer | 2011-02-10 17:53:25 +0100 | |
| commit | 6750a9481f44c55252d72b3c791f5efbcaeae71c (patch) | |
| tree | 90011b409c2e1f2103c7b505a013600a2ddd9840 /module/remote | |
| parent | captcha trader fix (diff) | |
| download | pyload-6750a9481f44c55252d72b3c791f5efbcaeae71c.tar.xz | |
cleanup
Diffstat (limited to 'module/remote')
| -rw-r--r-- | module/remote/pyload.thrift | 26 | ||||
| -rwxr-xr-x | module/remote/thriftgen/pyload/Pyload-remote | 2 | ||||
| -rw-r--r-- | module/remote/thriftgen/pyload/Pyload.py | 10 | ||||
| -rw-r--r-- | module/remote/thriftgen/pyload/ttypes.py | 78 | 
4 files changed, 19 insertions, 97 deletions
| diff --git a/module/remote/pyload.thrift b/module/remote/pyload.thrift index 413a841d7..4fb054cd1 100644 --- a/module/remote/pyload.thrift +++ b/module/remote/pyload.thrift @@ -28,26 +28,6 @@ enum Destination {    Collector  } -enum CaptchaStatus { -  Init, -  Waiting, -  User, -  SharedUser, -  Done -} - -enum ConfigItemType { -  String, -  Password, -  Choice, -  Bool, -  Integer, -  IP, -  File, -  Folder, -  Time -} -  enum ElementType {    Package,    File @@ -95,7 +75,7 @@ struct ConfigItem {    1: string name,    2: string description,    3: string value, -  4: ConfigItemType type, +  4: string type,    5: optional set<string> choice  } @@ -133,7 +113,7 @@ struct PackageData {  }  struct CaptchaTask { -  1: TaskID tid, +  1: i16 tid,    2: binary data,    3: string type  } @@ -222,7 +202,7 @@ service Pyload {    //captcha    bool isCaptchaWaiting(),    CaptchaTask getCaptchaTask(1: bool exclusive), -  CaptchaStatus getCaptchaTaskStatus(1: TaskID tid), +  string getCaptchaTaskStatus(1: TaskID tid),    void setCaptchaResult(1: TaskID tid, 2: string result),    //events diff --git a/module/remote/thriftgen/pyload/Pyload-remote b/module/remote/thriftgen/pyload/Pyload-remote index 67edb2b71..cd8a1d703 100755 --- a/module/remote/thriftgen/pyload/Pyload-remote +++ b/module/remote/thriftgen/pyload/Pyload-remote @@ -66,7 +66,7 @@ if len(sys.argv) <= 1 or sys.argv[1] == '--help':    print '   getFileOrder(PackageID pid)'    print '  bool isCaptchaWaiting()'    print '  CaptchaTask getCaptchaTask(bool exclusive)' -  print '  CaptchaStatus getCaptchaTaskStatus(TaskID tid)' +  print '  string getCaptchaTaskStatus(TaskID tid)'    print '  void setCaptchaResult(TaskID tid, string result)'    print '   getEvents()'    print '   getAccounts()' diff --git a/module/remote/thriftgen/pyload/Pyload.py b/module/remote/thriftgen/pyload/Pyload.py index b4912a580..032c1baaa 100644 --- a/module/remote/thriftgen/pyload/Pyload.py +++ b/module/remote/thriftgen/pyload/Pyload.py @@ -7344,7 +7344,7 @@ class getCaptchaTaskStatus_result:    """    thrift_spec = ( -    (0, TType.I32, 'success', None, None, ), # 0 +    (0, TType.STRING, 'success', None, None, ), # 0    )    def __init__(self, success=None,): @@ -7360,8 +7360,8 @@ class getCaptchaTaskStatus_result:        if ftype == TType.STOP:          break        if fid == 0: -        if ftype == TType.I32: -          self.success = iprot.readI32(); +        if ftype == TType.STRING: +          self.success = iprot.readString();          else:            iprot.skip(ftype)        else: @@ -7375,8 +7375,8 @@ class getCaptchaTaskStatus_result:        return      oprot.writeStructBegin('getCaptchaTaskStatus_result')      if self.success != None: -      oprot.writeFieldBegin('success', TType.I32, 0) -      oprot.writeI32(self.success) +      oprot.writeFieldBegin('success', TType.STRING, 0) +      oprot.writeString(self.success)        oprot.writeFieldEnd()      oprot.writeFieldStop()      oprot.writeStructEnd() diff --git a/module/remote/thriftgen/pyload/ttypes.py b/module/remote/thriftgen/pyload/ttypes.py index 96d2fd7aa..6c5642e60 100644 --- a/module/remote/thriftgen/pyload/ttypes.py +++ b/module/remote/thriftgen/pyload/ttypes.py @@ -81,64 +81,6 @@ class Destination:      "Collector": 1,    } -class CaptchaStatus: -  Init = 0 -  Waiting = 1 -  User = 2 -  SharedUser = 3 -  Done = 4 - -  _VALUES_TO_NAMES = { -    0: "Init", -    1: "Waiting", -    2: "User", -    3: "SharedUser", -    4: "Done", -  } - -  _NAMES_TO_VALUES = { -    "Init": 0, -    "Waiting": 1, -    "User": 2, -    "SharedUser": 3, -    "Done": 4, -  } - -class ConfigItemType: -  String = 0 -  Password = 1 -  Choice = 2 -  Bool = 3 -  Integer = 4 -  IP = 5 -  File = 6 -  Folder = 7 -  Time = 8 - -  _VALUES_TO_NAMES = { -    0: "String", -    1: "Password", -    2: "Choice", -    3: "Bool", -    4: "Integer", -    5: "IP", -    6: "File", -    7: "Folder", -    8: "Time", -  } - -  _NAMES_TO_VALUES = { -    "String": 0, -    "Password": 1, -    "Choice": 2, -    "Bool": 3, -    "Integer": 4, -    "IP": 5, -    "File": 6, -    "Folder": 7, -    "Time": 8, -  } -  class ElementType:    Package = 0    File = 1 @@ -556,7 +498,7 @@ class ConfigItem:      (1, TType.STRING, 'name', None, None, ), # 1      (2, TType.STRING, 'description', None, None, ), # 2      (3, TType.STRING, 'value', None, None, ), # 3 -    (4, TType.I32, 'type', None, None, ), # 4 +    (4, TType.STRING, 'type', None, None, ), # 4      (5, TType.SET, 'choice', (TType.STRING,None), None, ), # 5    ) @@ -592,8 +534,8 @@ class ConfigItem:          else:            iprot.skip(ftype)        elif fid == 4: -        if ftype == TType.I32: -          self.type = iprot.readI32(); +        if ftype == TType.STRING: +          self.type = iprot.readString();          else:            iprot.skip(ftype)        elif fid == 5: @@ -629,8 +571,8 @@ class ConfigItem:        oprot.writeString(self.value)        oprot.writeFieldEnd()      if self.type != None: -      oprot.writeFieldBegin('type', TType.I32, 4) -      oprot.writeI32(self.type) +      oprot.writeFieldBegin('type', TType.STRING, 4) +      oprot.writeString(self.type)        oprot.writeFieldEnd()      if self.choice != None:        oprot.writeFieldBegin('choice', TType.SET, 5) @@ -1113,7 +1055,7 @@ class CaptchaTask:    thrift_spec = (      None, # 0 -    (1, TType.I32, 'tid', None, None, ), # 1 +    (1, TType.I16, 'tid', None, None, ), # 1      (2, TType.STRING, 'data', None, None, ), # 2      (3, TType.STRING, 'type', None, None, ), # 3    ) @@ -1133,8 +1075,8 @@ class CaptchaTask:        if ftype == TType.STOP:          break        if fid == 1: -        if ftype == TType.I32: -          self.tid = iprot.readI32(); +        if ftype == TType.I16: +          self.tid = iprot.readI16();          else:            iprot.skip(ftype)        elif fid == 2: @@ -1158,8 +1100,8 @@ class CaptchaTask:        return      oprot.writeStructBegin('CaptchaTask')      if self.tid != None: -      oprot.writeFieldBegin('tid', TType.I32, 1) -      oprot.writeI32(self.tid) +      oprot.writeFieldBegin('tid', TType.I16, 1) +      oprot.writeI16(self.tid)        oprot.writeFieldEnd()      if self.data != None:        oprot.writeFieldBegin('data', TType.STRING, 2) | 
