# HG changeset patch # User Jeff Hammel # Date 1307669473 25200 # Node ID 20bdb81258171b8d5c9c58f32cf2e3427b284f11 # Parent 1f76705df520db75908785b3eb18c49dcbc6adb6 inline wrapper arguments now seem to work....thats....uncanny diff -r 1f76705df520 -r 20bdb8125817 pyloader/factory.py --- a/pyloader/factory.py Thu Jun 09 18:21:18 2011 -0700 +++ b/pyloader/factory.py Thu Jun 09 18:31:13 2011 -0700 @@ -137,11 +137,11 @@ _wrapper_args = None _wrapper_kwargs = None if ':' in _path: - _wrapper_options, __path = path.split(':', 1) + _wrapper_options, __path = _path.split(':', 1) if ',' in _wrapper_options or '=' in _wrapper_options: # ,= : tokens to ensure these are wrapper options # as these shouldn't be found in a real path (dotted path or file path) - _wrapper_args, _wrapper_kwargs = factory.str2args(_wrapper_options) + _wrapper_args, _wrapper_kwargs = cast.str2args(_wrapper_options) _path = __path if _path in names: diff -r 1f76705df520 -r 20bdb8125817 tests/objects.py --- a/tests/objects.py Thu Jun 09 18:21:18 2011 -0700 +++ b/tests/objects.py Thu Jun 09 18:31:13 2011 -0700 @@ -24,7 +24,7 @@ class Wrapper(object): def __init__(self, app, **values): self.app = app - self.values = dict([(int(j), i) for i, j in values]) # TODO: should be automagically converted ideally via pyloader + self.values = dict([(int(j), i) for i, j in values.items()]) # TODO: should be automagically converted ideally via pyloader def __call__(self, *args, **kwargs): retval = self.app(*args, **kwargs) values = {1: 'one', diff -r 1f76705df520 -r 20bdb8125817 tests/test_ini.txt --- a/tests/test_ini.txt Thu Jun 09 18:21:18 2011 -0700 +++ b/tests/test_ini.txt Thu Jun 09 18:31:13 2011 -0700 @@ -54,3 +54,9 @@ >>> bar = inifactory.load('bar') >>> bar # [1,1,2,3,5,8][5] 8 + +Test inline wrapper arguments, [extended-fibonacci:@:four=4,five=5:fibonacci]:: + + >>> extended = inifactory.load('extended-fibonacci') + >>> [extended(i) for i in range(6)] + ['one', 'one', 'two', 'three', 'five', 8]