Subversion Repositories SmartDukaan

Rev

Rev 3893 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3893 Rev 3896
Line 17... Line 17...
17
 
17
 
18
 
18
 
19
class Iface(shop2020.thriftpy.generic.GenericService.Iface):
19
class Iface(shop2020.thriftpy.generic.GenericService.Iface):
20
  def pushContentToProduction(self, entityId):
20
  def pushContentToProduction(self, entityId):
21
    """
21
    """
-
 
22
    Push the content of the given entity to production
-
 
23
 
22
    Parameters:
24
    Parameters:
23
     - entityId
25
     - entityId
24
    """
26
    """
25
    pass
27
    pass
26
 
28
 
Line 29... Line 31...
29
  def __init__(self, iprot, oprot=None):
31
  def __init__(self, iprot, oprot=None):
30
    shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)
32
    shop2020.thriftpy.generic.GenericService.Client.__init__(self, iprot, oprot)
31
 
33
 
32
  def pushContentToProduction(self, entityId):
34
  def pushContentToProduction(self, entityId):
33
    """
35
    """
-
 
36
    Push the content of the given entity to production
-
 
37
 
34
    Parameters:
38
    Parameters:
35
     - entityId
39
     - entityId
36
    """
40
    """
37
    self.send_pushContentToProduction(entityId)
41
    self.send_pushContentToProduction(entityId)
38
    self.recv_pushContentToProduction()
42
    return self.recv_pushContentToProduction()
39
 
43
 
40
  def send_pushContentToProduction(self, entityId):
44
  def send_pushContentToProduction(self, entityId):
41
    self._oprot.writeMessageBegin('pushContentToProduction', TMessageType.CALL, self._seqid)
45
    self._oprot.writeMessageBegin('pushContentToProduction', TMessageType.CALL, self._seqid)
42
    args = pushContentToProduction_args()
46
    args = pushContentToProduction_args()
43
    args.entityId = entityId
47
    args.entityId = entityId
Line 53... Line 57...
53
      self._iprot.readMessageEnd()
57
      self._iprot.readMessageEnd()
54
      raise x
58
      raise x
55
    result = pushContentToProduction_result()
59
    result = pushContentToProduction_result()
56
    result.read(self._iprot)
60
    result.read(self._iprot)
57
    self._iprot.readMessageEnd()
61
    self._iprot.readMessageEnd()
-
 
62
    if result.success is not None:
58
    return
63
      return result.success
-
 
64
    if result.cse is not None:
-
 
65
      raise result.cse
-
 
66
    raise TApplicationException(TApplicationException.MISSING_RESULT, "pushContentToProduction failed: unknown result");
59
 
67
 
60
 
68
 
61
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
69
class Processor(shop2020.thriftpy.generic.GenericService.Processor, Iface, TProcessor):
62
  def __init__(self, handler):
70
  def __init__(self, handler):
63
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
71
    shop2020.thriftpy.generic.GenericService.Processor.__init__(self, handler)
Line 81... Line 89...
81
  def process_pushContentToProduction(self, seqid, iprot, oprot):
89
  def process_pushContentToProduction(self, seqid, iprot, oprot):
82
    args = pushContentToProduction_args()
90
    args = pushContentToProduction_args()
83
    args.read(iprot)
91
    args.read(iprot)
84
    iprot.readMessageEnd()
92
    iprot.readMessageEnd()
85
    result = pushContentToProduction_result()
93
    result = pushContentToProduction_result()
-
 
94
    try:
86
    self._handler.pushContentToProduction(args.entityId)
95
      result.success = self._handler.pushContentToProduction(args.entityId)
-
 
96
    except ContentServiceException, cse:
-
 
97
      result.cse = cse
87
    oprot.writeMessageBegin("pushContentToProduction", TMessageType.REPLY, seqid)
98
    oprot.writeMessageBegin("pushContentToProduction", TMessageType.REPLY, seqid)
88
    result.write(oprot)
99
    result.write(oprot)
89
    oprot.writeMessageEnd()
100
    oprot.writeMessageEnd()
90
    oprot.trans.flush()
101
    oprot.trans.flush()
91
 
102
 
Line 151... Line 162...
151
 
162
 
152
  def __ne__(self, other):
163
  def __ne__(self, other):
153
    return not (self == other)
164
    return not (self == other)
154
 
165
 
155
class pushContentToProduction_result:
166
class pushContentToProduction_result:
-
 
167
  """
-
 
168
  Attributes:
-
 
169
   - success
-
 
170
   - cse
-
 
171
  """
156
 
172
 
157
  thrift_spec = (
173
  thrift_spec = (
-
 
174
    (0, TType.BOOL, 'success', None, None, ), # 0
-
 
175
    (1, TType.STRUCT, 'cse', (ContentServiceException, ContentServiceException.thrift_spec), None, ), # 1
158
  )
176
  )
159
 
177
 
-
 
178
  def __init__(self, success=None, cse=None,):
-
 
179
    self.success = success
-
 
180
    self.cse = cse
-
 
181
 
160
  def read(self, iprot):
182
  def read(self, iprot):
161
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
183
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
162
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
184
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
163
      return
185
      return
164
    iprot.readStructBegin()
186
    iprot.readStructBegin()
165
    while True:
187
    while True:
166
      (fname, ftype, fid) = iprot.readFieldBegin()
188
      (fname, ftype, fid) = iprot.readFieldBegin()
167
      if ftype == TType.STOP:
189
      if ftype == TType.STOP:
168
        break
190
        break
-
 
191
      if fid == 0:
-
 
192
        if ftype == TType.BOOL:
-
 
193
          self.success = iprot.readBool();
-
 
194
        else:
-
 
195
          iprot.skip(ftype)
-
 
196
      elif fid == 1:
-
 
197
        if ftype == TType.STRUCT:
-
 
198
          self.cse = ContentServiceException()
-
 
199
          self.cse.read(iprot)
-
 
200
        else:
-
 
201
          iprot.skip(ftype)
169
      else:
202
      else:
170
        iprot.skip(ftype)
203
        iprot.skip(ftype)
171
      iprot.readFieldEnd()
204
      iprot.readFieldEnd()
172
    iprot.readStructEnd()
205
    iprot.readStructEnd()
173
 
206
 
174
  def write(self, oprot):
207
  def write(self, oprot):
175
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
208
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
176
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
209
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
177
      return
210
      return
178
    oprot.writeStructBegin('pushContentToProduction_result')
211
    oprot.writeStructBegin('pushContentToProduction_result')
-
 
212
    if self.success is not None:
-
 
213
      oprot.writeFieldBegin('success', TType.BOOL, 0)
-
 
214
      oprot.writeBool(self.success)
-
 
215
      oprot.writeFieldEnd()
-
 
216
    if self.cse is not None:
-
 
217
      oprot.writeFieldBegin('cse', TType.STRUCT, 1)
-
 
218
      self.cse.write(oprot)
-
 
219
      oprot.writeFieldEnd()
179
    oprot.writeFieldStop()
220
    oprot.writeFieldStop()
180
    oprot.writeStructEnd()
221
    oprot.writeStructEnd()
181
 
222
 
182
  def validate(self):
223
  def validate(self):
183
    return
224
    return