Subversion Repositories SmartDukaan

Rev

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

Rev 20172 Rev 20689
Line 1346... Line 1346...
1346
                        'thursday','friday','saturday']
1346
                        'thursday','friday','saturday']
1347
    target_day = days_of_week.index(day_name.lower())
1347
    target_day = days_of_week.index(day_name.lower())
1348
    delta_day = target_day - (d.isoweekday()%7)
1348
    delta_day = target_day - (d.isoweekday()%7)
1349
    return d + timedelta(days=delta_day)
1349
    return d + timedelta(days=delta_day)
1350
 
1350
 
1351
def get_mongo_connection_new(host='45.33.50.227', port=27017):
1351
def get_mongo_connection_new(host='192.168.161.154', port=27017):
1352
    global con
1352
    global con
1353
    if con is None:
1353
    if con is None:
1354
        print "Establishing connection %s host and port %d" %(host,port)
1354
        print "Establishing connection %s host and port %d" %(host,port)
1355
        try:
1355
        try:
1356
            con = pymongo.MongoClient(host, port)
1356
            con = pymongo.MongoClient(host, port)