diff --git a/Parsing ZARAHOME/src/xlsx_recorder.py b/Parsing ZARAHOME/src/xlsx_recorder.py index b40753e..9756f12 100644 --- a/Parsing ZARAHOME/src/xlsx_recorder.py +++ b/Parsing ZARAHOME/src/xlsx_recorder.py @@ -6,9 +6,18 @@ import re, json, math, logging, requests, os log = logging.getLogger("recorder") -# ─────────────────────── настройки ─────────────────────── -SEND_JSON = False # отправка POST -SAVE_JSON = True # сохранять копию JSON +# ── интерактивный выбор режима ────────────────────────────── +def ask(flag_name: str, default: str = "1") -> bool: + """Спрашивает 0/1 в консоли; пустой ввод → default.""" + try: + val = input(f"{flag_name} (1 – yes, 0 – no) [{default}]: ").strip() or default + except EOFError: # если запустили без tty (cron) + val = default + return val == "1" + +SEND_JSON = ask("SEND_JSON") # 1 или 0 +SAVE_JSON = ask("SAVE_JSON") # 1 или 0 + POST_URL = "http://localhost:3005/parser/data"