diff --git a/src/photo_tools/cli.py b/src/photo_tools/cli.py index b332e75..0c97f4a 100644 --- a/src/photo_tools/cli.py +++ b/src/photo_tools/cli.py @@ -1,15 +1,15 @@ import typer from dotenv import load_dotenv -from photo_tools.clean_unpaired_raws import clean_unpaired_raws -from photo_tools.cli_errors import handle_cli_errors -from photo_tools.cli_reporter import make_reporter +from photo_tools.cli_support.cli_errors import handle_cli_errors +from photo_tools.cli_support.cli_reporter import make_reporter +from photo_tools.commands.clean_unpaired_raws import clean_unpaired_raws +from photo_tools.commands.optimise import optimise +from photo_tools.commands.organise_by_date import organise_by_date +from photo_tools.commands.separate_raws import separate_raws from photo_tools.core.dependencies import validate_feature from photo_tools.exceptions import MissingDependencyError from photo_tools.logging_config import setup_logging -from photo_tools.optimise import optimise -from photo_tools.organise_by_date import organise_by_date -from photo_tools.separate_raws import separate_raws app = typer.Typer(help="CLI tools for organising and optimising photography workflows.") diff --git a/src/photo_tools/cli_support/__init__.py b/src/photo_tools/cli_support/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/photo_tools/cli_errors.py b/src/photo_tools/cli_support/cli_errors.py similarity index 100% rename from src/photo_tools/cli_errors.py rename to src/photo_tools/cli_support/cli_errors.py diff --git a/src/photo_tools/cli_reporter.py b/src/photo_tools/cli_support/cli_reporter.py similarity index 100% rename from src/photo_tools/cli_reporter.py rename to src/photo_tools/cli_support/cli_reporter.py diff --git a/src/photo_tools/commands/__init__.py b/src/photo_tools/commands/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/photo_tools/clean_unpaired_raws.py b/src/photo_tools/commands/clean_unpaired_raws.py similarity index 100% rename from src/photo_tools/clean_unpaired_raws.py rename to src/photo_tools/commands/clean_unpaired_raws.py diff --git a/src/photo_tools/optimise.py b/src/photo_tools/commands/optimise.py similarity index 100% rename from src/photo_tools/optimise.py rename to src/photo_tools/commands/optimise.py diff --git a/src/photo_tools/organise_by_date.py b/src/photo_tools/commands/organise_by_date.py similarity index 100% rename from src/photo_tools/organise_by_date.py rename to src/photo_tools/commands/organise_by_date.py diff --git a/src/photo_tools/separate_raws.py b/src/photo_tools/commands/separate_raws.py similarity index 100% rename from src/photo_tools/separate_raws.py rename to src/photo_tools/commands/separate_raws.py diff --git a/tests/test_clean_unpaired_raws.py b/tests/test_clean_unpaired_raws.py index 3ee68a4..51360f5 100644 --- a/tests/test_clean_unpaired_raws.py +++ b/tests/test_clean_unpaired_raws.py @@ -1,4 +1,4 @@ -from photo_tools.clean_unpaired_raws import clean_unpaired_raws +from photo_tools.commands.clean_unpaired_raws import clean_unpaired_raws def noop_report(level: str, message: str) -> None: diff --git a/tests/test_cli.py b/tests/test_cli.py index b05211b..2e82ada 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -43,7 +43,7 @@ def test_organise_by_date_command_moves_file(tmp_path, monkeypatch): monkeypatch.setattr("shutil.which", lambda _: "/usr/bin/fake-exiftool") monkeypatch.setattr( - "photo_tools.organise_by_date.get_image_date", + "photo_tools.commands.organise_by_date.get_image_date", lambda _: datetime(2024, 5, 17), ) @@ -68,7 +68,7 @@ def test_organise_by_date_command_dry_run_does_not_move_file(tmp_path, monkeypat monkeypatch.setattr("shutil.which", lambda _: "/usr/bin/fake-exiftool") monkeypatch.setattr( - "photo_tools.organise_by_date.get_image_date", + "photo_tools.commands.organise_by_date.get_image_date", lambda _: datetime(2024, 5, 17), ) diff --git a/tests/test_optimise.py b/tests/test_optimise.py index 69e4da9..d93ac66 100644 --- a/tests/test_optimise.py +++ b/tests/test_optimise.py @@ -1,6 +1,6 @@ from PIL import Image -from photo_tools.optimise import MAX_WIDTH, optimise +from photo_tools.commands.optimise import MAX_WIDTH, optimise def noop_report(level: str, message: str) -> None: diff --git a/tests/test_organise_by_date.py b/tests/test_organise_by_date.py index 141f164..fdfabbf 100644 --- a/tests/test_organise_by_date.py +++ b/tests/test_organise_by_date.py @@ -1,6 +1,6 @@ from datetime import datetime -from photo_tools.organise_by_date import organise_by_date +from photo_tools.commands.organise_by_date import organise_by_date def noop_report(level: str, message: str) -> None: @@ -17,7 +17,7 @@ def test_dry_run_does_not_move_files(tmp_path, monkeypatch): image_file.write_text("fake image content") monkeypatch.setattr( - "photo_tools.organise_by_date.get_image_date", + "photo_tools.commands.organise_by_date.get_image_date", lambda _: datetime(2024, 5, 17), ) @@ -42,7 +42,7 @@ def test_moves_file_into_date_folder(tmp_path, monkeypatch): image_file.write_text("fake image content") monkeypatch.setattr( - "photo_tools.organise_by_date.get_image_date", + "photo_tools.commands.organise_by_date.get_image_date", lambda _: datetime(2024, 5, 17), ) @@ -72,7 +72,7 @@ def test_skips_unsupported_files(tmp_path, monkeypatch): unsupported_file.write_text("not an image") monkeypatch.setattr( - "photo_tools.organise_by_date.get_image_date", + "photo_tools.commands.organise_by_date.get_image_date", lambda _: datetime(2024, 5, 17), ) @@ -100,7 +100,7 @@ def test_skips_files_with_missing_date_metadata(tmp_path, monkeypatch): image_file.write_text("fake image content") monkeypatch.setattr( - "photo_tools.organise_by_date.get_image_date", + "photo_tools.commands.organise_by_date.get_image_date", lambda _: (_ for _ in ()).throw(ValueError("No DateTimeOriginal")), ) @@ -133,7 +133,7 @@ def test_moves_files_into_separate_date_folders(tmp_path, monkeypatch): } monkeypatch.setattr( - "photo_tools.organise_by_date.get_image_date", + "photo_tools.commands.organise_by_date.get_image_date", lambda file_path: dates[file_path.name], ) @@ -165,7 +165,7 @@ def test_skips_file_when_destination_already_exists(tmp_path, monkeypatch): existing_file.write_text("existing file") monkeypatch.setattr( - "photo_tools.organise_by_date.get_image_date", + "photo_tools.commands.organise_by_date.get_image_date", lambda _: datetime(2024, 5, 17), ) diff --git a/tests/test_separate_raws.py b/tests/test_separate_raws.py index f4dd521..7b78205 100644 --- a/tests/test_separate_raws.py +++ b/tests/test_separate_raws.py @@ -1,4 +1,4 @@ -from photo_tools.separate_raws import separate_raws +from photo_tools.commands.separate_raws import separate_raws def noop_report(level: str, message: str) -> None: