Skip to content

Commit

Permalink
refactor: mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
vzhd1701 committed Oct 18, 2023
1 parent 052d10a commit 3e925ec
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions evernote_backup/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,13 @@

@click.group(cls=NaturalOrderGroup)
@optgroup.group("Verbosity", cls=MutuallyExclusiveOptionGroup) # type: ignore
@optgroup.option( # type: ignore
@optgroup.option(
"--quiet",
"-q",
is_flag=True,
help="Quiet mode, output only critical errors.",
)
@optgroup.option( # type: ignore
@optgroup.option(
"--verbose",
"-v",
is_flag=True,
Expand Down
2 changes: 1 addition & 1 deletion evernote_backup/evernote_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def user(self) -> str:
self._user = self.user_store.getUser().username
return self._user

def get_note_store(self, shard_id: str = None) -> "Store":
def get_note_store(self, shard_id: Optional[str] = None) -> "Store":
if shard_id is None:
shard_id = self.shard

Expand Down
2 changes: 1 addition & 1 deletion evernote_backup/note_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ def _get_notes_by_notebook(self, notebook_guid: str) -> List[str]:
(notebook_guid,),
)

sorted_notes = sorted(cur, key=lambda x: x["title"]) # type: ignore
sorted_notes = sorted(cur, key=lambda x: x["title"])

return [r["guid"] for r in sorted_notes]

Expand Down
8 changes: 4 additions & 4 deletions evernote_backup/note_synchronizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import struct
import threading
from concurrent.futures import FIRST_EXCEPTION, ThreadPoolExecutor, as_completed, wait
from typing import Any, Dict, Iterable, List, Tuple
from typing import Any, Dict, Iterable, List, Optional, Tuple

from click import progressbar
from evernote.edam.notestore.ttypes import SyncChunk
Expand Down Expand Up @@ -106,7 +106,7 @@ def __init__( # noqa: WPS211
self._thread_data = threading.local()
self._note_client: EvernoteClientSync

def __call__(self, note_id: str, auth_data: NotebookAuth = None) -> Note:
def __call__(self, note_id: str, auth_data: Optional[NotebookAuth] = None) -> Note:
self.memory_manager.wait_till_enough_memory()

if self.stop:
Expand Down Expand Up @@ -263,7 +263,7 @@ def _sync_chunks(self) -> None:
return

last_usn = current_usn
with progressbar(
with progressbar( # type: ignore
length=remote_usn - current_usn,
show_pos=True,
file=get_progress_output(),
Expand Down Expand Up @@ -350,7 +350,7 @@ def _download_scheduled_notes(self, notes_to_sync: Tuple[NoteForSync, ...]) -> N
logger.debug(f"Sync worker threads: {self.max_download_workers}")

with ThreadPoolExecutor(max_workers=self.max_download_workers) as executor:
with progressbar(
with progressbar( # type: ignore
length=len(notes_to_sync),
show_pos=True,
file=get_progress_output(),
Expand Down

0 comments on commit 3e925ec

Please sign in to comment.