Subversion Repositories SmartDukaan

Rev

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

Rev 3044 Rev 3064
Line 110... Line 110...
110
     - fromDate
110
     - fromDate
111
     - toDate
111
     - toDate
112
    """
112
    """
113
    pass
113
    pass
114
 
114
 
-
 
115
  def isCodAllowed(self, destination_pincode):
-
 
116
    """
-
 
117
    Returns true if COD is allowed for this destination pincode
-
 
118
    
-
 
119
    Parameters:
-
 
120
     - destination_pincode
-
 
121
    """
-
 
122
    pass
-
 
123
 
115
 
124
 
116
class Client(Iface):
125
class Client(Iface):
117
  def __init__(self, iprot, oprot=None):
126
  def __init__(self, iprot, oprot=None):
118
    self._iprot = self._oprot = iprot
127
    self._iprot = self._oprot = iprot
119
    if oprot != None:
128
    if oprot != None:
Line 460... Line 469...
460
    self._iprot.readMessageEnd()
469
    self._iprot.readMessageEnd()
461
    if result.success != None:
470
    if result.success != None:
462
      return result.success
471
      return result.success
463
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getHolidays failed: unknown result");
472
    raise TApplicationException(TApplicationException.MISSING_RESULT, "getHolidays failed: unknown result");
464
 
473
 
-
 
474
  def isCodAllowed(self, destination_pincode):
-
 
475
    """
-
 
476
    Returns true if COD is allowed for this destination pincode
-
 
477
    
-
 
478
    Parameters:
-
 
479
     - destination_pincode
-
 
480
    """
-
 
481
    self.send_isCodAllowed(destination_pincode)
-
 
482
    return self.recv_isCodAllowed()
-
 
483
 
-
 
484
  def send_isCodAllowed(self, destination_pincode):
-
 
485
    self._oprot.writeMessageBegin('isCodAllowed', TMessageType.CALL, self._seqid)
-
 
486
    args = isCodAllowed_args()
-
 
487
    args.destination_pincode = destination_pincode
-
 
488
    args.write(self._oprot)
-
 
489
    self._oprot.writeMessageEnd()
-
 
490
    self._oprot.trans.flush()
-
 
491
 
-
 
492
  def recv_isCodAllowed(self, ):
-
 
493
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
-
 
494
    if mtype == TMessageType.EXCEPTION:
-
 
495
      x = TApplicationException()
-
 
496
      x.read(self._iprot)
-
 
497
      self._iprot.readMessageEnd()
-
 
498
      raise x
-
 
499
    result = isCodAllowed_result()
-
 
500
    result.read(self._iprot)
-
 
501
    self._iprot.readMessageEnd()
-
 
502
    if result.success != None:
-
 
503
      return result.success
-
 
504
    raise TApplicationException(TApplicationException.MISSING_RESULT, "isCodAllowed failed: unknown result");
-
 
505
 
465
 
506
 
466
class Processor(Iface, TProcessor):
507
class Processor(Iface, TProcessor):
467
  def __init__(self, handler):
508
  def __init__(self, handler):
468
    self._handler = handler
509
    self._handler = handler
469
    self._processMap = {}
510
    self._processMap = {}
Line 475... Line 516...
475
    self._processMap["getEmptyAWB"] = Processor.process_getEmptyAWB
516
    self._processMap["getEmptyAWB"] = Processor.process_getEmptyAWB
476
    self._processMap["getShipmentInfo"] = Processor.process_getShipmentInfo
517
    self._processMap["getShipmentInfo"] = Processor.process_getShipmentInfo
477
    self._processMap["getDestinationCode"] = Processor.process_getDestinationCode
518
    self._processMap["getDestinationCode"] = Processor.process_getDestinationCode
478
    self._processMap["getFreeAwbCount"] = Processor.process_getFreeAwbCount
519
    self._processMap["getFreeAwbCount"] = Processor.process_getFreeAwbCount
479
    self._processMap["getHolidays"] = Processor.process_getHolidays
520
    self._processMap["getHolidays"] = Processor.process_getHolidays
-
 
521
    self._processMap["isCodAllowed"] = Processor.process_isCodAllowed
480
 
522
 
481
  def process(self, iprot, oprot):
523
  def process(self, iprot, oprot):
482
    (name, type, seqid) = iprot.readMessageBegin()
524
    (name, type, seqid) = iprot.readMessageBegin()
483
    if name not in self._processMap:
525
    if name not in self._processMap:
484
      iprot.skip(TType.STRUCT)
526
      iprot.skip(TType.STRUCT)
Line 622... Line 664...
622
    oprot.writeMessageBegin("getHolidays", TMessageType.REPLY, seqid)
664
    oprot.writeMessageBegin("getHolidays", TMessageType.REPLY, seqid)
623
    result.write(oprot)
665
    result.write(oprot)
624
    oprot.writeMessageEnd()
666
    oprot.writeMessageEnd()
625
    oprot.trans.flush()
667
    oprot.trans.flush()
626
 
668
 
-
 
669
  def process_isCodAllowed(self, seqid, iprot, oprot):
-
 
670
    args = isCodAllowed_args()
-
 
671
    args.read(iprot)
-
 
672
    iprot.readMessageEnd()
-
 
673
    result = isCodAllowed_result()
-
 
674
    result.success = self._handler.isCodAllowed(args.destination_pincode)
-
 
675
    oprot.writeMessageBegin("isCodAllowed", TMessageType.REPLY, seqid)
-
 
676
    result.write(oprot)
-
 
677
    oprot.writeMessageEnd()
