Subversion Repositories SmartDukaan

Rev

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

Rev 14705 Rev 14708
Line 1... Line 1...
1
import time
1
import time
2
import pymongo
2
import pymongo
3
 
3
 
4
#TODO Need to add messy stuff to conf.
4
#TODO Need to add messy stuff to conf.
5
 
5
con=None
6
def get_mongo_connection(host='localhost', port=27017):
6
def get_mongo_connection(host='localhost', port=27017):
7
    global con
7
    global con
8
    if con is None:
8
    if con is None:
9
        print "Establishing connection %s host and port %d" %(host,port)
9
        print "Establishing connection %s host and port %d" %(host,port)
10
        try:
10
        try: