mirror of
https://github.com/kovidgoyal/calibre.git
synced 2026-04-15 13:31:59 -04:00
pep8
This commit is contained in:
parent
d7d864b70b
commit
efd35819df
@ -1,8 +1,9 @@
|
||||
import re
|
||||
import time as time_mod
|
||||
from datetime import datetime
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
from calibre.utils.date import utcnow
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
|
||||
class TimeMagazineUSA(BasicNewsRecipe):
|
||||
@ -79,7 +80,7 @@ class TimeMagazineUSA(BasicNewsRecipe):
|
||||
if not time_tag:
|
||||
continue
|
||||
try:
|
||||
dt = datetime.fromisoformat(time_tag['datetime'].replace('Z', '+00:00'))
|
||||
dt = datetime.fromisoformat(time_tag['datetime'])
|
||||
candidates.append((dt, href, a.get_text(strip=True)))
|
||||
except Exception:
|
||||
pass
|
||||
@ -119,7 +120,7 @@ class TimeMagazineUSA(BasicNewsRecipe):
|
||||
if articles:
|
||||
sections.append((section_name, articles))
|
||||
|
||||
return sections if sections else None
|
||||
return sections or None
|
||||
|
||||
def _slug_to_title(self, path):
|
||||
parts = path.strip('/').split('/')
|
||||
@ -293,4 +294,4 @@ class TimeMagazineUSA(BasicNewsRecipe):
|
||||
else:
|
||||
p.decompose()
|
||||
|
||||
return soup
|
||||
return soup
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user