Subversion Repositories SmartDukaan

Rev

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

Rev 15906 Rev 15931
Line 101... Line 101...
101
def fetchResponseUsingProxy(url, headers=headers, livePricing=None, proxy=True):
101
def fetchResponseUsingProxy(url, headers=headers, livePricing=None, proxy=True):
102
    if livePricing is None:
102
    if livePricing is None:
103
        PROXY_URL = PROXY_MESH_GENERAL
103
        PROXY_URL = PROXY_MESH_GENERAL
104
    else:
104
    else:
105
        PROXY_URL = PROXY_MESH_LIVE
105
        PROXY_URL = PROXY_MESH_LIVE
106
    print PROXY_URL
-
 
107
    if proxy:
106
    if proxy:
-
 
107
        print PROXY_URL
108
        proxy = urllib2.ProxyHandler({'http': PROXY_URL})
108
        proxy = urllib2.ProxyHandler({'http': PROXY_URL})
109
        opener = urllib2.build_opener(proxy)
109
        opener = urllib2.build_opener(proxy)
110
        urllib2.install_opener(opener)
110
        urllib2.install_opener(opener)
111
    req = urllib2.Request(url,headers=headers)
111
    req = urllib2.Request(url,headers=headers)
112
    response = urllib2.urlopen(req)
112
    response = urllib2.urlopen(req)