Skip to content

Commit

Permalink
Fix download file from MTP device error
Browse files Browse the repository at this point in the history
Should pass `gui.device_manager` to `download_file_from_mtp()`.
  • Loading branch information
xxyzz committed Jan 31, 2024
1 parent dd0da91 commit 2ae42bd
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion custom_lemmas.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def check_empty_kindle_gloss(self) -> None:
if isinstance(package_name, str):
copy_klld_from_android(package_name, custom_folder)
else:
copy_klld_from_kindle(gui.device_manager.device, custom_folder)
copy_klld_from_kindle(gui.device_manager, custom_folder)

klld_path = get_kindle_klld_path(plugin_path)
if klld_path is None:
Expand Down
2 changes: 1 addition & 1 deletion data/deps.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"spacy_cpu_model": "3.7.0",
"spacy_trf_model": "3.7.2",
"thinc-apple-ops": "0.1.4",
"torch": "2.1.2",
"torch": "2.2.0",
"typing-extensions": "4.9.0"
}
3 changes: 2 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
from datetime import datetime, timezone

project = "WordDumb"
copyright = "2024, xxyzz"
copyright = f"{datetime.now(timezone.utc).year}, xxyzz"
author = "xxyzz"

# -- General configuration ---------------------------------------------------
Expand Down
8 changes: 4 additions & 4 deletions send_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,13 +239,13 @@ def copy_klld_from_android(package_name: str, dest_path: Path) -> None:
dest_path.joinpath("wordwise").rmdir()


def copy_klld_from_kindle(device_driver: Any, dest_path: Path) -> None:
if is_mtp_device(device_driver):
def copy_klld_from_kindle(device_manager: Any, dest_path: Path) -> None:
if is_mtp_device(device_manager.device):
download_file_from_mtp(
device_driver, Path("system/kll/kll.en.en.klld"), dest_path
device_manager, Path("system/kll/kll.en.en.klld"), dest_path
)
else:
for klld_path in Path(f"{device_driver._main_prefix}/system/kll").glob(
for klld_path in Path(f"{device_manager.device._main_prefix}/system/kll").glob(
"*.en.klld"
):
shutil.copy(klld_path, dest_path)
Expand Down

0 comments on commit 2ae42bd

Please sign in to comment.