Revision 114e19da kamaki/cli/config.py
b/kamaki/cli/config.py | ||
---|---|---|
283 | 283 |
self = self.__init__(self.path) |
284 | 284 |
|
285 | 285 |
def get(self, section, option): |
286 |
""" |
|
287 |
:param section: (str) HINT: for remotes, use remote.<section> |
|
288 |
|
|
289 |
:param option: (str) |
|
290 |
|
|
291 |
:returns: (str) the value stored at section: {option: value} |
|
292 |
""" |
|
286 | 293 |
value = self._overrides.get(section, {}).get(option) |
287 | 294 |
if value is not None: |
288 | 295 |
return value |
289 |
|
|
296 |
if section.startswith('remote.'): |
|
297 |
return self.get_remote(section[len('remote.'):], option) |
|
290 | 298 |
try: |
291 | 299 |
return RawConfigParser.get(self, section, option) |
292 | 300 |
except (NoSectionError, NoOptionError): |
293 | 301 |
return DEFAULTS.get(section, {}).get(option) |
294 | 302 |
|
295 | 303 |
def set(self, section, option, value): |
304 |
""" |
|
305 |
:param section: (str) HINT: for remotes use remote.<section> |
|
306 |
|
|
307 |
:param option: (str) |
|
308 |
|
|
309 |
:param value: str |
|
310 |
""" |
|
311 |
if section.startswith('remote.'): |
|
312 |
return self.set_remote(section[len('remote.')], option, value) |
|
296 | 313 |
if section not in RawConfigParser.sections(self): |
297 | 314 |
self.add_section(section) |
298 | 315 |
RawConfigParser.set(self, section, option, value) |
Also available in: Unified diff