diff options
| author | Chris McDonough <chrism@plope.com> | 2010-12-23 18:09:03 -0500 |
|---|---|---|
| committer | Chris McDonough <chrism@plope.com> | 2010-12-23 18:09:03 -0500 |
| commit | e6f45b05eccc86f0f3a390748df26e34b8fe06c6 (patch) | |
| tree | 0ae5629246a0aab1e0680a55c951eb1f8d3c5f82 | |
| parent | 169711bd49e862c27279ec60ef841ed132d24ac1 (diff) | |
| download | pyramid-e6f45b05eccc86f0f3a390748df26e34b8fe06c6.tar.gz pyramid-e6f45b05eccc86f0f3a390748df26e34b8fe06c6.tar.bz2 pyramid-e6f45b05eccc86f0f3a390748df26e34b8fe06c6.zip | |
- The name ``registry`` was not available in the ``paster pshell``
environment under IPython.
| -rw-r--r-- | CHANGES.txt | 6 | ||||
| -rw-r--r-- | pyramid/paster.py | 3 | ||||
| -rw-r--r-- | 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) |
