Subversion Repositories SmartDukaan

Rev

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

Rev 14258 Rev 14263
Line 7... Line 7...
7
from datetime import datetime, timedelta
7
from datetime import datetime, timedelta
8
import time
8
import time
9
import optparse
9
import optparse
10
 
10
 
11
parser = optparse.OptionParser()
11
parser = optparse.OptionParser()
12
parser.add_option("-h", "--host", dest="hostname",
12
parser.add_option("-H", "--host", dest="hostname",
13
                      default="localhost",
13
                      default="localhost",
14
                      type="string", help="The HOST where the DB server is running",
14
                      type="string", help="The HOST where the DB server is running",
15
                      metavar="host")
15
                      metavar="host")
16
parser.add_option("-m", "--m", dest="mongoHost",
16
parser.add_option("-m", "--m", dest="mongoHost",
17
                      default="localhost",
17
                      default="localhost",
Line 270... Line 270...
270
            get_mongo_connection().Catalog.Deals.update({ '_id' : bestOne['_id'] }, {'$set':{'showDeal':1 }})
270
            get_mongo_connection().Catalog.Deals.update({ '_id' : bestOne['_id'] }, {'$set':{'showDeal':1 }})
271
        if len(toUpdate) > 0:
271
        if len(toUpdate) > 0:
272
            get_mongo_connection().Catalog.Deals.update({ '_id' : { "$in": toUpdate } }, {'$set':{'showDeal':0 }},upsert=False, multi=True)
272
            get_mongo_connection().Catalog.Deals.update({ '_id' : { "$in": toUpdate } }, {'$set':{'showDeal':0 }},upsert=False, multi=True)
273
 
273
 
274
def main():
274
def main():
-
 
275
    try:
275
    populateStuff()
276
        populateStuff()
276
    calculateNlc()
277
        calculateNlc()
-
 
278
    finally:
-
 
279
        session.close()
277
    calculateNlcPoints()
280
    calculateNlcPoints()
278
    commitData()
281
    commitData()
279
    addBestSellerPoints()
282
    addBestSellerPoints()
280
    elimiateSimilarDeals()
283
    elimiateSimilarDeals()
281
 
284