| Line 566... |
Line 566... |
| 566 |
def commitPrefButNotCheap(prefButNotCheap,timestamp):
|
566 |
def commitPrefButNotCheap(prefButNotCheap,timestamp):
|
| 567 |
for item in prefButNotCheap:
|
567 |
for item in prefButNotCheap:
|
| 568 |
flipkartDetails = item[0]
|
568 |
flipkartDetails = item[0]
|
| 569 |
flipkartItemInfo = item[1]
|
569 |
flipkartItemInfo = item[1]
|
| 570 |
flipkartPricing = item[2]
|
570 |
flipkartPricing = item[2]
|
| - |
|
571 |
mpItem = item[3]
|
| 571 |
mpHistory = MarketPlaceHistory()
|
572 |
mpHistory = MarketPlaceHistory()
|
| 572 |
mpHistory.item_id = flipkartItemInfo.item_id
|
573 |
mpHistory.item_id = flipkartItemInfo.item_id
|
| 573 |
mpHistory.source = OrderSource.FLIPKART
|
574 |
mpHistory.source = OrderSource.FLIPKART
|
| 574 |
mpHistory.lowestTp = flipkartPricing.lowestTp
|
575 |
mpHistory.lowestTp = flipkartPricing.lowestTp
|
| 575 |
mpHistory.lowestPossibleTp = flipkartPricing.lowestPossibleTp
|
576 |
mpHistory.lowestPossibleTp = flipkartPricing.lowestPossibleTp
|
| Line 599... |
Line 600... |
| 599 |
mpHistory.prefferedSellerTp = flipkartPricing.prefSellerTp
|
600 |
mpHistory.prefferedSellerTp = flipkartPricing.prefSellerTp
|
| 600 |
mpHistory.prefferedSellerShippingTime = ''
|
601 |
mpHistory.prefferedSellerShippingTime = ''
|
| 601 |
mpHistory.prefferedSellerShippingTime= str(flipkartDetails.shippingTimeLowerLimitPrefSeller) if flipkartDetails.shippingTimeUpperLimitPrefSeller==0\
|
602 |
mpHistory.prefferedSellerShippingTime= str(flipkartDetails.shippingTimeLowerLimitPrefSeller) if flipkartDetails.shippingTimeUpperLimitPrefSeller==0\
|
| 602 |
else str(flipkartDetails.shippingTimeLowerLimitPrefSeller)+'-'+str(flipkartDetails.shippingTimeUpperLimitPrefSeller)
|
603 |
else str(flipkartDetails.shippingTimeLowerLimitPrefSeller)+'-'+str(flipkartDetails.shippingTimeUpperLimitPrefSeller)
|
| 603 |
mpHistory.margin = mpHistory.ourTp - mpHistory.lowestPossibleTp
|
604 |
mpHistory.margin = mpHistory.ourTp - mpHistory.lowestPossibleTp
|
| - |
|
605 |
proposed_sp = max(mpHistory.lowestSellingPrice - max((20, mpHistory.lowestSellingPrice*0.002)), mpHistory.lowestPossibleSp)
|
| - |
|
606 |
proposed_tp = getTargetTp(proposed_sp,mpItem)
|
| - |
|
607 |
mpHistory.proposedSellingPrice = proposed_sp
|
| - |
|
608 |
mpHistory.proposedTp = proposed_tp
|
| 604 |
mpHistory.totalSeller = flipkartDetails.totalAvailableSeller
|
609 |
mpHistory.totalSeller = flipkartDetails.totalAvailableSeller
|
| 605 |
mpHistory.avgSales = (itemSaleMap.get(flipkartItemInfo.item_id))[3]
|
610 |
mpHistory.avgSales = (itemSaleMap.get(flipkartItemInfo.item_id))[3]
|
| 606 |
mpHistory.salesPotential = SalesPotential._NAMES_TO_VALUES.get(getSalesPotential(flipkartDetails.lowestSellerSp,flipkartItemInfo.nlc))
|
611 |
mpHistory.salesPotential = SalesPotential._NAMES_TO_VALUES.get(getSalesPotential(flipkartDetails.lowestSellerSp,flipkartItemInfo.nlc))
|
| 607 |
mpHistory.timestamp = timestamp
|
612 |
mpHistory.timestamp = timestamp
|
| 608 |
mpHistory.run = RunType._NAMES_TO_VALUES.get(flipkartItemInfo.runType)
|
613 |
mpHistory.run = RunType._NAMES_TO_VALUES.get(flipkartItemInfo.runType)
|
| Line 1994... |
Line 1999... |
| 1994 |
while(count<3 and endOffset<len(itemInfo)):
|
1999 |
while(count<3 and endOffset<len(itemInfo)):
|
| 1995 |
endOffset = startOffset + 20
|
2000 |
endOffset = startOffset + 20
|
| 1996 |
if (endOffset >= len(itemInfo)):
|
2001 |
if (endOffset >= len(itemInfo)):
|
| 1997 |
endOffset = len(itemInfo)
|
2002 |
endOffset = len(itemInfo)
|
| 1998 |
print "pool offset start end count"+str(startOffset)+" "+str(endOffset)+" "+str(count)
|
2003 |
print "pool offset start end count"+str(startOffset)+" "+str(endOffset)+" "+str(count)
|
| 1999 |
time.sleep(10)
|
- |
|
| 2000 |
pool.map(populateScrapingResults,itemInfo[startOffset:endOffset])
|
2004 |
pool.map(populateScrapingResults,itemInfo[startOffset:endOffset])
|
| 2001 |
#t = Process(target=decideCategory,args=(itemInfo[startOffset:endOffset], scraper))
|
2005 |
#t = Process(target=decideCategory,args=(itemInfo[startOffset:endOffset], scraper))
|
| 2002 |
#t = threading.Thread(target=partial(decideCategory, itemInfo[startOffset:endOffset], scraper))
|
2006 |
#t = threading.Thread(target=partial(decideCategory, itemInfo[startOffset:endOffset], scraper))
|
| 2003 |
#t = threading.Thread(target=partial(test, startOffset, endOffset))
|
2007 |
#t = threading.Thread(target=partial(test, startOffset, endOffset))
|
| 2004 |
#threads.append(t)
|
2008 |
#threads.append(t)
|