From fbc38cd4b228231f30e7ada118ed63ef37bd269f Mon Sep 17 00:00:00 2001 From: Abdul-Muqadim-Arbisoft Date: Wed, 28 Feb 2024 13:43:29 +0500 Subject: [PATCH 1/3] Corrected Click context management in TutorCli --- tutorwebui/cli.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tutorwebui/cli.py b/tutorwebui/cli.py index cb3e26f..aa40148 100644 --- a/tutorwebui/cli.py +++ b/tutorwebui/cli.py @@ -116,9 +116,7 @@ def shell() -> None: # Retrieve the current Click context. The context is used to manage the state # and pass around internal objects within the Click framework. ctx = click.get_current_context() - if ctx.parent and ctx.parent.command: - ctx.parent.command.commands = {} # type: ignore - + while True: try: click_repl.repl(ctx) From 081b0720fe69915d2931e7d706696fe77be630c3 Mon Sep 17 00:00:00 2001 From: Abdul-Muqadim-Arbisoft Date: Wed, 28 Feb 2024 13:55:48 +0500 Subject: [PATCH 2/3] Code reformatted --- tutorwebui/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutorwebui/cli.py b/tutorwebui/cli.py index aa40148..ef4209a 100644 --- a/tutorwebui/cli.py +++ b/tutorwebui/cli.py @@ -116,7 +116,7 @@ def shell() -> None: # Retrieve the current Click context. The context is used to manage the state # and pass around internal objects within the Click framework. ctx = click.get_current_context() - + while True: try: click_repl.repl(ctx) From 0292f9e935ca64311e8769beba9dd4dda3f8b715 Mon Sep 17 00:00:00 2001 From: Abdul-Muqadim-Arbisoft Date: Tue, 26 Mar 2024 12:06:11 +0500 Subject: [PATCH 3/3] added changelog entry --- ...20240326_115811_abdul.muqadim_fix_click_context_management.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/20240326_115811_abdul.muqadim_fix_click_context_management.md diff --git a/changelog.d/20240326_115811_abdul.muqadim_fix_click_context_management.md b/changelog.d/20240326_115811_abdul.muqadim_fix_click_context_management.md new file mode 100644 index 0000000..3e18756 --- /dev/null +++ b/changelog.d/20240326_115811_abdul.muqadim_fix_click_context_management.md @@ -0,0 +1 @@ +- [Improvement] This is a non-breaking change. Removed unnecessary command clearing in context parent, simplifying the context handling. (by @Abdul-Muqadim-Arbisoft)