Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minor redundant code fix #195

Merged
merged 3 commits into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/scribe_data/cli/cli_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@

from scribe_data.utils import DEFAULT_JSON_EXPORT_DIR

LANGUAGE_DATA_EXTRACTION_DIR = Path(__file__).parent.parent / "language_data_extraction"

LANGUAGE_METADATA_FILE = (
Path(__file__).parent.parent / "resources" / "language_metadata.json"
)
Expand Down
17 changes: 3 additions & 14 deletions src/scribe_data/cli/list.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,10 @@
-->
"""

import json
from pathlib import Path

from scribe_data.cli.cli_utils import correct_data_type

# Load language metadata from JSON file.
METADATA_FILE = Path(__file__).parent.parent / "resources" / "language_metadata.json"
LANGUAGE_DATA_EXTRACTION_DIR = Path(__file__).parent.parent / "language_data_extraction"

with METADATA_FILE.open("r", encoding="utf-8") as file:
language_metadata = json.load(file)

language_map = {
lang["language"].lower(): lang for lang in language_metadata["languages"]
}
from scribe_data.utils import language_metadata
from scribe_data.utils import language_map
from scribe_data.utils import LANGUAGE_DATA_EXTRACTION_DIR


def list_languages() -> None:
Expand Down
1 change: 0 additions & 1 deletion src/scribe_data/load/data_to_sqlite.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,6 @@ def table_insert(data_type, keys):
)

print("Database creation/update process completed.")
print("Database creation/update process completed.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch!



if __name__ == "__main__":
Expand Down
Loading