Mercurial > hgrepos > Python > libs > ConfigMix
comparison configmix/__init__.py @ 107:2ee042791197
Don't read the first configuration file a second time.
Because of merging nothing bad happend with the old implementation.
| author | Franz Glasner <hg@dom66.de> |
|---|---|
| date | Sat, 24 Mar 2018 15:34:52 +0100 |
| parents | d6ba53ce2091 |
| children | 2196362c0467 |
comparison
equal
deleted
inserted
replaced
| 106:b35837427a7a | 107:2ee042791197 |
|---|---|
| 34 """ | 34 """ |
| 35 if not files: | 35 if not files: |
| 36 return Configuration() | 36 return Configuration() |
| 37 else: | 37 else: |
| 38 ex = merge(None, _load_cfg_from_file(files[0])) | 38 ex = merge(None, _load_cfg_from_file(files[0])) |
| 39 for f in files: | 39 for f in files[1:]: |
| 40 ex = merge(_load_cfg_from_file(f), ex) | 40 ex = merge(_load_cfg_from_file(f), ex) |
| 41 return Configuration(ex) | 41 return Configuration(ex) |
| 42 | 42 |
| 43 | 43 |
| 44 def _load_cfg_from_file(filename): | 44 def _load_cfg_from_file(filename): |
