Subversion Repositories SmartDukaan

Rev

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

Rev 4386 Rev 4391
Line 6... Line 6...
6
from shop2020.thriftpy.logistics.ttypes import LogisticsInfo,\
6
from shop2020.thriftpy.logistics.ttypes import LogisticsInfo,\
7
    LogisticsServiceException, DeliveryType
7
    LogisticsServiceException, DeliveryType
8
from shop2020.logistics.service.impl.DataAccessor import get_empty_AWB,\
8
from shop2020.logistics.service.impl.DataAccessor import get_empty_AWB,\
9
    get_shipment_info, initialize, get_logistics_estimation, get_provider,\
9
    get_shipment_info, initialize, get_logistics_estimation, get_provider,\
10
    get_providers, close_session, get_free_awb_count, get_holidays,\
10
    get_providers, close_session, get_free_awb_count, get_holidays,\
11
    is_cod_allowed, get_awb_for_number, is_alive
11
    is_cod_allowed, is_alive
12
from shop2020.logistics.service.impl.Converters import to_t_awbupdate,\
12
from shop2020.logistics.service.impl.Converters import to_t_awbupdate,\
13
    to_t_provider, to_t_awb
13
    to_t_provider, to_t_awb
14
from shop2020.clients.CatalogClient import CatalogClient
14
from shop2020.clients.CatalogClient import CatalogClient
15
from shop2020.config.client.ConfigClient import ConfigClient
15
from shop2020.config.client.ConfigClient import ConfigClient
16
import datetime
16
import datetime
Line 255... Line 255...
255
        try:
255
        try:
256
            return is_cod_allowed(destination_pincode)
256
            return is_cod_allowed(destination_pincode)
257
        finally:
257
        finally:
258
            close_session()
258
            close_session()
259
            
259
            
260
    def getAwbForNumber(self, awbNumber):
-
 
261
        try:
-
 
262
            awbFromDB = get_awb_for_number(awbNumber)
-
 
263
            if awbFromDB:
-
 
264
                return to_t_awb(awbFromDB)
-
 
265
            else:
-
 
266
                raise LogisticsServiceException(101, "No AWB found for the given awb number")
-
 
267
        finally:
-
 
268
            close_session()
-
 
269
        
-
 
270
    def closeSession(self, ):
260
    def closeSession(self, ):
271
        close_session()
261
        close_session()
272
 
262
 
273
    def isAlive(self, ):
263
    def isAlive(self, ):
274
        """
264
        """