Skip to content

Commit

Permalink
fix(output): modified some prints for clearer messages
Browse files Browse the repository at this point in the history
  • Loading branch information
rwxd committed Dec 25, 2022
1 parent 5ebbc26 commit 92abc5e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions wallabag2readwise/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def push_annotations(wallabag: WallabagConnector, readwise: ReadwiseConnector):
if article.title == entry.title:
highlights = list(readwise.get_book_highlights(article.id))
console.print(
f'=> Found {len(highlights)} Readwise highlights for "{entry.title}"'
f'=> Found {len(highlights)} wallabag highlights for "{entry.title}"'
)
for annotation in annotations:
if annotation.quote not in [i.text for i in highlights]:
Expand All @@ -41,5 +41,5 @@ def push_annotations(wallabag: WallabagConnector, readwise: ReadwiseConnector):
break
else:
logger.info(f'Entry "{entry.title}" not present in Readwise')
console.print(f'==> Adding article "{entry.title}"')
console.print(f'==> Adding article "{entry.title}" to Readwise')
new_highlights(readwise, entry, annotations)
4 changes: 2 additions & 2 deletions wallabag2readwise/readwise.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def _request(
response = self._session.request(method, url, params=params, json=data)
while response.status_code == 429:
seconds = int(response.headers['Retry-After'])
logger.warning(f'Rate limited, retrying in {seconds} seconds')
logger.warning(f'Rate limited by Readwise, retrying in {seconds} seconds')
sleep(seconds)
response = self._session.request(method, url, params=params, json=data)
response.raise_for_status()
Expand Down Expand Up @@ -133,7 +133,7 @@ def new_highlights(
readwise: ReadwiseConnector, entry: Entry, annotations: list[Annotation]
):
for item in annotations:
console.print(f'==> Adding highlight')
console.print(f'==> Adding highlight to Readwise')
readwise.create_highlight(
item.quote,
entry.title,
Expand Down

0 comments on commit 92abc5e

Please sign in to comment.