Subversion Repositories SmartDukaan

Rev

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

Rev 3218 Rev 3355
Line 12... Line 12...
12
    DeliveryType
12
    DeliveryType
13
from shop2020.utils.Utils import log_entry, to_py_date, to_java_date
13
from shop2020.utils.Utils import log_entry, to_py_date, to_java_date
14
from elixir import session
14
from elixir import session
15
import datetime, time
15
import datetime, time
16
import sys
16
import sys
-
 
17
import logging
-
 
18
logging.basicConfig(level=logging.DEBUG)
17
 
19
 
18
warehouse_allocation_cache = {}
20
warehouse_allocation_cache = {}
19
serviceable_location_cache = {}
21
serviceable_location_cache = {}
20
delivery_estimate_cache = {}
22
delivery_estimate_cache = {}
21
 
23
 
Line 77... Line 79...
77
        print "Unexpected error:", sys.exc_info()[0]
79
        print "Unexpected error:", sys.exc_info()[0]
78
    
80
    
79
    return cod
81
    return cod
80
 
82
 
81
def get_logistics_estimation(destination_pin, item_selling_price, warehouse_location=None, type=DeliveryType.PREPAID):
83
def get_logistics_estimation(destination_pin, item_selling_price, warehouse_location=None, type=DeliveryType.PREPAID):
-
 
84
    logging.info("Getting logistics estimation for pincode:" + destination_pin + " and warehouse location: " + str(warehouse_location))
82
    if warehouse_location is None:
85
    if warehouse_location is None:
83
        try:
86
        try:
84
            warehouse_location = warehouse_allocation_cache[destination_pin]
87
            warehouse_location = warehouse_allocation_cache[destination_pin]
85
        except:
88
        except:
86
            print "Unexpected error:", sys.exc_info()[0]
89
            print "Unexpected error:", sys.exc_info()[0]