diff --git a/potodo/utils/arguments_handling.py b/potodo/arguments_handling.py similarity index 100% rename from potodo/utils/arguments_handling.py rename to potodo/arguments_handling.py diff --git a/potodo/utils/cache.py b/potodo/cache.py similarity index 89% rename from potodo/utils/cache.py rename to potodo/cache.py index 847d05f..c23887d 100644 --- a/potodo/utils/cache.py +++ b/potodo/cache.py @@ -5,10 +5,10 @@ from pathlib import Path from typing import cast from typing import Dict -from potodo._po_file import PoFileStats +from potodo.po_file import PoFileStats -def _get_cache_file_content( +def get_cache_file_content( path: str = ".potodo/cache.pickle", ) -> Dict[Path, PoFileStats]: logging.debug("Trying to load cache from %s", path) @@ -23,7 +23,7 @@ def _get_cache_file_content( return cast(Dict[Path, PoFileStats], data) -def _set_cache_content( +def set_cache_content( obj: Dict[Path, PoFileStats], path: str = ".potodo/cache.pickle" ) -> None: os.makedirs(os.path.dirname(path), exist_ok=True) diff --git a/potodo/_github.py b/potodo/github.py similarity index 100% rename from potodo/_github.py rename to potodo/github.py diff --git a/potodo/_interactive.py b/potodo/interactive.py similarity index 98% rename from potodo/_interactive.py rename to potodo/interactive.py index 961a7b9..04dc0c9 100644 --- a/potodo/_interactive.py +++ b/potodo/interactive.py @@ -5,7 +5,7 @@ from typing import List from simple_term_menu import TerminalMenu -from potodo._po_file import is_within +from potodo.po_file import is_within IS_CURSOR_CYCLING = True IS_SCREEN_CLEARED = True diff --git a/potodo/utils/json.py b/potodo/json.py similarity index 100% rename from potodo/utils/json.py rename to potodo/json.py diff --git a/potodo/utils/logging.py b/potodo/logging.py similarity index 100% rename from potodo/utils/logging.py rename to potodo/logging.py diff --git a/potodo/_po_file.py b/potodo/po_file.py similarity index 95% rename from potodo/_po_file.py rename to potodo/po_file.py index 1131153..e0cb04d 100644 --- a/potodo/_po_file.py +++ b/potodo/po_file.py @@ -64,8 +64,8 @@ def is_within(file: Path, excluded: Path) -> bool: return excluded in file.parents or file == excluded -from potodo.utils.cache import _get_cache_file_content # noqa -from potodo.utils.cache import _set_cache_content # noqa +from potodo.cache import get_cache_file_content # noqa +from potodo.cache import set_cache_content # noqa def get_po_stats_from_repo_or_cache( @@ -106,7 +106,7 @@ def get_po_stats_from_repo_or_cache( for directory, po_files in po_files_per_directory.items() } else: - cached_files = _get_cache_file_content( + cached_files = get_cache_file_content( str(repo_path.resolve()) + "/.potodo/cache.pickle" ) po_stats_per_directory = dict() @@ -120,7 +120,7 @@ def get_po_stats_from_repo_or_cache( ): cached_files[po_file.resolve()] = cached_file = PoFileStats(po_file) po_stats_per_directory[directory].append(cached_file) - _set_cache_content( + set_cache_content( cached_files, path=str(repo_path.resolve()) + "/.potodo/cache.pickle" ) diff --git a/potodo/potodo.py b/potodo/potodo.py index 38105d0..c553fcc 100644 --- a/potodo/potodo.py +++ b/potodo/potodo.py @@ -11,17 +11,17 @@ from typing import Sequence from typing import Tuple from potodo import __version__ -from potodo._github import get_issue_reservations -from potodo._interactive import _confirmation_menu -from potodo._interactive import _directory_list_menu -from potodo._interactive import _file_list_menu -from potodo._interactive import get_dir_list -from potodo._interactive import get_files_from_dir -from potodo._po_file import get_po_stats_from_repo_or_cache -from potodo._po_file import PoFileStats -from potodo.utils.arguments_handling import check_args -from potodo.utils.json import json_dateconv -from potodo.utils.logging import setup_logging +from potodo.github import get_issue_reservations +from potodo.interactive import _confirmation_menu +from potodo.interactive import _directory_list_menu +from potodo.interactive import _file_list_menu +from potodo.interactive import get_dir_list +from potodo.interactive import get_files_from_dir +from potodo.po_file import get_po_stats_from_repo_or_cache +from potodo.po_file import PoFileStats +from potodo.arguments_handling import check_args +from potodo.json import json_dateconv +from potodo.logging import setup_logging def print_dir_stats( diff --git a/potodo/utils/__init__.py b/potodo/utils/__init__.py deleted file mode 100644 index e69de29..0000000