| Line 20... |
Line 20... |
| 20 |
|
20 |
|
| 21 |
(options, args) = parser.parse_args()
|
21 |
(options, args) = parser.parse_args()
|
| 22 |
|
22 |
|
| 23 |
mc = MemCache(options.mongoHost)
|
23 |
mc = MemCache(options.mongoHost)
|
| 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 218... |
Line 218... |
| 218 |
get_mongo_connection().Catalog.Deals.update({ '_id' : similarItem['_id'] }, {'$set':{'showDeal':0, 'prepaidDeal':0 }})
|
218 |
get_mongo_connection().Catalog.Deals.update({ '_id' : similarItem['_id'] }, {'$set':{'showDeal':0, 'prepaidDeal':0 }})
|
| 219 |
continue
|
219 |
continue
|
| 220 |
if similarItem['source_id'] == SOURCE_MAP.get('SHOPCLUES.COM') and similarItem['rank']==0:
|
220 |
if similarItem['source_id'] == SOURCE_MAP.get('SHOPCLUES.COM') and similarItem['rank']==0:
|
| 221 |
get_mongo_connection().Catalog.Deals.update({ '_id' : similarItem['_id'] }, {'$set':{'showDeal':0,'prepaidDeal':0 }})
|
221 |
get_mongo_connection().Catalog.Deals.update({ '_id' : similarItem['_id'] }, {'$set':{'showDeal':0,'prepaidDeal':0 }})
|
| 222 |
continue
|
222 |
continue
|
| - |
|
223 |
if similarItem['source_id'] == SOURCE_MAP.get('PAYTM.COM'):
|
| - |
|
224 |
similarItem['available_price'] = similarItem['gross_price']
|
| 223 |
if similarItem['available_price'] < prepaidBestPrice:
|
225 |
if similarItem['available_price'] < prepaidBestPrice:
|
| 224 |
prepaidBestOne = similarItem
|
226 |
prepaidBestOne = similarItem
|
| 225 |
prepaidBestPrice = similarItem['available_price']
|
227 |
prepaidBestPrice = similarItem['available_price']
|
| 226 |
prepaidBestSellerPoints = similarItem['bestSellerPoints']
|
228 |
prepaidBestSellerPoints = similarItem['bestSellerPoints']
|
| 227 |
elif similarItem['available_price'] == prepaidBestPrice and prepaidBestSellerPoints < similarItem['bestSellerPoints']:
|
229 |
elif similarItem['available_price'] == prepaidBestPrice and prepaidBestSellerPoints < similarItem['bestSellerPoints']:
|