(data, output_base, config_base)
| 38 | def read_config(): |
| 39 | # pylint: disable=W0703 |
| 40 | def json_to_object(data, output_base, config_base): |
| 41 | def json_object_hook(object_dict): |
| 42 | items = [(k, os.path.join(config_base, v) if k == "path" else v) |
| 43 | for (k, v) in object_dict.items()] |
| 44 | items = [(k, os.path.join(output_base, v) if k == "output" else v) |
| 45 | for (k, v) in items] |
| 46 | keys, values = list(zip(*items)) |
| 47 | # 'async' is a keyword since Python 3.7. |
| 48 | # Avoid namedtuple(rename=True) for compatibility with Python 2.X. |
| 49 | keys = tuple('async_' if k == 'async' else k for k in keys) |
| 50 | return collections.namedtuple('X', keys)(*values) |
| 51 | return json.loads(data, object_hook=json_object_hook) |
| 52 | |
| 53 | def init_defaults(config_tuple, path, defaults): |
| 54 | keys = list(config_tuple._fields) # pylint: disable=E1101 |
no outgoing calls
no test coverage detected
searching dependent graphs…