This commit is contained in:
Kovid Goyal 2019-12-26 21:56:11 +05:30
parent eb10773b6f
commit ef3f0a8929
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
4 changed files with 6 additions and 8 deletions

View File

@ -1,13 +1,12 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
store_version = 9 # Needed for dynamic plugin loading
store_version = 9 # Needed for dynamic plugin loading
__license__ = 'GPL 3'
__copyright__ = '2011-2019, Tomasz Długosz <tomek3d@gmail.com>'
__docformat__ = 'restructuredtext en'
import re
from base64 import b64encode
from contextlib import closing
try:
@ -78,7 +77,7 @@ class EmpikStore(BasicStoreConfig, StorePlugin):
title = ''.join(data.xpath('.//div[@class="name"]/a/@title'))
price = ''.join(data.xpath('.//div[@class="price ta-price-tile "]/text()'))
#with closing(br.open('https://empik.com' + id.strip(), timeout=timeout/4)) as nf:
# with closing(br.open('https://empik.com' + id.strip(), timeout=timeout/4)) as nf:
# idata = html.fromstring(nf.read())
# crawled = idata.xpath('.//a[(@class="chosen hrefstyle") or (@class="connectionsLink hrefstyle")]/text()')
# formats = ','.join([re.sub('ebook, ','', x.strip()) for x in crawled if 'ebook' in x])
@ -91,6 +90,6 @@ class EmpikStore(BasicStoreConfig, StorePlugin):
s.author = author.strip()
s.price = price.strip()
s.detail_item = 'https://empik.com' + id.strip()
#s.formats = formats.upper().strip()
# s.formats = formats.upper().strip()
yield s

View File

@ -1,13 +1,12 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
store_version = 10 # Needed for dynamic plugin loading
store_version = 10 # Needed for dynamic plugin loading
__license__ = 'GPL 3'
__copyright__ = '2011-2019, Tomasz Długosz <tomek3d@gmail.com>'
__docformat__ = 'restructuredtext en'
import re
from base64 import b64encode
from contextlib import closing
try:

View File

@ -112,7 +112,7 @@ def format_price_in_RUR(price):
'''
if price and re.match(r"^\d*?\.\d*?$", price):
try:
price = u'{:,.2F} \u20BD'.format(float(price)) # \u20BD => руб.
price = u'{:,.2F} \u20BD'.format(float(price)) # \u20BD => руб.
price = price.replace(',', ' ').replace('.', ',', 1)
except:
pass

View File

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
store_version = 10 # Needed for dynamic plugin loading
store_version = 10 # Needed for dynamic plugin loading
__license__ = 'GPL 3'
__copyright__ = '2011-2019, Tomasz Długosz <tomek3d@gmail.com>'