From c482d9af2be5026b8111bdf0a998811d0c867c30 Mon Sep 17 00:00:00 2001 From: Thor Whalen <1906276+thorwhalen@users.noreply.github.com> Date: Fri, 4 Sep 2026 13:02:47 +0200 Subject: [PATCH] Remove dead argh __main__ blocks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Part of the fleet-wide argh removal (i2mint/cw#29). Neither block was reachable: this repo has no packaging metadata at all, so argh was never declared and never installed alongside these scripts. Both functions remain importable and callable; only the argh entry points go. metar_acquisition.py's block was additionally broken on its own terms — it built a coercing wrapper (`.split(',')`, `int()`) and then dispatched the *original*, uncoerced function, so the coercion never ran; its `except ImportError` fallback called the rebound name with no arguments. It is preserved verbatim as the motivating anti-example in cw's `cw/ingress.py` (i2mint/cw#37) before removal here, per #29's acceptance criteria. Refs i2mint/cw#29 Claude-Session: https://claude.ai/code/session_01K6LB3AwUmKDxaFNZ2NqPGr --- examples/airport_weather/metar_acquisition.py | 21 ------------------- examples/convert_images/convert_images.py | 4 ---- 2 files changed, 25 deletions(-) diff --git a/examples/airport_weather/metar_acquisition.py b/examples/airport_weather/metar_acquisition.py index e41f3a2..dae24b8 100644 --- a/examples/airport_weather/metar_acquisition.py +++ b/examples/airport_weather/metar_acquisition.py @@ -75,24 +75,3 @@ def acquire_metar_data(airport_ids=DFLT_AIRPORT_IDS, hours_before_now=DFLT_HOURS def get_all_data_as_df(): return pd.DataFrame(store.values()) - - -if __name__ == '__main__': - try: - import argh - - _acquire_metar_data = acquire_metar_data - - - def acquire_metar_data(airport_ids=DFLT_AIRPORT_IDS, hours_before_now=DFLT_HOURS_BEFORE_NOW): - airport_ids = airport_ids.split(',') - hours_before_now = int(hours_before_now) - return _acquire_metar_data(airport_ids, hours_before_now) - - - argh.dispatch_command(_acquire_metar_data) - - except ImportError: - print("You don't have argh: Pity (you should really ") - - acquire_metar_data() diff --git a/examples/convert_images/convert_images.py b/examples/convert_images/convert_images.py index 9173d93..44c4ae2 100644 --- a/examples/convert_images/convert_images.py +++ b/examples/convert_images/convert_images.py @@ -51,7 +51,3 @@ def convert_images(source_dir, target_dir=None, source_ext='.heic', target_ext=' target[target_k] = source[source_k] except BaseException as e: print(f"!!! Problem with {source_k}: {e}") - -if __name__ == '__main__': - import argh # To install: pip install argh - argh.dispatch_command(convert_images) \ No newline at end of file