Subversion Repositories SmartDukaan

Rev

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

Rev 3086 Rev 3206
Line 22... Line 22...
22
    """
22
    """
23
    pass
23
    pass
24
 
24
 
25
  def saveUserEmailForSending(self, emailTo, emailFrom, subject, body, source, emailType):
25
  def saveUserEmailForSending(self, emailTo, emailFrom, subject, body, source, emailType):
26
    """
26
    """
27
    Save email details, to be sent later
27
    Save email details, to be sent later; Also returns its identifier.
28
    
28
    
29
    Parameters:
29
    Parameters:
30
     - emailTo
30
     - emailTo
31
     - emailFrom
31
     - emailFrom
32
     - subject
32
     - subject
Line 221... Line 221...
221
    self._iprot.readMessageEnd()
221
    self._iprot.readMessageEnd()
222
    return
222
    return
223
 
223
 
224
  def saveUserEmailForSending(self, emailTo, emailFrom, subject, body, source, emailType):
224
  def saveUserEmailForSending(self, emailTo, emailFrom, subject, body, source, emailType):
225
    """
225
    """
226
    Save email details, to be sent later
226
    Save email details, to be sent later; Also returns its identifier.
227
    
227
    
228
    Parameters:
228
    Parameters:
229
     - emailTo
229
     - emailTo
230
     - emailFrom
230
     - emailFrom
231
     - subject
231
     - subject
232
     - body
232
     - body
233
     - source
233
     - source
234
     - emailType
234
     - emailType
235
    """
235
    """
236
    self.send_saveUserEmailForSending(emailTo, emailFrom, subject, body, source, emailType)
236
    self.send_saveUserEmailForSending(emailTo, emailFrom, subject, body, source, emailType)
237
    self.recv_saveUserEmailForSending()
237
    return self.recv_saveUserEmailForSending()
238
 
238
 
239
  def send_saveUserEmailForSending(self, emailTo, emailFrom, subject, body, source, emailType):
239
  def send_saveUserEmailForSending(self, emailTo, emailFrom, subject, body, source, emailType):
240
    self._oprot.writeMessageBegin('saveUserEmailForSending', TMessageType.CALL, self._seqid)
240
    self._oprot.writeMessageBegin('saveUserEmailForSending', TMessageType.CALL, self._seqid)
241
    args = saveUserEmailForSending_args()
241
    args = saveUserEmailForSending_args()
242
    args.emailTo = emailTo
242
    args.emailTo = emailTo
Line 257... Line 257...
257
      self._iprot.readMessageEnd()
257
      self._iprot.readMessageEnd()
258
      raise x
258
      raise x
259
    result = saveUserEmailForSending_result()
259
    result = saveUserEmailForSending_result()
260
    result.read(self._iprot)
260
    result.read(self._iprot)
261
    self._iprot.readMessageEnd()
261
    self._iprot.readMessageEnd()
-
 
262
    if result.success != None:
-
 
263
      return result.success
262
    if result.se != None:
264
    if result.se != None:
263
      raise result.se
265
      raise result.se
264
    return
-
 
-
 
266
    raise TApplicationException(TApplicationException.MISSING_RESULT, "saveUserEmailForSending failed: unknown result");
265
 
267
 
266
  def getEmailsToBeSent(self, ):
268
  def getEmailsToBeSent(self, ):
267
    """
269
    """
268
    Retreives all the emails pending for dispatch
270
    Retreives all the emails pending for dispatch
269
    """
271
    """
Line 893... Line 895...
893
    args = saveUserEmailForSending_args()
895
    args = saveUserEmailForSending_args()
894
    args.read(iprot)
896
    args.read(iprot)
895
    iprot.readMessageEnd()
897
    iprot.readMessageEnd()
896
    result = saveUserEmailForSending_result()
898
    result = saveUserEmailForSending_result()
897
    try:
899
    try:
898
      self._handler.saveUserEmailForSending(args.emailTo, args.emailFrom, args.subject, args.body, args.source, args.emailType)
