mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 02:34:06 -04:00
pep8
This commit is contained in:
parent
eb10773b6f
commit
ef3f0a8929
@ -1,13 +1,12 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
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'
|
__license__ = 'GPL 3'
|
||||||
__copyright__ = '2011-2019, Tomasz Długosz <tomek3d@gmail.com>'
|
__copyright__ = '2011-2019, Tomasz Długosz <tomek3d@gmail.com>'
|
||||||
__docformat__ = 'restructuredtext en'
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
import re
|
|
||||||
from base64 import b64encode
|
from base64 import b64encode
|
||||||
from contextlib import closing
|
from contextlib import closing
|
||||||
try:
|
try:
|
||||||
@ -78,7 +77,7 @@ class EmpikStore(BasicStoreConfig, StorePlugin):
|
|||||||
title = ''.join(data.xpath('.//div[@class="name"]/a/@title'))
|
title = ''.join(data.xpath('.//div[@class="name"]/a/@title'))
|
||||||
price = ''.join(data.xpath('.//div[@class="price ta-price-tile "]/text()'))
|
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())
|
# idata = html.fromstring(nf.read())
|
||||||
# crawled = idata.xpath('.//a[(@class="chosen hrefstyle") or (@class="connectionsLink hrefstyle")]/text()')
|
# 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])
|
# 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.author = author.strip()
|
||||||
s.price = price.strip()
|
s.price = price.strip()
|
||||||
s.detail_item = 'https://empik.com' + id.strip()
|
s.detail_item = 'https://empik.com' + id.strip()
|
||||||
#s.formats = formats.upper().strip()
|
# s.formats = formats.upper().strip()
|
||||||
|
|
||||||
yield s
|
yield s
|
||||||
|
@ -1,13 +1,12 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
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'
|
__license__ = 'GPL 3'
|
||||||
__copyright__ = '2011-2019, Tomasz Długosz <tomek3d@gmail.com>'
|
__copyright__ = '2011-2019, Tomasz Długosz <tomek3d@gmail.com>'
|
||||||
__docformat__ = 'restructuredtext en'
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
import re
|
|
||||||
from base64 import b64encode
|
from base64 import b64encode
|
||||||
from contextlib import closing
|
from contextlib import closing
|
||||||
try:
|
try:
|
||||||
|
@ -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} \u20BD'.format(float(price)) # \u20BD => руб.
|
price = u'{:,.2F} \u20BD'.format(float(price)) # \u20BD => руб.
|
||||||
price = price.replace(',', ' ').replace('.', ',', 1)
|
price = price.replace(',', ' ').replace('.', ',', 1)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
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'
|
__license__ = 'GPL 3'
|
||||||
__copyright__ = '2011-2019, Tomasz Długosz <tomek3d@gmail.com>'
|
__copyright__ = '2011-2019, Tomasz Długosz <tomek3d@gmail.com>'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user