From e6f45b05eccc86f0f3a390748df26e34b8fe06c6 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Thu, 23 Dec 2010 18:09:03 -0500 Subject: - The name ``registry`` was not available in the ``paster pshell`` environment under IPython. --- CHANGES.txt | 6 ++++++ pyramid/paster.py | 3 ++- pyramid/tests/test_paster.py | 3 ++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 8532ebec8..eef001f73 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,6 +1,12 @@ Next release ============ +Bug Fixes +--------- + +- The name ``registry`` was not available in the ``paster pshell`` + environment under IPython. + Features -------- diff --git a/pyramid/paster.py b/pyramid/paster.py index bd0e13413..0a0b65fe0 100644 --- a/pyramid/paster.py +++ b/pyramid/paster.py @@ -123,7 +123,8 @@ class PShellCommand(Command): root, closer = self.get_root(app) if IPShell is not None and not self.options.disable_ipython: try: - shell = IPShell(argv=[], user_ns={'root':root}) + shell = IPShell(argv=[], user_ns={'root':root, + 'registry':app.registry}) shell.IP.BANNER = shell.IP.BANNER + '\n\n' + banner shell.mainloop() finally: diff --git a/pyramid/tests/test_paster.py b/pyramid/tests/test_paster.py index 41e6dc441..e2478ac4f 100644 --- a/pyramid/tests/test_paster.py +++ b/pyramid/tests/test_paster.py @@ -50,7 +50,8 @@ class TestPShellCommand(unittest.TestCase): pushed = app.threadlocal_manager.pushed[0] self.assertEqual(pushed['registry'], dummy_registry) self.assertEqual(pushed['request'].registry, dummy_registry) - self.assertEqual(dummy_shell_factory.shell.local_ns,{'root':dummy_root}) + self.assertEqual(dummy_shell_factory.shell.local_ns, + {'root':dummy_root, 'registry':dummy_registry}) self.assertEqual(dummy_shell_factory.shell.global_ns, {}) self.failUnless('\n\n' in dummy_shell_factory.shell.IP.BANNER) self.assertEqual(len(app.threadlocal_manager.popped), 1) -- cgit v1.2.3