2 from __future__
import print_function
7 from concurrent.futures
import ProcessPoolExecutor
16 with
open(file,
"r+")
as f:
17 text = f.read().strip()
20 code = m.group(2).strip()
21 return code_format.format(code=code)
23 newtext, num = re.subn(
r"#ifndef (.*)\n#define \1.*\n((:?.|\n)+)#endif.*", repl, text, 1)
30 p = argparse.ArgumentParser()
31 p.add_argument(
"input")
36 if os.path.isfile(args.input):
37 headers = [args.input]
38 elif os.path.isdir(args.input):
39 patterns = [
"**/*.hpp",
"**/*.h"]
40 headers =
sum([glob(os.path.join(args.input, p), recursive=
True)
for p
in patterns], [])
42 headers = glob(args.input, recursive=
True)
53 if "__main__" == __name__: