Subversion Repositories SmartDukaan

Rev

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

Rev 12401 Rev 12403
Line 377... Line 377...
377
    return itemInfo
377
    return itemInfo
378
 
378
 
379
def decideCategory(itemInfo):
379
def decideCategory(itemInfo):
380
    exceptionList, negativeMargin, cheapest, amongCheapestAndCanCompete, canCompete, almostCompete, cantCompete = [],[],[],[],[],[],[] 
380
    exceptionList, negativeMargin, cheapest, amongCheapestAndCanCompete, canCompete, almostCompete, cantCompete = [],[],[],[],[],[],[] 
381
    skuUrls = []
381
    skuUrls = []
382
    kshitij = []
-
 
383
    #skuAsinMap = {}
382
    #skuAsinMap = {}
384
    for item in itemInfo:
383
    for item in itemInfo:
385
        if item.asin is None or len(item.asin)==0:
384
        if item.asin is None or len(item.asin)==0:
386
            temp = []
385
            temp = []
387
            temp.append(item)
386
            temp.append(item)
388
            temp.append("Asin not available")
387
            temp.append("Asin not available")
389
            exceptionList.append(temp)
388
            exceptionList.append(temp)
390
            continue
389
            continue
391
        skuUrls.append('http://www.amazon.in/gp/offer-listing/'+item.asin+'/ref=olp_sort_ps')
390
        skuUrls.append('http://www.amazon.in/gp/offer-listing/'+item.asin+'/ref=olp_sort_ps')
392
        kshitij.append(item.asin)
-
 
393
    aggResponse = amScraper.read(skuUrls, True)
391
    aggResponse = amScraper.read(skuUrls, True)
394
    notfetch = list(set(kshitij)-set(aggResponse.keys()))
-
 
395
    print "kshitij"
-
 
396
    print len(notfetch)
-
 
397
    print notfetch 
-
 
398
    
392
 
399
#    for asin, scrapInfo in aggResponse:
-
 
400
#        skuList = skuAsinMap.get(asin)
-
 
401
#        for sku in skuList:
-
 
402
#            amDetails = __AmazonDetails(None, None, None, None, None,secondLowestSellerName, secondLowestSellerSp, thirdLowestSellerName, thirdLowestSellerSp)
-
 
403
#            for info in scrapInfo:
-
 
404
    catalog_client = CatalogClient().get_client()
393
    catalog_client = CatalogClient().get_client()
405
    for val in itemInfo:
394
    for val in itemInfo:
406
        if val.asin is None or len(val.asin)==0:
395
        if val.asin is None or len(val.asin)==0:
407
            continue
396
            continue
408
        scrapInfo = aggResponse.get(val.asin)
397
        scrapInfo = aggResponse.get(val.asin)
Line 554... Line 543...
554
            temp.append(amDetails)
543
            temp.append(amDetails)
555
            temp.append(amPricing)
544
            temp.append(amPricing)
556
            canCompete.append(temp)
545
            canCompete.append(temp)
557
            continue
546
            continue
558
        
547
        
559
        if amDetails.lowestSellerSp(1+.01) >= amPricing.lowestPossibleSp:
548
        if amDetails.lowestSellerSp*(1+.01) >= amPricing.lowestPossibleSp:
560
            temp = []
549
            temp = []
561
            temp.append(val)
550
            temp.append(val)
562
            temp.append(amDetails)
551
            temp.append(amDetails)
563
            temp.append(amPricing)
552
            temp.append(amPricing)
564
            almostCompete.append(temp)
553
            almostCompete.append(temp)