From 5a76bc4ee203780bcd0d8f3b66b0db2096dbc50d Mon Sep 17 00:00:00 2001 From: ElectronixTM Date: Sun, 16 Mar 2025 04:28:25 +0300 Subject: [PATCH] =?UTF-8?q?fix:=20=D0=BF=D0=BE=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=B8=D0=BB=20=D0=BE=D0=BF=D0=B5=D1=87=D0=B0=D1=82=D0=BA=D0=B8?= =?UTF-8?q?=20=D0=B2=20help,=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB?= =?UTF-8?q?=20=D0=BE=D0=B1=D1=80=D0=B5=D0=B7=D0=BA=D1=83=20=D0=BF=D1=80?= =?UTF-8?q?=D0=BE=D0=B1=D0=B5=D0=BB=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/interactive.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/interactive.py b/src/interactive.py index 7f5973c..d51e528 100644 --- a/src/interactive.py +++ b/src/interactive.py @@ -30,16 +30,20 @@ def interactve_mode(rulebook: Rulebook): elif user_input.startswith("e:"): return elif user_input.startswith(":"): - print(rulebook.transform(user_input[1:])) + print( + rulebook.transform( + user_input[1:].strip(" \t") + ) + ) else: - print(rulebook.transform(user_input)) + print(rulebook.transform(user_input.strip(" \t"))) def print_help(): - print("you can type expressions right after prompt. However there is some " - 'reserved chars: "h:" to print help, "v:" to run next expression in ' + print("You can type expressions right after prompt. However there are some " + 'reserved sequences: "h:" to print help, "v:" to run next expression in ' 'verbose mode, "r:" to view rules, "e:" to exit, and ":" to imidiately ' - 'start prompt.Can be omited if your prompt doesn\'t start from' - 'reserved sequence. Note that your input after "h:", "e:" and "r:" will ' + 'start prompt (can be omitted if your prompt doesn\'t start from ' + 'reserved sequence). Note that your input after "h:", "e:" and "r:" will ' 'be ignored') def _print_rules(rules: list[Rule]) -> None: