Mercurial > piecrust2
comparison piecrust/configuration.py @ 5:474c9882decf
Upgrade to Python 3.
| author | Ludovic Chabant <ludovic@chabant.com> |
|---|---|
| date | Mon, 11 Aug 2014 22:36:47 -0700 |
| parents | f485ba500df3 |
| children | 563ce5dd02af |
comparison
equal
deleted
inserted
replaced
| 4:7dc71c2dc9a8 | 5:474c9882decf |
|---|---|
| 87 for other in args: | 87 for other in args: |
| 88 _recurse_merge_dicts(source, other, None, validator) | 88 _recurse_merge_dicts(source, other, None, validator) |
| 89 | 89 |
| 90 | 90 |
| 91 def _recurse_merge_dicts(local_cur, incoming_cur, parent_path, validator): | 91 def _recurse_merge_dicts(local_cur, incoming_cur, parent_path, validator): |
| 92 for k, v in incoming_cur.iteritems(): | 92 for k, v in incoming_cur.items(): |
| 93 key_path = k | 93 key_path = k |
| 94 if parent_path is not None: | 94 if parent_path is not None: |
| 95 key_path = parent_path + '/' + k | 95 key_path = parent_path + '/' + k |
| 96 | 96 |
| 97 local_v = local_cur.get(k) | 97 local_v = local_cur.get(k) |
| 111 | 111 |
| 112 | 112 |
| 113 def parse_config_header(text): | 113 def parse_config_header(text): |
| 114 m = header_regex.match(text) | 114 m = header_regex.match(text) |
| 115 if m is not None: | 115 if m is not None: |
| 116 header = unicode(m.group('header')) | 116 header = str(m.group('header')) |
| 117 config = yaml.load(header, Loader=yaml.BaseLoader) | 117 config = yaml.load(header, Loader=yaml.BaseLoader) |
| 118 offset = m.end() | 118 offset = m.end() |
| 119 else: | 119 else: |
| 120 config = {} | 120 config = {} |
| 121 offset = 0 | 121 offset = 0 |
