Jesse Dhillon
2015-10-07 1c1c908c2cf619461611054672a1c027276398d7
populate pshell's env_help with docstring of values
3 files modified
9 ■■■■ changed files
CONTRIBUTORS.txt 2 ●●●●● patch | view | raw | blame | history
pyramid/scripts/pshell.py 5 ●●●● patch | view | raw | blame | history
pyramid/tests/test_scripts/test_pshell.py 2 ●●●●● patch | view | raw | blame | history
CONTRIBUTORS.txt
@@ -250,3 +250,5 @@
- Karen Dalton, 2015/06/01
- Igor Stroh, 2015/06/10
- Jesse Dhillon, 2015/10/07
pyramid/scripts/pshell.py
@@ -122,7 +122,10 @@
            # 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)
pyramid/tests/test_scripts/test_pshell.py
@@ -289,6 +289,7 @@
        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)
@@ -302,6 +303,7 @@
            'request':self.bootstrap.request,
            'root_factory':self.bootstrap.root_factory,
            'a':1,
            'none': None,
        })
        self.assertTrue(self.bootstrap.closer.called)
        self.assertTrue(shell.help)