Karim shoair commited on
Commit
f94c511
·
1 Parent(s): 9942edd

fix(shell): Hide the automatic tips and solve the namespace issue

Browse files
Files changed (1) hide show
  1. scrapling/core/shell.py +9 -8
scrapling/core/shell.py CHANGED
@@ -525,16 +525,17 @@ Type 'exit' or press Ctrl+D to exit.
525
 
526
  def start(self):
527
  """Start the interactive shell"""
528
- # Create the shell
529
- ipython_shell = InteractiveShellEmbed(banner1=self.banner(), exit_msg="Bye Bye")
530
-
531
- # Store reference to the shell
532
- self.shell = ipython_shell
533
-
534
  # Get our namespace with application objects
535
  namespace = self.get_namespace()
 
 
 
 
 
 
 
 
536
 
537
- ipython_shell.user_ns.update(namespace)
538
  # If a command was provided, execute it and exit
539
  if self.code:
540
  log.info(f"Executing provided code: {self.code}")
@@ -544,4 +545,4 @@ Type 'exit' or press Ctrl+D to exit.
544
  log.error(f"Error executing initial code: {e}")
545
  return
546
 
547
- ipython_shell(local_ns=namespace)
 
525
 
526
  def start(self):
527
  """Start the interactive shell"""
 
 
 
 
 
 
528
  # Get our namespace with application objects
529
  namespace = self.get_namespace()
530
+ ipython_shell = InteractiveShellEmbed(
531
+ banner1=self.banner(),
532
+ banner2="",
533
+ enable_tip=False,
534
+ exit_msg="Bye Bye",
535
+ user_ns=namespace,
536
+ )
537
+ self.shell = ipython_shell
538
 
 
539
  # If a command was provided, execute it and exit
540
  if self.code:
541
  log.info(f"Executing provided code: {self.code}")
 
545
  log.error(f"Error executing initial code: {e}")
546
  return
547
 
548
+ ipython_shell()