2 from __future__
import print_function
7 from concurrent.futures
import ProcessPoolExecutor
17 with
open(file,
"r+")
as f:
18 text = f.read().strip()
21 code = m.group(2).strip()
22 return code_format.format(code=code)
24 newtext, num = re.subn(
25 r"#ifndef (.*)\n#define \1.*\n((:?.|\n)+)#endif.*", repl, text, 1
34 p = argparse.ArgumentParser()
35 p.add_argument(
"input")
40 if os.path.isfile(args.input):
41 headers = [args.input]
42 elif os.path.isdir(args.input):
43 patterns = [
"**/*.hpp",
"**/*.h"]
45 [glob(os.path.join(args.input, p), recursive=
True)
for p
in patterns], []
48 headers = glob(args.input, recursive=
True)
56 if "__main__" == __name__: