style: Run linter to format code in wanikani_lessons.py
This commit is contained in:
parent
fcb8df6619
commit
0d787532d4
|
@ -1,8 +1,8 @@
|
||||||
import dataclasses
|
import dataclasses
|
||||||
import datetime
|
import datetime
|
||||||
from email.utils import parsedate_to_datetime
|
|
||||||
import logging
|
import logging
|
||||||
from collections.abc import Iterator, Mapping
|
from collections.abc import Iterator, Mapping
|
||||||
|
from email.utils import parsedate_to_datetime
|
||||||
|
|
||||||
import requests_util
|
import requests_util
|
||||||
|
|
||||||
|
@ -89,9 +89,13 @@ class WaniKaniSummaryFetcher(Scraper):
|
||||||
total_lessons = sum(len(lesson.get('subject_ids', [])) for lesson in lessons)
|
total_lessons = sum(len(lesson.get('subject_ids', [])) for lesson in lessons)
|
||||||
|
|
||||||
reviews = data.get('data', {}).get('reviews', [])
|
reviews = data.get('data', {}).get('reviews', [])
|
||||||
date_hdr = response.headers.get("Date")
|
date_hdr = response.headers.get('Date')
|
||||||
try:
|
try:
|
||||||
now = parsedate_to_datetime(date_hdr) if date_hdr else datetime.datetime.now(datetime.timezone.utc)
|
now = (
|
||||||
|
parsedate_to_datetime(date_hdr)
|
||||||
|
if date_hdr
|
||||||
|
else datetime.datetime.now(datetime.timezone.utc)
|
||||||
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
now = datetime.datetime.now(datetime.timezone.utc)
|
now = datetime.datetime.now(datetime.timezone.utc)
|
||||||
total_reviews = 0
|
total_reviews = 0
|
||||||
|
|
Loading…
Reference in New Issue
Block a user