Subversion Repositories SmartDukaan

Rev

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

Rev 17013 Rev 17041
Line 27... Line 27...
27
PROXY_MESH_GENERAL = "us-il.proxymesh.com:31280"
27
PROXY_MESH_GENERAL = "us-il.proxymesh.com:31280"
28
 
28
 
29
PUSH_NOTIFICATION_URL='http://api.profittill.com/admin/users/push'
29
PUSH_NOTIFICATION_URL='http://api.profittill.com/admin/users/push'
30
DTR_API_BASIC_AUTH = base64.encodestring('%s:%s' % ("dtr", "dtr18Feb2015")).replace('\n', '')
30
DTR_API_BASIC_AUTH = base64.encodestring('%s:%s' % ("dtr", "dtr18Feb2015")).replace('\n', '')
31
statusMap = {1:'Active',2:'EOL',3:'In Process',4:'Exclusive'}
31
statusMap = {1:'Active',2:'EOL',3:'In Process',4:'Exclusive'}
-
 
32
SOURCE_MAP = {'AMAZON':1,'FLIPKART':2,'SNAPDEAL':3,'SAHOLIC':4, 'SHOPCLUES.COM':5,'PAYTM.COM':6, 'HOMESHOP18.COM':7}
32
 
33
 
33
CB_INIT = 'Waiting Confirmation'
34
CB_INIT = 'Waiting Confirmation'
34
CB_PENDING = 'Pending'
35
CB_PENDING = 'Pending'
35
CB_CREDIT_IN_PROCESS = 'Credit in process'
36
CB_CREDIT_IN_PROCESS = 'Credit in process'
36
CB_CREDITED = 'Credited to wallet'
37
CB_CREDITED = 'Credited to wallet'
Line 130... Line 131...
130
        return html
131
        return html
131
    return r.read()
132
    return r.read()
132
 
133
 
133
 
134
 
134
def fetchResponseUsingProxy(url, headers=headers, livePricing=None, proxy=True):
135
def fetchResponseUsingProxy(url, headers=headers, livePricing=None, proxy=True):
135
#    if livePricing is None:
136
    if livePricing is None:
136
#        PROXY_URL = PROXY_MESH_GENERAL
137
        PROXY_URL = PROXY_MESH_GENERAL
137
#    else:
138
    else:
138
#        PROXY_URL = PROXY_MESH_LIVE
139
        PROXY_URL = PROXY_MESH_LIVE
139
#    if proxy:
140
    if proxy:
140
#        print PROXY_URL
141
        print PROXY_URL
141
#        proxy = urllib2.ProxyHandler({'http': PROXY_URL})
142
        proxy = urllib2.ProxyHandler({'http': PROXY_URL})
142
#        opener = urllib2.build_opener(proxy)
143
        opener = urllib2.build_opener(proxy)
143
#        urllib2.install_opener(opener)
144
        urllib2.install_opener(opener)
144
    req = urllib2.Request(url,headers=headers)
145
    req = urllib2.Request(url,headers=headers)
145
    response = urllib2.urlopen(req)
146
    response = urllib2.urlopen(req)
146
    response_data = ungzipResponse(response)
147
    response_data = ungzipResponse(response)
147
    response.close()
148
    response.close()
148
    return response_data
149
    return response_data