diff options
| author | Chris McDonough <chrism@agendaless.com> | 2009-11-02 16:40:30 +0000 |
|---|---|---|
| committer | Chris McDonough <chrism@agendaless.com> | 2009-11-02 16:40:30 +0000 |
| commit | c793f910ba4055d84cd4cff536a8b58c2f07d87f (patch) | |
| tree | 9dc18154e693abebccb804b9c1d9c7a025823c4b /repoze/bfg/paster.py | |
| parent | e218b2a4b749d5e7105ffd28f2c02f09b151059b (diff) | |
| download | pyramid-c793f910ba4055d84cd4cff536a8b58c2f07d87f.tar.gz pyramid-c793f910ba4055d84cd4cff536a8b58c2f07d87f.tar.bz2 pyramid-c793f910ba4055d84cd4cff536a8b58c2f07d87f.zip | |
- Compound statements that used an assignment entered into in an
interactive IPython session invoked via ``paster bfgshell`` no
longer fail to mutate the shell namespace correctly. For example,
this set of statements used to fail::
In [2]: def bar(x): return x
...:
In [3]: list(bar(x) for x in 'abc')
Out[3]: NameError: 'bar'
In this release, the ``bar`` function is found and the correct
output is now sent to the console. Thanks to Daniel Holth for the
patch.
Diffstat (limited to 'repoze/bfg/paster.py')
| -rw-r--r-- | repoze/bfg/paster.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/repoze/bfg/paster.py b/repoze/bfg/paster.py index de5dc1f79..e57d17c1b 100644 --- a/repoze/bfg/paster.py +++ b/repoze/bfg/paster.py @@ -10,9 +10,9 @@ from paste.util.template import paste_script_template_renderer from repoze.bfg.scripting import get_root try: - from IPython.Shell import IPShellEmbed + from IPython.Shell import IPShell except ImportError: - IPShellEmbed = None + IPShell = None class StarterProjectTemplate(Template): @@ -79,7 +79,7 @@ class BFGShellCommand(Command): interact = (interact,) # for testing loadapp = (loadapp,) # for testing - IPShellEmbed = IPShellEmbed # for testing + IPShell = IPShell # for testing verbose = 3 def command(self): @@ -89,11 +89,11 @@ class BFGShellCommand(Command): config_file, section_name = self.args app = get_app(config_file, section_name, loadapp=self.loadapp[0]) root, closer = get_root(app) - if self.IPShellEmbed is not None and not self.options.disable_ipython: - shell = self.IPShellEmbed(argv=self.args) - shell.set_banner(shell.IP.BANNER + '\n\n' + banner) + if self.IPShell is not None and not self.options.disable_ipython: try: - shell(local_ns={'root':root}, global_ns={}) + shell = self.IPShell(argv=[], user_ns={'root':root}) + shell.IP.BANNER = shell.IP.BANNER + '\n\n' + banner + shell.mainloop() finally: closer() else: |
