Skip to content

Commit

Permalink
Merge pull request #195 from axif0/code_cleanv1
Browse files Browse the repository at this point in the history
minor redundant code fix
  • Loading branch information
andrewtavis authored Sep 2, 2024
2 parents 9e9ceac + 5e81de1 commit af63f1e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 16 deletions.
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
21 changes: 6 additions & 15 deletions src/scribe_data/cli/list.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,12 @@
-->
"""

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.cli.cli_utils import (
correct_data_type,
language_metadata,
language_map,
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.")


if __name__ == "__main__":
Expand Down

0 comments on commit af63f1e

Please sign in to comment.