Subversion Repositories SmartDukaan

Rev

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

Rev 304 Rev 765
Line 14... Line 14...
14
except:
14
except:
15
  fastbinary = None
15
  fastbinary = None
16
 
16
 
17
 
17
 
18
class Iface:
18
class Iface:
-
 
19
  def closeSession(self, ):
-
 
20
    pass
-
 
21
 
19
  def log(self, messageType, message):
22
  def log(self, messageType, message):
20
    """
23
    """
21
    Parameters:
24
    Parameters:
22
     - messageType
25
     - messageType
23
     - message
26
     - message
Line 30... Line 33...
30
    self._iprot = self._oprot = iprot
33
    self._iprot = self._oprot = iprot
31
    if oprot != None:
34
    if oprot != None:
32
      self._oprot = oprot
35
      self._oprot = oprot
33
    self._seqid = 0
36
    self._seqid = 0
34
 
37
 
-
 
38
  def closeSession(self, ):
-
 
39
    self.send_closeSession()
-
 
40
    self.recv_closeSession()
-
 
41
 
-
 
42
  def send_closeSession(self, ):
-
 
43
    self._oprot.writeMessageBegin('closeSession', TMessageType.CALL, self._seqid)
-
 
44
    args = closeSession_args()
-
 
45
    args.write(self._oprot)
-
 
46
    self._oprot.writeMessageEnd()
-
 
47
    self._oprot.trans.flush()
-
 
48
 
-
 
49
  def recv_closeSession(self, ):
-
 
50
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
51
    if mtype == TMessageType.EXCEPTION:
-
 
52
      x = TApplicationException()
-
 
53
      x.read(self._iprot)
-
 
54
      self._iprot.readMessageEnd()
-
 
55
      raise x
-
 
56
    result = closeSession_result()
-
 
57
    result.read(self._iprot)
-
 
58
    self._iprot.readMessageEnd()
-
 
59
    return
-
 
60
 
35
  def log(self, messageType, message):
61
  def log(self, messageType, message):
36
    """
62
    """
37
    Parameters:
63
    Parameters:
38
     - messageType
64
     - messageType
39
     - message
65
     - message
Line 65... Line 91...
65
 
91
 
66
class Processor(Iface, TProcessor):
92
class Processor(Iface, TProcessor):
67
  def __init__(self, handler):
93
  def __init__(self, handler):
68
    self._handler = handler
94
    self._handler = handler
69
    self._processMap = {}
95
    self._processMap = {}
-
 
96
    self._processMap["closeSession"] = Processor.process_closeSession
70
    self._processMap["log"] = Processor.process_log
97
    self._processMap["log"] = Processor.process_log
71
 
98
 
72
  def process(self, iprot, oprot):
99
  def process(self, iprot, oprot):
73
    (name, type, seqid) = iprot.readMessageBegin()
100
    (name, type, seqid) = iprot.readMessageBegin()
74
    if name not in self._processMap:
101
    if name not in self._processMap:
Line 82... Line 109...
82
      return
109
      return
83
    else:
110
    else:
84
      self._processMap[name](self, seqid, iprot, oprot)
111
      self._processMap[name](self, seqid, iprot, oprot)
85
    return True
112
    return True
86
 
113
 
-
 
114
  def process_closeSession(self, seqid, iprot, oprot):
-
 
115
    args = closeSession_args()
-
 
116
    args.read(iprot)
-
 
117
    iprot.readMessageEnd()
-
 
118
    result = closeSession_result()
-
 
119
    self._handler.closeSession()
-
 
120
    oprot.writeMessageBegin("closeSession", TMessageType.REPLY, seqid)
-
 
121
    result.write(oprot)
-
 
122
    oprot.writeMessageEnd()
-
 
123
    oprot.trans.flush()
-
 
124
 
87
  def process_log(self, seqid, iprot, oprot):
125
  def process_log(self, seqid, iprot, oprot):
88
    args = log_args()
126
    args = log_args()
89
    args.read(iprot)
127
    args.read(iprot)
90
    iprot.readMessageEnd()
128
    iprot.readMessageEnd()
91
    result = log_result()
129
    result = log_result()
Line 96... Line 134...
96
    oprot.trans.flush()
134
    oprot.trans.flush()
97
 
135
 
98
 
136
 
99
# HELPER FUNCTIONS AND STRUCTURES
137
# HELPER FUNCTIONS AND STRUCTURES
100
 
138
 
-
 
139
class closeSession_args:
-
 
140
 
-
 
141
  thrift_spec = (
-
 
142
  )
-
 
143
 
-
 
144
  def read(self, iprot):
-
 
145
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
146
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
147
      return
-
 
148
    iprot.readStructBegin()
-
 
149
    while True:
-
 
150
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
151
      if ftype == TType.STOP:
-
 
152
        break
-
 
153
      else:
-
 
154
        iprot.skip(ftype)
-
 
155
      iprot.readFieldEnd()
-
 
156
    iprot.readStructEnd()
-
 
157
 
-
 
158
  def write(self, oprot):
-
 
159
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
160
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
161
      return
-
 
162
    oprot.writeStructBegin('closeSession_args')
-
 
163
    oprot.writeFieldStop()
-
 
164
    oprot.writeStructEnd()
-
 
165
 
-
 
166
  def __repr__(self):
-
 
167
    L = ['%s=%r' % (key, value)
-
 
168
      for key, value in self.__dict__.iteritems()]
-
 
169
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
170
 
-
 
171
  def __eq__(self, other):
-
 
172
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
173
 
-
 
174
  def __ne__(self, other):
-
 
175
    return not (self == other)
-
 
176
 
-
 
177
class closeSession_result:
-
 
178
 
-
 
179
  thrift_spec = (
-
 
180
  )
-
 
181
 
-
 
182
  def read(self, iprot):
-
 
183
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
184
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
185
      return
-
 
186
    iprot.readStructBegin()
-
 
187
    while True:
-
 
188
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
189
      if ftype == TType.STOP:
-
 
190
        break
-
 
191
      else:
-
 
192
        iprot.skip(ftype)
-
 
193
      iprot.readFieldEnd()
-
 
194
    iprot.readStructEnd()
-
 
195
 
-
 
196
  def write(self, oprot):
-
 
197
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
198
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
199
      return
-
 
200
    oprot.writeStructBegin('closeSession_result')
-
 
201
    oprot.writeFieldStop()
-
 
202
    oprot.writeStructEnd()
-
 
203
 
-
 
204
  def __repr__(self):
-
 
205
    L = ['%s=%r' % (key, value)
-
 
206
      for key, value in self.__dict__.iteritems()]
-
 
207
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
208
 
-
 
209
  def __eq__(self, other):
-
 
210
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
211
 
-
 
212
  def __ne__(self, other):
-
 
213
    return not (self == other)
-
 
214
 
101
class log_args:
215
class log_args:
102
  """
216
  """
103
  Attributes:
217
  Attributes:
104
   - messageType
218
   - messageType
105
   - message
219
   - message