This commit is contained in:
Kovid Goyal 2019-12-16 19:44:31 +05:30
commit 018d673023
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -112,7 +112,7 @@ def format_price_in_RUR(price):
''' '''
if price and re.match(r"^\d*?\.\d*?$", price): if price and re.match(r"^\d*?\.\d*?$", price):
try: try:
price = u'{:,.2F} руб.'.format(float(price)) price = u'{:,.2F} \u20BD'.format(float(price)) # \u20BD => руб.
price = price.replace(',', ' ').replace('.', ',', 1) price = price.replace(',', ' ').replace('.', ',', 1)
except: except:
pass pass
@ -121,7 +121,7 @@ def format_price_in_RUR(price):
def ungzipResponse(r,b): def ungzipResponse(r,b):
headers = r.info() headers = r.info()
if headers['Content-Encoding']=='gzip': if headers.get('Content-Encoding', '')=='gzip':
import gzip import gzip
gz = gzip.GzipFile(fileobj=r, mode='rb') gz = gzip.GzipFile(fileobj=r, mode='rb')
data = gz.read() data = gz.read()