(file_path, search_re, replace_line)
| 25 | from textwrap import dedent |
| 26 | |
| 27 | def update_build(file_path, search_re, replace_line): |
| 28 | print('adding new module into %s' % file_path) |
| 29 | matcher = re.compile(search_re) |
| 30 | |
| 31 | def edit(buffer, match, line): |
| 32 | if replace_line in line: |
| 33 | return None |
| 34 | match = matcher.search(line) |
| 35 | if match is not None: |
| 36 | buffer.append(replace_line) |
| 37 | buffer.append(line) |
| 38 | return match is not None |
| 39 | |
| 40 | changed = update_file(file_path, matcher, edit) |
| 41 | print('done' if changed else 'uptodate') |
| 42 | |
| 43 | |
| 44 | def read_config(): |
no test coverage detected
searching dependent graphs…