Load values from an *.ini style config file. If the config file contains sections, their names are used as namespaces for the values within. The two special sections ``DEFAULT`` and ``bottle`` refer to the root namespace (no prefix).
(self, filename)
| 2093 | self.update(*a, **ka) |
| 2094 | |
| 2095 | def load_config(self, filename): |
| 2096 | ''' Load values from an *.ini style config file. |
| 2097 | |
| 2098 | If the config file contains sections, their names are used as |
| 2099 | namespaces for the values within. The two special sections |
| 2100 | ``DEFAULT`` and ``bottle`` refer to the root namespace (no prefix). |
| 2101 | ''' |
| 2102 | conf = ConfigParser() |
| 2103 | conf.read(filename) |
| 2104 | for section in conf.sections(): |
| 2105 | for key, value in conf.items(section): |
| 2106 | if section not in ('DEFAULT', 'bottle'): |
| 2107 | key = section + '.' + key |
| 2108 | self[key] = value |
| 2109 | return self |
| 2110 | |
| 2111 | def load_dict(self, source, namespace='', make_namespaces=False): |
| 2112 | ''' Import values from a dictionary structure. Nesting can be used to |