# HG changeset patch # User Jeff Hammel # Date 1307600990 25200 # Node ID f724db08612500f2f845d33cc577519a8e89af67 # Parent e4a1d7eecd3bee145fef2843a1f9460cb9d60aa6 houston, we have a pyloader diff -r e4a1d7eecd3b -r f724db086125 pyloader/factory.py --- a/pyloader/factory.py Wed Jun 08 23:20:24 2011 -0700 +++ b/pyloader/factory.py Wed Jun 08 23:29:50 2011 -0700 @@ -145,7 +145,9 @@ # TODO interpolate wrapper_options def interpolate(option): - return option == object_string and wrapped_name or option + if option == object_string: + return '%(' + wrapped_name + ')s' + return option if 'args' in wrapper_options: args = wrapper_options['args'][:] args = [interpolate(i) for i in args] diff -r e4a1d7eecd3b -r f724db086125 tests/test_ini.txt --- a/tests/test_ini.txt Wed Jun 08 23:20:24 2011 -0700 +++ b/tests/test_ini.txt Wed Jun 08 23:29:50 2011 -0700 @@ -32,3 +32,10 @@ True >>> [fib(i) for i in range(5)] [1, 1, 2, 3, 5] + +Now let's test a simple wrapper:: + + >>> fib = inifactory.load('readable-fibonacci') + >>> from pprint import pprint + >>> [fib(i) for i in range(5)] + ['one', 'one', 'two', 'three', 5]