Skip to content

Commit

Permalink
client: Add additional_namespace to interactive
Browse files Browse the repository at this point in the history
  • Loading branch information
netanelc305 committed Jul 12, 2023
1 parent be19b8f commit a6574f1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/rpcclient/rpcclient/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ def freeing(self, symbol):
if symbol:
self.symbols.free(symbol)

def interactive(self):
def interactive(self, additional_namespace: typing.Mapping = None):
""" Start an interactive shell """
sys.argv = ['a']
c = Config()
Expand All @@ -455,6 +455,8 @@ def interactive(self):
c.TerminalInteractiveShell.autoformatter = None
namespace = globals()
namespace.update({'p': self, 'symbols': self.symbols})
if additional_namespace is not None:
namespace.update(additional_namespace)
print(USAGE)
IPython.start_ipython(config=c, user_ns=namespace)

Expand Down

0 comments on commit a6574f1

Please sign in to comment.