Subversion Repositories SmartDukaan

Rev

Rev 22240 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 22240 Rev 24386
Line 105... Line 105...
105
        except Exception, e:
105
        except Exception, e:
106
            print e
106
            print e
107
            return None
107
            return None
108
    return con
108
    return con
109
 
109
 
110
def get_mongo_connection_dtr_data(host='192.168.161.154', port=27017):
-
 
111
    global conDtrData
-
 
112
    if conDtrData is None:
-
 
113
        print "Establishing connection %s host and port %d" %(host,port)
-
 
114
        try:
-
 
115
            conDtrData = pymongo.MongoClient(host, port)
-
 
116
        except Exception, e:
-
 
117
            print e
-
 
118
            return None
-
 
119
    return conDtrData
-
 
120
 
110
 
121
def get_mongo_connection_cms(host, port=27017):
111
def get_mongo_connection_cms(host, port=27017):
122
    global conCms
112
    global conCms
123
    if conCms is None:
113
    if conCms is None:
124
        print "Establishing connection %s host and port %d" %(host,port)
114
        print "Establishing connection %s host and port %d" %(host,port)