diff --git a/.vscode/launch.json b/.vscode/launch.json index 8a490230..d00d9434 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -25,6 +25,7 @@ "--host-apkg-dir=/Users/Leisure/", "--no-dry-run", "--no-watch", + "--max-deletions-per-run=300", ] } ] diff --git a/personal_mnemonic_medium/data_access/ankiconnect_gateway.py b/personal_mnemonic_medium/data_access/ankiconnect_gateway.py index 5c79abee..743424df 100644 --- a/personal_mnemonic_medium/data_access/ankiconnect_gateway.py +++ b/personal_mnemonic_medium/data_access/ankiconnect_gateway.py @@ -195,11 +195,7 @@ def import_package(self, package: genanki.Package) -> None: def in_docker() -> bool: - try: - with Path("/proc/1/cgroup").open("r") as ifh: - return "docker" in ifh.read() - except Exception: - return False + return Path("/.dockerenv").exists() ANKICONNECT_URL = ( diff --git a/personal_mnemonic_medium/data_access/test_ankiconnect.py b/personal_mnemonic_medium/data_access/test_ankiconnect.py index 96d1414c..89a316a2 100644 --- a/personal_mnemonic_medium/data_access/test_ankiconnect.py +++ b/personal_mnemonic_medium/data_access/test_ankiconnect.py @@ -63,6 +63,7 @@ def test_import_package(self): genanki.Note( model=model, fields=["Capital of Argentina", "Buenos Aires"], + tags=["TestTag"], ) ) @@ -74,7 +75,8 @@ def test_import_package(self): # Phase 2: Getting all_notes = self.gateway.get_all_note_infos() - assert len(all_notes) == 1 + note = all_notes[0] + assert note.tags == ["TestTag"] # Phase 3: Deleting self.gateway.delete_notes( diff --git a/personal_mnemonic_medium/domain/prompt_destination/anki_connect/prompt_converter/prompts/anki_cloze.py b/personal_mnemonic_medium/domain/prompt_destination/anki_connect/prompt_converter/prompts/anki_cloze.py index 91498a24..bfaeac72 100644 --- a/personal_mnemonic_medium/domain/prompt_destination/anki_connect/prompt_converter/prompts/anki_cloze.py +++ b/personal_mnemonic_medium/domain/prompt_destination/anki_connect/prompt_converter/prompts/anki_cloze.py @@ -52,4 +52,5 @@ def to_genanki_note(self) -> genanki.Note: " ".join(self.tags), str(self.uuid), ], + tags=self.tags, ) diff --git a/personal_mnemonic_medium/domain/prompt_destination/anki_connect/prompt_converter/prompts/anki_qa.py b/personal_mnemonic_medium/domain/prompt_destination/anki_connect/prompt_converter/prompts/anki_qa.py index 37ea2456..0e5d550b 100644 --- a/personal_mnemonic_medium/domain/prompt_destination/anki_connect/prompt_converter/prompts/anki_qa.py +++ b/personal_mnemonic_medium/domain/prompt_destination/anki_connect/prompt_converter/prompts/anki_qa.py @@ -84,4 +84,5 @@ def to_genanki_note(self) -> genanki.Note: " ".join(self.tags), str(self.uuid), ], + tags=self.tags, )