# HG changeset patch # User Jeff Hammel # Date 1307597072 25200 # Node ID d44f3e6dcffab37a16d62b020e217cf9f586b852 # Parent 12de7b1bf303c321bbd4f976fb837f08bcd4b779 interpolate options diff -r 12de7b1bf303 -r d44f3e6dcffa pyloader/factory.py --- a/pyloader/factory.py Wed Jun 08 22:17:43 2011 -0700 +++ b/pyloader/factory.py Wed Jun 08 22:24:32 2011 -0700 @@ -133,6 +133,7 @@ # but not for # [foo:bar:fleem] # in the latter case, just use fleem + # but check for cyclic consistency wrapped_name = section if wrapper not in config: @@ -143,12 +144,17 @@ wrapper_options = config[wrapper].copy() # TODO interpolate wrapper_options + def interpolate(option): + return option == object_string and wrapped_name or option if 'args' in wrapper_options: args = wrapper_options['args'][:] + args = [interpolate(i) for i in args] wrapper_options['args'] = args if 'kwargs' in wrapper_options: kwargs = wrapper_options['kwargs'].copy() + kwargs = dict([(i,interpolate(j)) for i, j in kwargs.items()]) wrapper_options['kwargs'] = kwargs + path = _path # make a dict for the section