From c6e684c83027a950cd613f771f7028a9e2c5a921 Mon Sep 17 00:00:00 2001 From: va1is Date: Tue, 5 Aug 2025 17:26:25 +0300 Subject: [PATCH] =?UTF-8?q?=D1=81=D0=B4=D0=B5=D0=BB=D0=B0=D1=82=D1=8C,=20?= =?UTF-8?q?=D1=87=D1=82=D0=BE=D0=B1=D1=8B=20=D0=BF=D1=80=D0=B8=20=D0=BA?= =?UTF-8?q?=D0=B0=D0=B6=D0=B4=D0=BE=D0=BC=20=D0=B7=D0=B0=D0=BF=D1=83=D1=81?= =?UTF-8?q?=D0=BA=D0=B5=20=D0=BF=D0=B0=D1=80=D1=81=D0=B5=D1=80=D0=B0=20?= =?UTF-8?q?=D0=B2=D1=8B=20=D0=B2=D1=80=D1=83=D1=87=D0=BD=D1=83=D1=8E=20?= =?UTF-8?q?=D1=80=D0=B5=D1=88=D0=B0=D0=BB=D0=B8,=20=D0=BD=D1=83=D0=B6?= =?UTF-8?q?=D0=BD=D0=BE=20=D0=BB=D0=B8=20=D0=BE=D1=82=D0=BF=D1=80=D0=B0?= =?UTF-8?q?=D0=B2=D0=BB=D1=8F=D1=82=D1=8C=20POST=20(SEND=5FJSON)=20=D0=B8/?= =?UTF-8?q?=D0=B8=D0=BB=D0=B8=20=D1=81=D0=BE=D1=85=D1=80=D0=B0=D0=BD=D1=8F?= =?UTF-8?q?=D1=82=D1=8C=20=D0=BA=D0=BE=D0=BF=D0=B8=D1=8E=20JSON=20(SAVE=5F?= =?UTF-8?q?JSON)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Parsing ZARAHOME/src/xlsx_recorder.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) 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"