900
      result.success = self._handler.saveUserEmailForSending(args.emailTo, args.emailFrom, args.subject, args.body, args.source, args.emailType)
899
    except HelperServiceException, se:
901
    except HelperServiceException, se:
900
      result.se = se
902
      result.se = se
901
    oprot.writeMessageBegin("saveUserEmailForSending", TMessageType.REPLY, seqid)
903
    oprot.writeMessageBegin("saveUserEmailForSending", TMessageType.REPLY, seqid)
902
    result.write(oprot)
904
    result.write(oprot)
903
    oprot.writeMessageEnd()
905
    oprot.writeMessageEnd()
Line 1334... Line 1336...
1334
    return not (self == other)
1336
    return not (self == other)
1335
 
1337
 
1336
class saveUserEmailForSending_result:
1338
class saveUserEmailForSending_result:
1337
  """
1339
  """
1338
  Attributes:
1340
  Attributes:
-
 
1341
   - success
1339
   - se
1342
   - se
1340
  """
1343
  """
1341
 
1344
 
1342
  thrift_spec = (
1345
  thrift_spec = (
1343
    None, # 0
1346
    (0, TType.I64, 'success', None, None, ), # 0
1344
    (1, TType.STRUCT, 'se', (HelperServiceException, HelperServiceException.thrift_spec), None, ), # 1
1347
    (1, TType.STRUCT, 'se', (HelperServiceException, HelperServiceException.thrift_spec), None, ), # 1
1345
  )
1348
  )
1346
 
1349
 
1347
  def __init__(self, se=None,):
1350
  def __init__(self, success=None, se=None,):
-
 
1351
    self.success = success
1348
    self.se = se
1352
    self.se = se
1349
 
1353
 
1350
  def read(self, iprot):
1354
  def read(self, iprot):
1351
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1355
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
1352
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
1356
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
Line 1354... Line 1358...
1354
    iprot.readStructBegin()
1358
    iprot.readStructBegin()
1355
    while True:
1359
    while True:
1356
      (fname, ftype, fid) = iprot.readFieldBegin()
1360
      (fname, ftype, fid) = iprot.readFieldBegin()
1357
      if ftype == TType.STOP:
1361
      if ftype == TType.STOP:
1358
        break
1362
        break
1359
      if fid == 1:
1363
      if fid == 0:
-
 
1364
        if ftype == TType.I64:
-
 
1365
          self.success = iprot.readI64();
-
 
1366
        else:
-
 
1367
          iprot.skip(ftype)
-
 
1368
      elif fid == 1:
1360
        if ftype == TType.STRUCT:
1369
        if ftype == TType.STRUCT:
1361
          self.se = HelperServiceException()
1370
          self.se = HelperServiceException()
1362
          self.se.read(iprot)
1371
          self.se.read(iprot)
1363
        else:
1372
        else:
1364
          iprot.skip(ftype)
1373
          iprot.skip(ftype)
Line 1370... Line 1379...
1370
  def write(self, oprot):
1379
  def write(self, oprot):
1371
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1380
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
1372
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1381
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
1373
      return
1382
      return
1374
    oprot.writeStructBegin('saveUserEmailForSending_result')
1383
    oprot.writeStructBegin('saveUserEmailForSending_result')
-
 
1384
    if self.success != None:
-
 
1385
      oprot.writeFieldBegin('success', TType.I64, 0)
-
 
1386
      oprot.writeI64(self.success)
-
 
1387
      oprot.writeFieldEnd()
1375
    if self.se != None:
1388
    if self.se != None:
1376
      oprot.writeFieldBegin('se', TType.STRUCT, 1)
1389
      oprot.writeFieldBegin('se', TType.STRUCT, 1)
1377
      self.se.write(oprot)
1390
      self.se.write(oprot)
1378
      oprot.writeFieldEnd()
1391
      oprot.writeFieldEnd()
1379
    oprot.writeFieldStop()
1392
    oprot.writeFieldStop()