()
| 5 | |
| 6 | |
| 7 | def main(): |
| 8 | import argparse |
| 9 | |
| 10 | parser = argparse.ArgumentParser(description=__doc__) |
| 11 | parser.add_argument('mode', help='file mode', choices=('html', 'tex')) |
| 12 | parser.add_argument('file', nargs='+', help='input file(s)') |
| 13 | args = parser.parse_args() |
| 14 | |
| 15 | mode = args.mode |
| 16 | |
| 17 | for fn in args.file: |
| 18 | with open(fn, encoding="utf-8") as f: |
| 19 | if mode == 'html': |
| 20 | lines = process_html(fn, f.readlines()) |
| 21 | elif mode == 'tex': |
| 22 | lines = process_tex(f.readlines()) |
| 23 | |
| 24 | with open(fn, 'w', encoding="utf-8") as f: |
| 25 | f.write("".join(lines)) |
| 26 | |
| 27 | def process_html(fn, lines): |
| 28 | return lines |
no test coverage detected
searching dependent graphs…