From 53a0b793c0949642728cbd1aae0a69a9dae60fbd Mon Sep 17 00:00:00 2001 From: p-goulart Date: Fri, 12 Jan 2024 18:32:05 +0100 Subject: [PATCH] Rename dirs for better submodule handling --- {dict_tools => lib}/__init__.py | 0 {dict_tools => lib}/constants.py | 0 {dict_tools => lib}/logger.py | 0 {dict_tools => lib}/shell_command.py | 2 +- {dict_tools => lib}/utils.py | 6 +++--- {dict_tools => lib}/variant.py | 2 +- scripts/build_spelling_dicts.py | 10 +++++----- scripts/build_tagger_dicts.py | 14 +++++++------- tests/conftest.py | 2 +- tests/test_shell_command.py | 2 +- tests/test_variant.py | 2 +- 11 files changed, 20 insertions(+), 20 deletions(-) rename {dict_tools => lib}/__init__.py (100%) rename {dict_tools => lib}/constants.py (100%) rename {dict_tools => lib}/logger.py (100%) rename {dict_tools => lib}/shell_command.py (98%) rename {dict_tools => lib}/utils.py (85%) rename {dict_tools => lib}/variant.py (97%) diff --git a/dict_tools/__init__.py b/lib/__init__.py similarity index 100% rename from dict_tools/__init__.py rename to lib/__init__.py diff --git a/dict_tools/constants.py b/lib/constants.py similarity index 100% rename from dict_tools/constants.py rename to lib/constants.py diff --git a/dict_tools/logger.py b/lib/logger.py similarity index 100% rename from dict_tools/logger.py rename to lib/logger.py diff --git a/dict_tools/shell_command.py b/lib/shell_command.py similarity index 98% rename from dict_tools/shell_command.py rename to lib/shell_command.py index 578f958..e3243e9 100644 --- a/dict_tools/shell_command.py +++ b/lib/shell_command.py @@ -3,7 +3,7 @@ import subprocess from typing import AnyStr -from dict_tools.logger import LOGGER +from lib.logger import LOGGER class ShellCommandException(Exception): diff --git a/dict_tools/utils.py b/lib/utils.py similarity index 85% rename from dict_tools/utils.py rename to lib/utils.py index 52feac9..6e21437 100644 --- a/dict_tools/utils.py +++ b/lib/utils.py @@ -1,9 +1,9 @@ from os import chdir, path from typing import Optional -from dict_tools.constants import REPO_DIR, LT_DIR, JAVA_RESULTS_DIR -from dict_tools.shell_command import ShellCommand -from dict_tools.logger import LOGGER +from lib.constants import REPO_DIR, LT_DIR, JAVA_RESULTS_DIR +from lib.shell_command import ShellCommand +from lib.logger import LOGGER def compile_lt_dev(): diff --git a/dict_tools/variant.py b/lib/variant.py similarity index 97% rename from dict_tools/variant.py rename to lib/variant.py index 505d00a..ab60ae3 100644 --- a/dict_tools/variant.py +++ b/lib/variant.py @@ -2,7 +2,7 @@ from os import path from typing import Literal -from dict_tools.constants import HUNSPELL_DIR, SPELLING_DICT_DIR, COMPOUNDS_DIR, JAVA_RESULTS_DIR, TAGGER_DICT_DIR +from lib.constants import HUNSPELL_DIR, SPELLING_DICT_DIR, COMPOUNDS_DIR, JAVA_RESULTS_DIR, TAGGER_DICT_DIR class Variant: diff --git a/scripts/build_spelling_dicts.py b/scripts/build_spelling_dicts.py index 60743da..d3cbb3e 100644 --- a/scripts/build_spelling_dicts.py +++ b/scripts/build_spelling_dicts.py @@ -8,11 +8,11 @@ from tempfile import NamedTemporaryFile from os import path -from dict_tools.logger import LOGGER -from dict_tools.constants import SPELLING_DICT_DIR, LT_JAR_PATH, LT_DIR, LT_VER, LATIN_1_ENCODING -from dict_tools.shell_command import ShellCommand -from dict_tools.utils import compile_lt_dev, install_dictionaries -from dict_tools.variant import Variant, VARIANT_MAPPING +from lib.logger import LOGGER +from lib.constants import SPELLING_DICT_DIR, LT_JAR_PATH, LT_DIR, LT_VER, LATIN_1_ENCODING +from lib.shell_command import ShellCommand +from lib.utils import compile_lt_dev, install_dictionaries +from lib.variant import Variant, VARIANT_MAPPING class CLI: diff --git a/scripts/build_tagger_dicts.py b/scripts/build_tagger_dicts.py index 2d3d503..9f9594f 100644 --- a/scripts/build_tagger_dicts.py +++ b/scripts/build_tagger_dicts.py @@ -4,13 +4,13 @@ import argparse import os -from dict_tools.logger import LOGGER -from dict_tools.constants import (TAGGER_BUILD_SCRIPT_PATH, FDIC_DIR, RESULT_POS_DICT_FILEPATH, - SORTED_POS_DICT_FILEPATH, POS_DICT_DIFF_FILEPATH, OLD_POS_DICT_FILEPATH, REPO_DIR, - TAGGER_DICT_DIR, LT_RESULTS_DIR, LT_JAR_PATH) -from dict_tools.shell_command import ShellCommand -from dict_tools.utils import compile_lt_dev, install_dictionaries -from dict_tools.variant import Variant, VARIANT_MAPPING +from lib.logger import LOGGER +from lib.constants import (TAGGER_BUILD_SCRIPT_PATH, FDIC_DIR, RESULT_POS_DICT_FILEPATH, + SORTED_POS_DICT_FILEPATH, POS_DICT_DIFF_FILEPATH, OLD_POS_DICT_FILEPATH, REPO_DIR, + TAGGER_DICT_DIR, LT_RESULTS_DIR, LT_JAR_PATH) +from lib.shell_command import ShellCommand +from lib.utils import compile_lt_dev, install_dictionaries +from lib.variant import Variant, VARIANT_MAPPING class CLI: diff --git a/tests/conftest.py b/tests/conftest.py index 77a8e39..8426909 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,3 +1,3 @@ -from dict_tools.logger import LOGGER +from lib.logger import LOGGER LOGGER.setLevel("FATAL") diff --git a/tests/test_shell_command.py b/tests/test_shell_command.py index 8f1b935..cd42429 100644 --- a/tests/test_shell_command.py +++ b/tests/test_shell_command.py @@ -1,6 +1,6 @@ import pytest -from dict_tools.shell_command import ShellCommand, ShellCommandException +from lib.shell_command import ShellCommand, ShellCommandException class TestShellCommand: diff --git a/tests/test_variant.py b/tests/test_variant.py index e072d00..cff3350 100644 --- a/tests/test_variant.py +++ b/tests/test_variant.py @@ -1,4 +1,4 @@ -from dict_tools.variant import Variant +from lib.variant import Variant class TestVariant: