Subversion Repositories SmartDukaan

Rev

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

Rev 14677 Rev 14678
Line 34... Line 34...
34
    This is to map order statuses of our system to order statuses of snapdeal.
34
    This is to map order statuses of our system to order statuses of snapdeal.
35
    And our statuses will change accordingly.
35
    And our statuses will change accordingly.
36
    
36
    
37
    '''
37
    '''
38
    OrderStatusMap = {
38
    OrderStatusMap = {
39
                      MStore.ORDER_PLACED : ['In Progress','N/A', 'Pending For Verification', 'not available'],
39
                      MStore.ORDER_PLACED : ['in progress','n/a', 'pending for verification', 'not available'],
40
                      MStore.ORDER_DELIVERED : ['Delivered'],
40
                      MStore.ORDER_DELIVERED : ['delivered'],
41
                      MStore.ORDER_SHIPPED : ['In Transit'],
41
                      MStore.ORDER_SHIPPED : ['in transit'],
42
                      MStore.ORDER_CANCELLED : ['Closed For Vendor Reallocation', 'Cancelled', 'Product returned by courier', 'Returned']
42
                      MStore.ORDER_CANCELLED : ['closed for vendor reallocation', 'cancelled', 'product returned by courier', 'returned']
43
                      }
43
                      }
44
    
44
    
45
    CONF_CB_AMOUNT = MStore.CONF_CB_DISCOUNTED_PRICE
45
    CONF_CB_AMOUNT = MStore.CONF_CB_DISCOUNTED_PRICE
46
    def __init__(self,store_id):
46
    def __init__(self,store_id):
47
        super(Store, self).__init__(store_id)
47
        super(Store, self).__init__(store_id)
Line 228... Line 228...
228
        #soup = BeautifulSoup(rawHtml,convertEntities=BeautifulSoup.HTML_ENTITIES)
228
        #soup = BeautifulSoup(rawHtml,convertEntities=BeautifulSoup.HTML_ENTITIES)
229
        #soup.find(name, attrs, recursive, text)
229
        #soup.find(name, attrs, recursive, text)
230
 
230
 
231
    def _getStatusFromDetailedStatus(self, detailedStatus):
231
    def _getStatusFromDetailedStatus(self, detailedStatus):
232
        for key, value in Store.OrderStatusMap.iteritems():
232
        for key, value in Store.OrderStatusMap.iteritems():
233
            if detailedStatus in value:
233
            if detailedStatus.lower() in value:
234
                return key
234
                return key
235
        print "Detailed Status need to be mapped", detailedStatus, self.store_id
235
        print "Detailed Status need to be mapped", detailedStatus, self.store_id
236
        raise ParseException("_getStatusFromDetailedStatus", "Found new order status" + detailedStatus)
236
        raise ParseException("_getStatusFromDetailedStatus", "Found new order status" + detailedStatus)
237
    
237
    
238
    
238