Subversion Repositories SmartDukaan

Rev

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

Rev 13025 Rev 13327
Line 374... Line 374...
374
    time.sleep(1)
374
    time.sleep(1)
375
    req = urllib2.Request(url,headers=headers)
375
    req = urllib2.Request(url,headers=headers)
376
    response = urllib2.urlopen(req)
376
    response = urllib2.urlopen(req)
377
    json_input = response.read()
377
    json_input = response.read()
378
    vendorInfo = json.loads(json_input)
378
    vendorInfo = json.loads(json_input)
-
 
379
    print vendorInfo
379
    rank ,otherInventory ,ourInventory, ourOfferPrice, ourSp, iterator, secondLowestSellerSp, secondLowestSellerInventory, \
380
    rank ,otherInventory ,ourInventory, ourOfferPrice, ourSp, iterator, secondLowestSellerSp, secondLowestSellerInventory, \
380
    lowestOfferPrice,  secondLowestSellerOfferPrice = (0,)*10
381
    lowestOfferPrice,  secondLowestSellerOfferPrice = (0,)*10
381
    lowestSellerName , lowestSellerCode, secondLowestSellerName, secondLowestSellerCode=('',)*4
382
    lowestSellerName , lowestSellerCode, secondLowestSellerName, secondLowestSellerCode=('',)*4
382
    for vendor in vendorInfo:
383
    for vendor in vendorInfo:
383
        if iterator == 0:
384
        if iterator == 0:
Line 457... Line 458...
457
    
458
    
458
    for val in itemInfo:
459
    for val in itemInfo:
459
        spm = val.sourcePercentage
460
        spm = val.sourcePercentage
460
        try:
461
        try:
461
            snapdealDetails = fetchDetails(val.supc)
462
            snapdealDetails = fetchDetails(val.supc)
-
 
463
        except Exception as e:
-
 
464
            print "Error while getting supc ",val.supc
462
        except:
465
            print e
463
            exceptionItems.append(val)
466
            exceptionItems.append(val)
464
            continue
467
            continue
465
        mpItem = MarketplaceItems.get_by(itemId=val.item_id,source=OrderSource.SNAPDEAL)
468
        mpItem = MarketplaceItems.get_by(itemId=val.item_id,source=OrderSource.SNAPDEAL)
466
        warehouse = inventory_client.getWarehouse(val.warehouseId)
469
        warehouse = inventory_client.getWarehouse(val.warehouseId)
467
        
470