From f4c5cccbd2948006c6f19fccc1d37476a58fb491 Mon Sep 17 00:00:00 2001 From: king-millez Date: Tue, 30 Apr 2024 19:22:36 +1000 Subject: [PATCH] Fix Poetry entrypoint --- main.py | 4 ---- pyproject.toml | 2 +- snapmap_archiver/__main__.py | 15 +++++++-------- 3 files changed, 8 insertions(+), 13 deletions(-) delete mode 100644 main.py diff --git a/main.py b/main.py deleted file mode 100644 index e0abfb8..0000000 --- a/main.py +++ /dev/null @@ -1,4 +0,0 @@ -import snapmap_archiver - -if __name__ == "__main__": - snapmap_archiver.main() diff --git a/pyproject.toml b/pyproject.toml index ab76490..a585850 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,7 +16,7 @@ loguru = "^0.7.2" [tool.poetry.dev-dependencies] [tool.poetry.scripts] -snapmap-archiver = "snapmap_archiver:main" +snapmap-archiver = "snapmap_archiver.__main__:main" [build-system] requires = ["poetry-core>=1.0.0"] diff --git a/snapmap_archiver/__main__.py b/snapmap_archiver/__main__.py index b167b75..9dc8ec4 100644 --- a/snapmap_archiver/__main__.py +++ b/snapmap_archiver/__main__.py @@ -4,14 +4,9 @@ from loguru import logger from loguru._logger import Logger -from snapmap_archiver import ( - DEFAULT_RADIUS, - DEFAULT_WRITE_JSON, - DEFAULT_ZOOM_DEPTH, - ISSUES_URL, - SNAP_PATTERN, - default_output_dir, -) +from snapmap_archiver import (DEFAULT_RADIUS, DEFAULT_WRITE_JSON, + DEFAULT_ZOOM_DEPTH, ISSUES_URL, SNAP_PATTERN, + default_output_dir) from snapmap_archiver.coordinates import Coordinates from snapmap_archiver.SnapmapArchiver import SnapmapArchiver @@ -124,6 +119,10 @@ def main(): Coordinates(location) for location, in (args.location if args.location else []) ] + if not valid_snap_ids and not coordinates: + logger.error('Some kind of input is required. Run [snapmap-archiver -h] for help.') + sys.exit(1) + sm_archiver = SnapmapArchiver( logger=logger, # type: ignore output_dir=args.output_dir,