| Line 425... |
Line 425... |
| 425 |
scrapInfo = aggResponse.get(val.sku)
|
425 |
scrapInfo = aggResponse.get(val.sku)
|
| 426 |
if scrapInfo is None or len(scrapInfo)==0 or val.nlc==0 or len(ourPricingForSku.get(val.sku).keys())==0:
|
426 |
if scrapInfo is None or len(scrapInfo)==0 or val.nlc==0 or len(ourPricingForSku.get(val.sku).keys())==0:
|
| 427 |
temp = []
|
427 |
temp = []
|
| 428 |
temp.append(val)
|
428 |
temp.append(val)
|
| 429 |
if val.nlc==0 or val.nlc is None:
|
429 |
if val.nlc==0 or val.nlc is None:
|
| - |
|
430 |
print "WANLC is 0"
|
| 430 |
temp.append("WANLC is 0")
|
431 |
temp.append("WANLC is 0")
|
| 431 |
elif ourPricingForSku.get(val.sku) is None or ourPricingForSku.get(val.sku).keys()==0:
|
432 |
elif ourPricingForSku.get(val.sku) is None or ourPricingForSku.get(val.sku).keys()==0:
|
| - |
|
433 |
print "Unable to fetch our price"
|
| 432 |
temp.append("Unable to fetch our price")
|
434 |
temp.append("Unable to fetch our price")
|
| 433 |
else:
|
435 |
else:
|
| - |
|
436 |
print "Unable to fetch competive pricing"
|
| 434 |
temp.append("Unable to fetch competitive pricing")
|
437 |
temp.append("Unable to fetch competitive pricing")
|
| 435 |
exceptionList.append(temp)
|
438 |
exceptionList.append(temp)
|
| 436 |
continue
|
439 |
continue
|
| 437 |
val.asin = ourPricingForSku.get(val.sku).get('asin')
|
440 |
val.asin = ourPricingForSku.get(val.sku).get('asin')
|
| 438 |
val.ourSp = ourPricingForSku.get(val.sku).get('sellingPrice')
|
441 |
val.ourSp = ourPricingForSku.get(val.sku).get('sellingPrice')
|
| Line 448... |
Line 451... |
| 448 |
multipleListings = False
|
451 |
multipleListings = False
|
| 449 |
ourSkuDetails = ourPricingForSku.get(val.sku)
|
452 |
ourSkuDetails = ourPricingForSku.get(val.sku)
|
| 450 |
if not (ourSkuDetails.get('promotion') and (amazonLongTermActivePromotions.has_key(val.sku) or amazonShortTermActivePromotions.has_key(val.sku))):
|
453 |
if not (ourSkuDetails.get('promotion') and (amazonLongTermActivePromotions.has_key(val.sku) or amazonShortTermActivePromotions.has_key(val.sku))):
|
| 451 |
temp = []
|
454 |
temp = []
|
| 452 |
temp.append(val)
|
455 |
temp.append(val)
|
| - |
|
456 |
print "promo misconfigured"
|
| 453 |
temp.append("Promo misconfigured")
|
457 |
temp.append("Promo misconfigured")
|
| 454 |
continue
|
458 |
continue
|
| 455 |
|
459 |
|
| 456 |
scrapInfo.append(ourSkuDetails)
|
460 |
scrapInfo.append(ourSkuDetails)
|
| 457 |
sortedScrapInfo = sorted(scrapInfo, key=itemgetter('promoPrice','notOurSku'))
|
461 |
sortedScrapInfo = sorted(scrapInfo, key=itemgetter('promoPrice','notOurSku'))
|
| Line 1685... |
Line 1689... |
| 1685 |
while (len(itemInfo)>0):
|
1689 |
while (len(itemInfo)>0):
|
| 1686 |
if len(itemInfo) >= 20:
|
1690 |
if len(itemInfo) >= 20:
|
| 1687 |
itemsToPopulate = 20
|
1691 |
itemsToPopulate = 20
|
| 1688 |
else:
|
1692 |
else:
|
| 1689 |
itemsToPopulate = len(itemInfo)
|
1693 |
itemsToPopulate = len(itemInfo)
|
| - |
|
1694 |
print "items to popluate"
|
| 1690 |
print itemsToPopulate
|
1695 |
print itemsToPopulate
|
| 1691 |
exceptionList, negativeMargin, cheapest, amongCheapestAndCanCompete, canCompete, almostCompete, cantCompete = decideCategory(itemInfo[0:itemsToPopulate])
|
1696 |
exceptionList, negativeMargin, cheapest, amongCheapestAndCanCompete, canCompete, almostCompete, cantCompete = decideCategory(itemInfo[0:itemsToPopulate])
|
| 1692 |
itemInfo[0:itemsToPopulate] = []
|
1697 |
itemInfo[0:itemsToPopulate] = []
|
| 1693 |
commitExceptionList(exceptionList,timestamp,options.runType)
|
1698 |
commitExceptionList(exceptionList,timestamp,options.runType)
|
| 1694 |
commitNegativeMargin(negativeMargin,timestamp,options.runType)
|
1699 |
commitNegativeMargin(negativeMargin,timestamp,options.runType)
|