Subversion Repositories SmartDukaan

Rev

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

Rev 12213 Rev 12214
Line 2109... Line 2109...
2109
        print "Unable to fetch details of %s" %(val.fkSerialNumber)
2109
        print "Unable to fetch details of %s" %(val.fkSerialNumber)
2110
        print e
2110
        print e
2111
        val.flipkartDetails = None
2111
        val.flipkartDetails = None
2112
        return
2112
        return
2113
        
2113
        
2114
#    try:
2114
    try:
2115
#        request_url = "https://api.flipkart.net/sellers/skus/%s/listings"%(str(val.skuAtFlipkart))
2115
        request_url = "https://api.flipkart.net/sellers/skus/%s/listings"%(str(val.skuAtFlipkart))
2116
#        r = requests.get(request_url, auth=('m2z93iskuj81qiid', '0c7ab6a5-98c0-4cdc-8be3-72c591e0add4'))
2116
        r = requests.get(request_url, auth=('m2z93iskuj81qiid', '0c7ab6a5-98c0-4cdc-8be3-72c591e0add4'))
2117
#        print "Inventory info",r.json()
2117
        print "Inventory info",r.json()
2118
#        stock_count = int((r.json()['attributeValues'])['stock_count'])
2118
        stock_count = int((r.json()['attributeValues'])['stock_count'])
2119
#    except:
2119
    except:
2120
#        stock_count = 0
2120
        stock_count = 0
2121
#    finally:
2121
    finally:
2122
#        r={}
2122
        r={}
2123
#    
2123
    
2124
    val.ourFlipkartInventory = 0
2124
    val.ourFlipkartInventory = stock_count
2125
            
2125
            
2126
def threadsToSpawn(runType,itemInfo,itemPopulated):
2126
def threadsToSpawn(runType,itemInfo,itemPopulated):
2127
    if runType == RunType.FAVOURITE:
2127
    if runType == RunType.FAVOURITE:
2128
        count = 0
2128
        count = 0
2129
        pool = ThreadPool(3)
2129
        pool = ThreadPool(3)