Subversion Repositories SmartDukaan

Rev

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

Rev 4010 Rev 4386
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, is_alive
11
    is_cod_allowed, get_awb_for_number, 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
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
17
import math
17
import math
18
import sys
18
import sys
Line 254... Line 254...
254
        """
254
        """
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
            
-
 
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()
259
        
269
        
260
    def closeSession(self, ):
270
    def closeSession(self, ):
261
        close_session()
271
        close_session()
262
 
272
 
263
    def isAlive(self, ):
273
    def isAlive(self, ):