forked from AFPy/potodo
Removed utils folder
This commit is contained in:
parent
63712cc7ac
commit
10bcd43f9d
|
@ -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)
|
|
@ -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
|
|
@ -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"
|
||||
)
|
||||
|
|
@ -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(
|
||||
|
|
Loading…
Reference in New Issue