From 0fd491d5eb3f69cea16106b6f885d6557e469041 Mon Sep 17 00:00:00 2001 From: Abdul-Muqadim-Arbisoft <139064778+Abdul-Muqadim-Arbisoft@users.noreply.github.com> Date: Tue, 26 Mar 2024 12:48:27 +0500 Subject: [PATCH] fix: corrected click context management in TutorCli, resolves #14 * Corrected Click context management in TutorCli * Code reformatted * added changelog entry --- ...0240326_115811_abdul.muqadim_fix_click_context_management.md | 1 + tutorwebui/cli.py | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) 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) diff --git a/tutorwebui/cli.py b/tutorwebui/cli.py index cb3e26f..ef4209a 100644 --- a/tutorwebui/cli.py +++ b/tutorwebui/cli.py @@ -116,8 +116,6 @@ 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: