Skip to content

Commit

Permalink
Merge pull request #38 from e-alizadeh/master
Browse files Browse the repository at this point in the history
fix: logging
  • Loading branch information
e-alizadeh authored Oct 31, 2022
2 parents a065c29 + 5c13829 commit e5182a4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion zotero2readwise/zt2rw.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ def __init__(
include_annotations: bool = True,
include_notes: bool = False,
):

self.readwise = Readwise(readwise_token)
self.zotero_client = get_zotero_client(
library_id=zotero_library_id,
Expand All @@ -34,16 +33,21 @@ def get_all_zotero_items(self) -> List[Dict]:
annots, notes = [], []
if self.include_annots:
annots = retrieve_all_annotations(self.zotero_client)

if self.include_notes:
notes = retrieve_all_notes(self.zotero_client)

all_zotero_items = annots + notes
print(f"{len(all_zotero_items)} Zotero items are retrieved.")

return all_zotero_items

def run(self, zot_annots_notes: List[Dict] = None) -> None:
if zot_annots_notes is None:
zot_annots_notes = self.get_all_zotero_items()

formatted_items = self.zotero.format_items(zot_annots_notes)

if self.zotero.failed_items:
self.zotero.save_failed_items_to_json("failed_zotero_items.json")

Expand Down

0 comments on commit e5182a4

Please sign in to comment.