Subversion Repositories SmartDukaan

Rev

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

Rev 14738 Rev 14747
Line 13... Line 13...
13
            'Accept-Charset' : 'ISO-8859-1,utf-8;q=0.7,*;q=0.3',
13
            'Accept-Charset' : 'ISO-8859-1,utf-8;q=0.7,*;q=0.3',
14
            'Connection':'keep-alive',
14
            'Connection':'keep-alive',
15
            'Accept-Encoding' : 'gzip,deflate,sdch'
15
            'Accept-Encoding' : 'gzip,deflate,sdch'
16
        }
16
        }
17
PROXY_URL = "http://192.161.163.60:8800"
17
PROXY_URL = "http://192.161.163.60:8800"
-
 
18
 
18
def get_mongo_connection(host='localhost', port=27017):
19
def get_mongo_connection(host='localhost', port=27017):
19
    global con
20
    global con
20
    if con is None:
21
    if con is None:
21
        print "Establishing connection %s host and port %d" %(host,port)
22
        print "Establishing connection %s host and port %d" %(host,port)
22
        try:
23
        try:
Line 98... Line 99...
98
    req = urllib2.Request(url,headers=headers)
99
    req = urllib2.Request(url,headers=headers)
99
    response = urllib2.urlopen(req)
100
    response = urllib2.urlopen(req)
100
    response_data = ungzipResponse(response)
101
    response_data = ungzipResponse(response)
101
    response.close()
102
    response.close()
102
    return response_data
103
    return response_data
103
            
-
 
104
    
-
 
105
 
-
 
106
 
104