Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

populate pshell's env_help with docstring of values #1929

Merged
merged 1 commit into from
Oct 15, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CONTRIBUTORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -250,3 +250,5 @@ Contributors
- Karen Dalton, 2015/06/01

- Igor Stroh, 2015/06/10

- Jesse Dhillon, 2015/10/07
5 changes: 4 additions & 1 deletion pyramid/scripts/pshell.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,10 @@ def run(self, shell=None):
# remove any objects from default help that were overidden
for k, v in env.items():
if k not in orig_env or env[k] != orig_env[k]:
env_help[k] = v
if getattr(v, '__doc__', False):
env_help[k] = v.__doc__.replace("\n", " ")
else:
env_help[k] = v

# load the pshell section of the ini file
env.update(self.loaded_objects)
Expand Down
2 changes: 2 additions & 0 deletions pyramid/tests/test_scripts/test_pshell.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ def test_command_setup(self):
def setup(env):
env['a'] = 1
env['root'] = 'root override'
env['none'] = None
self.config_factory.items = [('setup', setup)]
shell = dummy.DummyShell()
command.run(shell)
Expand All @@ -302,6 +303,7 @@ def setup(env):
'request':self.bootstrap.request,
'root_factory':self.bootstrap.root_factory,
'a':1,
'none': None,
})
self.assertTrue(self.bootstrap.closer.called)
self.assertTrue(shell.help)
Expand Down