From b3ce2bd9dd45b6d1845723364603467e70474034 Mon Sep 17 00:00:00 2001 From: Zsolt Ero Date: Wed, 3 Jan 2024 22:12:57 +0100 Subject: [PATCH] messages --- scripts/http_host/host_manager.py | 10 +++++----- scripts/http_host/http_host_lib/utils.py | 6 +++--- scripts/tile_gen/extract_mbtiles/extract_mbtiles.py | 2 +- scripts/tile_gen/shrink_btrfs/shrink_btrfs.py | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/scripts/http_host/host_manager.py b/scripts/http_host/host_manager.py index dc07f9b..55dc836 100755 --- a/scripts/http_host/host_manager.py +++ b/scripts/http_host/host_manager.py @@ -46,7 +46,7 @@ def download_tileset(area: str, version: str, list_versions: bool, runs_dir: Pat print('running download_tileset') if area not in {'planet', 'monaco'}: - sys.exit('Please specify area: "planet" or "monaco"') + sys.exit(' please specify area: "planet" or "monaco"') r = requests.get(f'https://{area}.openfreemap.com/dirs.txt') r.raise_for_status() @@ -109,12 +109,12 @@ def mount(): assert_sudo() if not DEFAULT_RUNS_DIR.exists(): - sys.exit('download_tileset needs to be run first') + sys.exit(' download_tileset needs to be run first') clean_up_mounts(MNT_DIR) create_fstab() - print('Running mount -a') + print(' running mount -a') subprocess.run(['mount', '-a'], check=True) clean_up_mounts(MNT_DIR) @@ -136,7 +136,7 @@ def set_latest_versions(): assert_sudo() if not MNT_DIR.exists(): - sys.exit('mount needs to be run first') + sys.exit(' mount needs to be run first') return set_tileset_versions() @@ -153,7 +153,7 @@ def nginx_sync(): assert_sudo() if not MNT_DIR.exists(): - sys.exit('mount needs to be run first') + sys.exit(' mount needs to be run first') write_nginx_config() diff --git a/scripts/http_host/http_host_lib/utils.py b/scripts/http_host/http_host_lib/utils.py index 2042ce5..bd006fd 100644 --- a/scripts/http_host/http_host_lib/utils.py +++ b/scripts/http_host/http_host_lib/utils.py @@ -9,19 +9,19 @@ import requests def assert_sudo(): if os.geteuid() != 0: - sys.exit('Needs sudo') + sys.exit(' needs sudo') def assert_linux(): if not Path('/etc/fstab').exists(): - sys.exit('Needs to be run on Linux') + sys.exit(' needs to be run on Linux') def assert_single_process(): p = subprocess.run(['pgrep', '-fl', sys.argv[0]], capture_output=True, text=True) lines = [l for l in p.stdout.splitlines() if 'python' in l] if len(lines) >= 2: - sys.exit('Detected multiple processes, terminating') + sys.exit(' detected multiple processes, terminating') def download_if_size_differs(url: str, local_file: Path) -> bool: diff --git a/scripts/tile_gen/extract_mbtiles/extract_mbtiles.py b/scripts/tile_gen/extract_mbtiles/extract_mbtiles.py index 44d4cf3..4be1a04 100755 --- a/scripts/tile_gen/extract_mbtiles/extract_mbtiles.py +++ b/scripts/tile_gen/extract_mbtiles/extract_mbtiles.py @@ -24,7 +24,7 @@ def cli(mbtiles_path: Path, dir_path: Path): """ if dir_path.exists() and any(dir_path.iterdir()): - sys.exit('Dir not empty') + sys.exit(' dir not empty') dir_path.mkdir(exist_ok=True) diff --git a/scripts/tile_gen/shrink_btrfs/shrink_btrfs.py b/scripts/tile_gen/shrink_btrfs/shrink_btrfs.py index c9864f8..4735211 100755 --- a/scripts/tile_gen/shrink_btrfs/shrink_btrfs.py +++ b/scripts/tile_gen/shrink_btrfs/shrink_btrfs.py @@ -33,7 +33,7 @@ def cli(btrfs_img: Path): """ if os.geteuid() != 0: - sys.exit('Needs sudo') + sys.exit(' needs sudo') current_dir = Path.cwd()