-
 
678
    oprot.trans.flush()
-
 
679
 
627
 
680
 
628
# HELPER FUNCTIONS AND STRUCTURES
681
# HELPER FUNCTIONS AND STRUCTURES
629
 
682
 
630
class closeSession_args:
683
class closeSession_args:
631
 
684
 
Line 1864... Line 1917...
1864
      oprot.writeFieldEnd()
1917
      oprot.writeFieldEnd()
1865
    oprot.writeFieldStop()
1918
    oprot.writeFieldStop()
1866
    oprot.writeStructEnd()
1919
    oprot.writeStructEnd()
1867
 
1920
 
1868
  def __repr__(self):
1921
  def __repr__(self):
-
 
1922
    L = ['%s=%r' % (key, value)
-
 
1923
      for key, value in self.__dict__.iteritems()]
-
 
1924
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
1925
 
-
 
1926
  def __eq__(self, other):
-
 
1927
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
1928
 
-
 
1929
  def __ne__(self, other):
-
 
1930
    return not (self == other)
-
 
1931
 
-
 
1932
class isCodAllowed_args:
-
 
1933
  """
-
 
1934
  Attributes:
-
 
1935
   - destination_pincode
-
 
1936
  """
-
 
1937
 
-
 
1938
  thrift_spec = (
-
 
1939
    None, # 0
-
 
1940
    (1, TType.STRING, 'destination_pincode', None, None, ), # 1
-
 
1941
  )
-
 
1942
 
-
 
1943
  def __init__(self, destination_pincode=None,):
-
 
1944
    self.destination_pincode = destination_pincode
-
 
1945
 
-
 
1946
  def read(self, iprot):
-
 
1947
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
1948
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
1949
      return
-
 
1950
    iprot.readStructBegin()
-
 
1951
    while True:
-
 
1952
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
1953
      if ftype == TType.STOP:
-
 
1954
        break
-
 
1955
      if fid == 1:
-
 
1956
        if ftype == TType.STRING:
-
 
1957
          self.destination_pincode = iprot.readString();
-
 
1958
        else:
-
 
1959
          iprot.skip(ftype)
-
 
1960
      else:
-
 
1961
        iprot.skip(ftype)
-
 
1962
      iprot.readFieldEnd()
-
 
1963
    iprot.readStructEnd()
-
 
1964
 
-
 
1965
  def write(self, oprot):
-
 
1966
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
1967
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
1968
      return
-
 
1969
    oprot.writeStructBegin('isCodAllowed_args')
-
 
1970
    if self.destination_pincode != None:
-
 
1971
      oprot.writeFieldBegin('destination_pincode', TType.STRING, 1)
-
 
1972
      oprot.writeString(self.destination_pincode)
-
 
1973
      oprot.writeFieldEnd()
-
 
1974
    oprot.writeFieldStop()
-
 
1975
    oprot.writeStructEnd()
-
 
1976
 
-
 
1977
  def __repr__(self):
-
 
1978
    L = ['%s=%r' % (key, value)
-
 
1979
      for key, value in self.__dict__.iteritems()]
-
 
1980
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
 
1981
 
-
 
1982
  def __eq__(self, other):
-
 
1983
    return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
 
1984
 
-
 
1985
  def __ne__(self, other):
-
 
1986
    return not (self == other)
-
 
1987
 
-
 
1988
class isCodAllowed_result:
-
 
1989
  """
-
 
1990
  Attributes:
-
 
1991
   - success
-
 
1992
  """
-
 
1993
 
-
 
1994
  thrift_spec = (
-
 
1995
    (0, TType.BOOL, 'success', None, None, ), # 0
-
 
1996
  )
-
 
1997
 
-
 
1998
  def __init__(self, success=None,):
-
 
1999
    self.success = success
-
 
2000
 
-
 
2001
  def read(self, iprot):
-
 
2002
    if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
-
 
2003
      fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
-
 
2004
      return
-
 
2005
    iprot.readStructBegin()
-
 
2006
    while True:
-
 
2007
      (fname, ftype, fid) = iprot.readFieldBegin()
-
 
2008
      if ftype == TType.STOP:
-
 
2009
        break
-
 
2010
      if fid == 0:
-
 
2011
        if ftype == TType.BOOL:
-
 
2012
          self.success = iprot.readBool();
-
 
2013
        else:
-
 
2014
          iprot.skip(ftype)
-
 
2015
      else:
-
 
2016
        iprot.skip(ftype)
-
 
2017
      iprot.readFieldEnd()
-
 
2018
    iprot.readStructEnd()
-
 
2019
 
-
 
2020
  def write(self, oprot):
-
 
2021
    if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
-
 
2022
      oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
-
 
2023
      return
-
 
2024
    oprot.writeStructBegin('isCodAllowed_result')
-
 
2025
    if self.success != None:
-
 
2026
      oprot.writeFieldBegin('success', TType.BOOL, 0)
-
 
2027
      oprot.writeBool(self.success)
-
 
2028
      oprot.writeFieldEnd()
-
 
2029
    oprot.writeFieldStop()
-
 
2030
    oprot.writeStructEnd()
-
 
2031
 
-
 
2032
  def __repr__(self):
1869
    L = ['%s=%r' % (key, value)
2033
    L = ['%s=%r' % (key, value)
1870
      for key, value in self.__dict__.iteritems()]
2034
      for key, value in self.__dict__.iteritems()]
1871
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
2035
    return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1872
 
2036
 
1873
  def __eq__(self, other):
2037
  def __eq__(self, other):