Mercurial > hg > pyloader
comparison pyloader/factory.py @ 68:65609d7ba63d
move around when we create the (local) section dict so that we can override it as desired
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Thu, 09 Jun 2011 09:29:06 -0700 |
parents | 236af713bbc0 |
children | b9d9a94bfa19 |
comparison
equal
deleted
inserted
replaced
67:236af713bbc0 | 68:65609d7ba63d |
---|---|
119 | 119 |
120 def create_section(section, options): | 120 def create_section(section, options): |
121 | 121 |
122 # split up the section identifier | 122 # split up the section identifier |
123 name, path = section.split(':', 1) | 123 name, path = section.split(':', 1) |
124 | |
125 # make a dict for the section | |
126 sect = {} | |
124 | 127 |
125 # interpret decorators | 128 # interpret decorators |
126 if ':' in path: | 129 if ':' in path: |
127 wrapper, _path = path.split(':', 1) | 130 wrapper, _path = path.split(':', 1) |
128 # TODO: could interpolate wrapper | 131 # TODO: could interpolate wrapper |
178 # load overridden section | 181 # load overridden section |
179 overridden_section = names[path] | 182 overridden_section = names[path] |
180 if overridden_section in seen: | 183 if overridden_section in seen: |
181 pass # TODO | 184 pass # TODO |
182 create_section(overridden_section, iniconfig[overridden_section]) | 185 create_section(overridden_section, iniconfig[overridden_section]) |
183 # TODO: options = config[path].copy() | 186 # TODO: sect = config[path].copy() |
184 | 187 |
185 # make a dict for the section | 188 if 'path' not in sect: |
186 path = path % defaults | 189 # add the path to section dict |
187 sect = dict(path=path) | 190 path = path % defaults |
191 sect['path'] = path | |
188 | 192 |
189 # get arguments from .ini options | 193 # get arguments from .ini options |
190 for option, value in options.items(): | 194 for option, value in options.items(): |
191 if option == '.': # positional arguments | 195 if option == '.': # positional arguments |
192 sect['args'] = cast.str2list(value) | 196 sect['args'] = cast.str2list(value) |