Mercurial > hg > pyloader
comparison pyloader/factory.py @ 60:cc361ad8a692
stub out future directions for decorators and their testing a bit
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Thu, 09 Jun 2011 09:07:08 -0700 |
parents | f724db086125 |
children | 97800b02f636 |
comparison
equal
deleted
inserted
replaced
59:6b48dee5b92b | 60:cc361ad8a692 |
---|---|
126 if ':' in path: | 126 if ':' in path: |
127 wrapper, _path = path.split(':', 1) | 127 wrapper, _path = path.split(':', 1) |
128 # TODO: could interpolate wrapper | 128 # TODO: could interpolate wrapper |
129 if wrapper in names: | 129 if wrapper in names: |
130 | 130 |
131 # TODO: wrapper arguments: | |
132 # [extended-fibonacci:@:four=4,five=5:fibonacci] | |
133 | |
131 # TODO: will be correct for | 134 # TODO: will be correct for |
132 # [foo:bar:%(here)s/objects.py:MyClass] | 135 # [foo:bar:%(here)s/objects.py:MyClass] |
133 # but not for | 136 # but not for |
134 # [foo:bar:fleem] | 137 # [foo:bar:fleem] |
135 # in the latter case, just use fleem | 138 # in the latter case, just use fleem |
136 # but check for cyclic consistency | 139 # but check for cyclic consistency |
137 wrapped_name = section | 140 if _path in names: |
141 wrapped_name = _path | |
142 else: | |
143 wrapped_name = section | |
138 | 144 |
139 if wrapper not in config: | 145 if wrapper not in config: |
140 wrapper_section = names[wrapper] | 146 wrapper_section = names[wrapper] |
141 if wrapper_section in seen: | 147 if wrapper_section in seen: |
142 pass # TODO | 148 pass # TODO |
160 # create wrapper | 166 # create wrapper |
161 config[name] = wrapper_options | 167 config[name] = wrapper_options |
162 name = wrapped_name | 168 name = wrapped_name |
163 path = _path | 169 path = _path |
164 | 170 |
171 | |
172 | |
165 # make a dict for the section | 173 # make a dict for the section |
166 path = path % defaults | 174 path = path % defaults |
167 sect = config[name] = dict(path=path) | 175 sect = config[name] = dict(path=path) |
168 | 176 |
169 # get arguments from .ini options | 177 # get arguments from .ini options |