Mercurial > hg > pyloader
comparison pyloader/factory.py @ 67:236af713bbc0
move setting the configuration to later so that we can easily move around sect
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Thu, 09 Jun 2011 09:25:54 -0700 |
parents | 2a9274608af3 |
children | 65609d7ba63d |
comparison
equal
deleted
inserted
replaced
66:2a9274608af3 | 67:236af713bbc0 |
---|---|
182 create_section(overridden_section, iniconfig[overridden_section]) | 182 create_section(overridden_section, iniconfig[overridden_section]) |
183 # TODO: options = config[path].copy() | 183 # TODO: options = config[path].copy() |
184 | 184 |
185 # make a dict for the section | 185 # make a dict for the section |
186 path = path % defaults | 186 path = path % defaults |
187 sect = config[name] = dict(path=path) | 187 sect = dict(path=path) |
188 | 188 |
189 # get arguments from .ini options | 189 # get arguments from .ini options |
190 for option, value in options.items(): | 190 for option, value in options.items(): |
191 if option == '.': # positional arguments | 191 if option == '.': # positional arguments |
192 sect['args'] = cast.str2list(value) | 192 sect['args'] = cast.str2list(value) |
193 else: # keyword arguments | 193 else: # keyword arguments |
194 sect.setdefault('kwargs', {})[option] = value | 194 sect.setdefault('kwargs', {})[option] = value |
195 | |
196 # set the configuration | |
197 config[name] = sect | |
195 | 198 |
196 # get the object definitions | 199 # get the object definitions |
197 for section, options in iniconfig.items(): | 200 for section, options in iniconfig.items(): |
198 seen.add(section) | 201 seen.add(section) |
199 if section not in interpolated: | 202 if section not in interpolated: |