From 3e63fa25238bf9b883cffda038b1d600dbb0d69f Mon Sep 17 00:00:00 2001 From: Karim shoair Date: Thu, 19 Jun 2025 04:03:13 +0300 Subject: [PATCH] fix(shell): Hide the automatic tips and solve the namespace issue --- scrapling/core/shell.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/scrapling/core/shell.py b/scrapling/core/shell.py index 30f8a4c..a70458b 100644 --- a/scrapling/core/shell.py +++ b/scrapling/core/shell.py @@ -525,16 +525,17 @@ Type 'exit' or press Ctrl+D to exit. def start(self): """Start the interactive shell""" - # Create the shell - ipython_shell = InteractiveShellEmbed(banner1=self.banner(), exit_msg="Bye Bye") - - # Store reference to the shell - self.shell = ipython_shell - # Get our namespace with application objects namespace = self.get_namespace() + ipython_shell = InteractiveShellEmbed( + banner1=self.banner(), + banner2="", + enable_tip=False, + exit_msg="Bye Bye", + user_ns=namespace, + ) + self.shell = ipython_shell - ipython_shell.user_ns.update(namespace) # If a command was provided, execute it and exit if self.code: log.info(f"Executing provided code: {self.code}") @@ -544,4 +545,4 @@ Type 'exit' or press Ctrl+D to exit. log.error(f"Error executing initial code: {e}") return - ipython_shell(local_ns=namespace) + ipython_shell()