- Fixed an issue that caused the following symptom when using the
ini configuration parser:
TypeError: _makePlugin() got multiple values for keyword argument 'name'
See http://bugs.repoze.org/issue92 for more details. Thanks to vaab
for the bug report and initial fix.
| | |
| | | Next release |
| | | ============ |
| | | |
| | | - ... |
| | | - Fixed an issue that caused the following symptom when using the |
| | | ini configuration parser: |
| | | |
| | | TypeError: _makePlugin() got multiple values for keyword argument 'name' |
| | | |
| | | See http://bugs.repoze.org/issue92 for more details. Thanks to vaab |
| | | for the bug report and initial fix. |
| | | |
| | | |
| | | 1.0.15 (2009/06/25) |
| | | =================== |
| | |
| | | self.mdproviders = [] |
| | | self.remote_user_key = 'REMOTE_USER' |
| | | |
| | | def _makePlugin(self, name, iface, **kw): |
| | | def _makePlugin(self, name, iface, options=None): |
| | | if options is None: |
| | | options = {} |
| | | obj = _resolve(name) |
| | | if not iface.providedBy(obj): |
| | | obj = obj(**kw) |
| | | obj = obj(**options) |
| | | return obj |
| | | |
| | | def _getPlugin(self, name, iface): |
| | |
| | | if 'use' in options: |
| | | name = options.pop('use') |
| | | del options['here'] |
| | | obj = self._makePlugin(name, IPlugin, **options) |
| | | obj = self._makePlugin(name, IPlugin, options) |
| | | self.plugins[plugin_id] = obj |
| | | |
| | | if 'general' in cp.sections(): |
| | |
| | | self.assertEqual(second[0], 'bar') |
| | | self.failUnless(isinstance(second[1], PLUGIN_CLASS)) |
| | | |
| | | def test_parse_make_plugin_names(self): |
| | | # see http://bugs.repoze.org/issue92 |
| | | config = self._makeOne() |
| | | config.parse(MAKE_PLUGIN_ARG_NAMES) |
| | | self.assertEqual(len(config.plugins), 1) |
| | | foo = config.plugins['foo'] |
| | | self.failUnless(isinstance(foo, DummyPlugin)) |
| | | self.assertEqual(foo.iface, 'iface') |
| | | self.assertEqual(foo.name, 'name') |
| | | |
| | | class DummyPlugin: |
| | | def __init__(self, **kw): |
| | | self.__dict__.update(kw) |
| | |
| | | use = repoze.who.tests.test_config:DummyPlugin |
| | | """ |
| | | |
| | | MAKE_PLUGIN_ARG_NAMES = """\ |
| | | [plugin:foo] |
| | | use = repoze.who.tests.test_config:DummyPlugin |
| | | name = name |
| | | iface = iface |
| | | """ |
| | | |
| | | class TestConfigMiddleware(unittest.TestCase): |
| | | tempdir = None |
| | | |