mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
pep8
This commit is contained in:
parent
48f1635512
commit
57229e839d
@ -44,7 +44,7 @@ class AM730(BasicNewsRecipe):
|
|||||||
ignore_duplicate_articles = {'title', 'url'}
|
ignore_duplicate_articles = {'title', 'url'}
|
||||||
|
|
||||||
debug=False
|
debug=False
|
||||||
|
|
||||||
def get_cover_url(self):
|
def get_cover_url(self):
|
||||||
return self.masthead_url
|
return self.masthead_url
|
||||||
|
|
||||||
|
@ -254,7 +254,7 @@ class AppleDaily(BasicNewsRecipe):
|
|||||||
if os.path.exists(last):
|
if os.path.exists(last):
|
||||||
with open(last, 'rb') as fi:
|
with open(last, 'rb') as fi:
|
||||||
src = fi.read().decode('utf-8')
|
src = fi.read().decode('utf-8')
|
||||||
src = src.replace('height:260px !important;','') #fix flow-player div tag parent
|
src = src.replace('height:260px !important;','') # fix flow-player div tag parent
|
||||||
soup = BeautifulSoup(src)
|
soup = BeautifulSoup(src)
|
||||||
body = soup.find('body')
|
body = soup.find('body')
|
||||||
if body is not None:
|
if body is not None:
|
||||||
@ -264,8 +264,10 @@ class AppleDaily(BasicNewsRecipe):
|
|||||||
not self.has_single_feed,
|
not self.has_single_feed,
|
||||||
a.orig_url, __appname__, prefix=prefix,
|
a.orig_url, __appname__, prefix=prefix,
|
||||||
center=self.center_navbar)
|
center=self.center_navbar)
|
||||||
translatedTempl =re.sub('<hr.*<br','<hr>本篇由 '+__appname__+' 快取自 <a href="http://hkm.appledaily.com/" >蘋果日報</a> ; <a href="'+a.orig_url+'">本篇來源位置</a>。'+
|
translatedTempl =re.sub(
|
||||||
'<br',templ.render(doctype='xhtml').decode('utf-8'),flags=re.S)
|
'<hr.*<br','<hr>本篇由 '+__appname__+
|
||||||
|
' 快取自 <a href="http://hkm.appledaily.com/" >蘋果日報</a> ; <a href="'+a.orig_url+'">本篇來源位置</a>。'+
|
||||||
|
'<br',templ.render(doctype='xhtml').decode('utf-8'),flags=re.S)
|
||||||
elem = BeautifulSoup(translatedTempl).find('div')
|
elem = BeautifulSoup(translatedTempl).find('div')
|
||||||
body.insert(len(body.contents), elem)
|
body.insert(len(body.contents), elem)
|
||||||
with open(last, 'wb') as fi:
|
with open(last, 'wb') as fi:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user