File: fixdocs.py

package info (click to toggle)
mapraster 2026.01.06-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 556 kB
  • sloc: python: 476; makefile: 105
file content (25 lines) | stat: -rw-r--r-- 533 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/env python3

import re
import sys
import pathlib
import argparse

parser = argparse.ArgumentParser()
parser.add_argument("infile", type=pathlib.Path)
parser.add_argument("outfile", type=pathlib.Path, nargs="?")

args = parser.parse_args()

infile = args.infile
outfile = args.outfile if args.outfile is not None else infile

data = infile.read_text()
new_data = re.sub(
    r'<div class=\"highlight\"><pre>\s+mkdir -p failed(.*\s){2}</pre></div>',
    '',
    data,
    count=1,
    flags=re.M,
)
outfile.write_text(new_data)