Subversion Repositories SmartDukaan

Rev

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

Rev 16509 Rev 16869
Line 20... Line 20...
20
(options, args) = parser.parse_args()
20
(options, args) = parser.parse_args()
21
 
21
 
22
mc = MemCache(options.mongoHost)
22
mc = MemCache(options.mongoHost)
23
 
23
 
24
 
24
 
25
SOURCE_MAP = {'AMAZON':1,'FLIPKART':2,'SNAPDEAL':3,'SAHOLIC':4, 'SHOPCLUES.COM':5}
25
SOURCE_MAP = {'AMAZON':1,'FLIPKART':2,'SNAPDEAL':3,'SAHOLIC':4, 'SHOPCLUES.COM':5,'PAYTM.COM':6}
26
 
26
 
27
def get_mongo_connection(host=options.mongoHost, port=27017):
27
def get_mongo_connection(host=options.mongoHost, port=27017):
28
    global con
28
    global con
29
    if con is None:
29
    if con is None:
30
        print "Establishing connection %s host and port %d" %(host,port)
30
        print "Establishing connection %s host and port %d" %(host,port)
Line 201... Line 201...
201
                get_mongo_connection().Catalog.Deals.update({ '_id' : similarItem['_id'] }, {'$set':{'showDeal':0, 'prepaidDeal':0 }})
201
                get_mongo_connection().Catalog.Deals.update({ '_id' : similarItem['_id'] }, {'$set':{'showDeal':0, 'prepaidDeal':0 }})
202
                continue
202
                continue
203
            if similarItem['source_id'] == SOURCE_MAP.get('SHOPCLUES.COM') and similarItem['rank']==0:
203
            if similarItem['source_id'] == SOURCE_MAP.get('SHOPCLUES.COM') and similarItem['rank']==0:
204
                get_mongo_connection().Catalog.Deals.update({ '_id' : similarItem['_id'] }, {'$set':{'showDeal':0,'prepaidDeal':0 }})
204
                get_mongo_connection().Catalog.Deals.update({ '_id' : similarItem['_id'] }, {'$set':{'showDeal':0,'prepaidDeal':0 }})
205
                continue
205
                continue
-
 
206
            if similarItem['source_id'] == SOURCE_MAP.get('PAYTM.COM'):
-
 
207
                similarItem['available_price'] = similarItem['gross_price']
206
            if similarItem['available_price'] < prepaidBestPrice:
208
            if similarItem['available_price'] < prepaidBestPrice:
207
                prepaidBestOne = similarItem
209
                prepaidBestOne = similarItem
208
                prepaidBestPrice = similarItem['available_price']
210
                prepaidBestPrice = similarItem['available_price']
209
                prepaidBestSellerPoints = similarItem['bestSellerPoints']
211
                prepaidBestSellerPoints = similarItem['bestSellerPoints']
210
            elif similarItem['available_price'] == prepaidBestPrice and prepaidBestSellerPoints < similarItem['bestSellerPoints']:
212
            elif similarItem['available_price'] == prepaidBestPrice and prepaidBestSellerPoints < similarItem['bestSellerPoints']: