Steve Piercy
2016-12-11 ba93133ee29ecacad04770af7dffc39f2b2d3aff
update ptweens with config_vars argument
- replace self.args with self.args.config_uri
2 files modified
16 ■■■■ changed files
pyramid/scripts/ptweens.py 14 ●●●● patch | view | raw | blame | history
pyramid/tests/test_scripts/test_ptweens.py 2 ●●● patch | view | raw | blame | history
pyramid/scripts/ptweens.py
@@ -36,6 +36,14 @@
                        default=None,
                        help='The URI to the configuration file.')
    parser.add_argument(
        'config_vars',
        nargs='*',
        default=(),
        help='Arbitrary options to override those in the [app:main] section '
             'of the configuration file.',
        )
    stdout = sys.stdout
    bootstrap = (bootstrap,) # testing
@@ -62,11 +70,11 @@
        self.out(fmt % ('-', MAIN))
    def run(self):
        if not self.args:
        if not self.args.config_uri:
            self.out('Requires a config file argument')
            return 2
        config_uri = self.args[0]
        env = self.bootstrap[0](config_uri, options=parse_vars(self.args[1:]))
        config_uri = self.args.config_uri
        env = self.bootstrap[0](config_uri, options=parse_vars(self.args.config_vars))
        registry = env['registry']
        tweens = self._get_tweens(registry)
        if tweens is not None:
pyramid/tests/test_scripts/test_ptweens.py
@@ -9,7 +9,7 @@
    def _makeOne(self):
        cmd = self._getTargetClass()([])
        cmd.bootstrap = (dummy.DummyBootstrap(),)
        cmd.args = ('/foo/bar/myapp.ini#myapp',)
        cmd.args.config_uri = '/foo/bar/myapp.ini#myapp'
        return cmd
    def test_command_no_tweens(self):