mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
pep8
This commit is contained in:
parent
cdb70b909e
commit
5acb10fac5
@ -7,8 +7,9 @@ __author__ = u'Tomasz Jozwiak'
|
|||||||
gazetaprawna.pl
|
gazetaprawna.pl
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
import re
|
||||||
from calibre.web.feeds.news import BasicNewsRecipe
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
from datetime import date
|
|
||||||
|
|
||||||
class gazetaprawna(BasicNewsRecipe):
|
class gazetaprawna(BasicNewsRecipe):
|
||||||
version = 2
|
version = 2
|
||||||
@ -67,8 +68,8 @@ class gazetaprawna(BasicNewsRecipe):
|
|||||||
parsed_feeds = BasicNewsRecipe.parse_feeds(self)
|
parsed_feeds = BasicNewsRecipe.parse_feeds(self)
|
||||||
for n, feed in enumerate(parsed_feeds):
|
for n, feed in enumerate(parsed_feeds):
|
||||||
for a, article in enumerate(feed):
|
for a, article in enumerate(feed):
|
||||||
article.text_summary = re.sub(u'<\!\[CDATA\[', "", article.text_summary)
|
article.text_summary = re.sub(r'<\!\[CDATA\[', "", article.text_summary)
|
||||||
article.text_summary = re.sub(u'\]\]', "", article.text_summary)
|
article.text_summary = re.sub(r'\]\]', "", article.text_summary)
|
||||||
article.summary = article.text_summary
|
article.summary = article.text_summary
|
||||||
|
|
||||||
return parsed_feeds
|
return parsed_feeds
|
||||||
@ -78,7 +79,7 @@ class gazetaprawna(BasicNewsRecipe):
|
|||||||
for img_tag in Img.findAll(name='img', attrs={'data-src': True}):
|
for img_tag in Img.findAll(name='img', attrs={'data-src': True}):
|
||||||
img_tag['src'] = img_tag['data-src']
|
img_tag['src'] = img_tag['data-src']
|
||||||
del img_tag['data-src']
|
del img_tag['data-src']
|
||||||
#print(Img.prettify())
|
# print(Img.prettify())
|
||||||
|
|
||||||
for span in soup.findAll(name='span'):
|
for span in soup.findAll(name='span'):
|
||||||
if len(self.tag_to_string(span)) > 1:
|
if len(self.tag_to_string(span)) > 1:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user