Subversion Repositories SmartDukaan

Rev

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

Rev 14431 Rev 14577
Line 39... Line 39...
39
    if source_id == 1:
39
    if source_id == 1:
40
        try:
40
        try:
41
            if data['identifier'] is None or len(data['identifier'].strip())==0:
41
            if data['identifier'] is None or len(data['identifier'].strip())==0:
42
                return {}
42
                return {}
43
            
43
            
-
 
44
            if data['dealFlag'] ==1 and data['dealType'] ==1:
-
 
45
                data['marketPlaceUrl'] = "http://www.amazon.in/dp/%s"%(data['identifier'].strip())
-
 
46
            
44
            try:
47
            try:
45
                if data['priceUpdatedOn'] > to_java_date(now - timedelta(minutes=5)):
48
                if data['priceUpdatedOn'] > to_java_date(now - timedelta(minutes=5)):
46
                    print "sku id is already updated",data['_id'] 
49
                    print "sku id is already updated",data['_id'] 
47
                    return {'_id':data['_id'],'available_price':data['available_price'],'in_stock':data['in_stock'],'source_id':1,'source_product_name':data['source_product_name'],'marketPlaceUrl':data['marketPlaceUrl'],'thumbnail':data['thumbnail']}
50
                    return {'_id':data['_id'],'available_price':data['available_price'],'in_stock':data['in_stock'],'source_id':1,'source_product_name':data['source_product_name'],'marketPlaceUrl':data['marketPlaceUrl'],'thumbnail':data['thumbnail']}
48
            except:
51
            except:
Line 304... Line 307...
304
        print "Unable to compute deal for ",item[0]['skuBundleId']
307
        print "Unable to compute deal for ",item[0]['skuBundleId']
305
    return info
308
    return info
306
 
309
 
307
 
310
 
308
def main():
311
def main():
309
    print getLatestPriceById(4674)
312
    print "retuned %s"%(str(getLatestPrice(17, 2)))
310
 
313
 
311
if __name__=='__main__':
314
if __name__=='__main__':
312
    main()
315
    main()
313
    
316