Skip to content

Commit

Permalink
Fix circular import
Browse files Browse the repository at this point in the history
  • Loading branch information
kinuax committed May 7, 2024
1 parent 8acd02b commit 58cb092
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
10 changes: 9 additions & 1 deletion rolabesti/config/settings.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from enum import Enum
from pathlib import Path
from typing import Type

from platformdirs import user_config_path, user_data_path, user_music_path, user_documents_path
Expand All @@ -10,11 +11,18 @@
TomlConfigSettingsSource,
)

from .utils import create_directories
from rolabesti import __app_name__
from rolabesti.models import Sortings


def create_directories(directories: list[Path]) -> None:
"""Ensure directories are created."""
for path in directories:
if not path.exists():
path.mkdir(parents=True)
print(f"created {path}") # TODO remove


max_overlap_length = 30
copy_path = user_documents_path()
music_path = user_music_path()
Expand Down
9 changes: 0 additions & 9 deletions rolabesti/config/utils.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
from functools import lru_cache
from pathlib import Path

from pydantic import ValidationError
from tomlkit import dumps

from .settings import Settings, toml_file


def create_directories(directories: list[Path]) -> None:
# Ensure directories are created.
for path in directories:
if not path.exists():
path.mkdir(parents=True)
print(f"created {path}") # TODO remove


@lru_cache
def get_settings() -> Settings:
"""Return the current settings."""
Expand Down

0 comments on commit 58cb092

Please sign in to comment.