comparison pyloader/factory.py @ 63:995b831041be

stub: override section: [foo:bar]
author Jeff Hammel <jhammel@mozilla.com>
date Thu, 09 Jun 2011 09:15:48 -0700
parents 97800b02f636
children 6bb431e41e0b
comparison
equal deleted inserted replaced
62:97800b02f636 63:995b831041be
139 # but check for cyclic consistency 139 # but check for cyclic consistency
140 if _path in names: 140 if _path in names:
141 wrapped_name = _path 141 wrapped_name = _path
142 else: 142 else:
143 wrapped_name = section 143 wrapped_name = section
144 144
145 # get wrapper options
145 if wrapper not in config: 146 if wrapper not in config:
147 # load wrapper configuration
146 wrapper_section = names[wrapper] 148 wrapper_section = names[wrapper]
147 if wrapper_section in seen: 149 if wrapper_section in seen:
148 pass # TODO 150 pass # TODO
149 create_section(wrapper_section, iniconfig[wrapper_section]) 151 create_section(wrapper_section, iniconfig[wrapper_section])
150 wrapper_options = config[wrapper].copy() 152 wrapper_options = config[wrapper].copy()
151 153
152 # TODO interpolate wrapper_options 154 # interpolate wrapper_options
153 def interpolate(option): 155 def interpolate(option):
154 if option == object_string: 156 if option == object_string:
155 return '%(' + wrapped_name + ')s' 157 return '%(' + wrapped_name + ')s'
156 return option 158 return option
157 if 'args' in wrapper_options: 159 if 'args' in wrapper_options:
168 if _path == wrapped_name: 170 if _path == wrapped_name:
169 return 171 return
170 name = wrapped_name 172 name = wrapped_name
171 path = _path 173 path = _path
172 174
175 elif path in names:
176 # override section: [foo:bar]
177 pass # TODO
173 178
174 # make a dict for the section 179 # make a dict for the section
175 path = path % defaults 180 path = path % defaults
176 sect = config[name] = dict(path=path) 181 sect = config[name] = dict(path=path)
177 182