From 52a4aabd679a9e9e91a579d1546abd5dfbe2931d Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Thu, 23 Dec 2010 19:01:22 -0500 Subject: share shell globals between interact and IPShell --- pyramid/paster.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pyramid/paster.py b/pyramid/paster.py index 0a0b65fe0..c8bc36e80 100644 --- a/pyramid/paster.py +++ b/pyramid/paster.py @@ -121,18 +121,17 @@ class PShellCommand(Command): self.logging_file_config(config_file) app = self.get_app(config_file, section_name, loadapp=self.loadapp[0]) root, closer = self.get_root(app) + shell_globals = {'root':root, 'registry':app.registry} if IPShell is not None and not self.options.disable_ipython: try: - shell = IPShell(argv=[], user_ns={'root':root, - 'registry':app.registry}) + shell = IPShell(argv=[], user_ns=shell_globals) shell.IP.BANNER = shell.IP.BANNER + '\n\n' + banner shell.mainloop() finally: closer() else: try: - self.interact[0](banner, - local={'root':root,'registry':app.registry}) + self.interact[0](banner, local=shell_globals) finally: closer() -- cgit v1.2.3