-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Expand file tree
/
Copy pathgenerate_code.py
More file actions
33 lines (23 loc) · 760 Bytes
/
generate_code.py
File metadata and controls
33 lines (23 loc) · 760 Bytes
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
26
27
28
29
30
31
32
33
"""Generate code."""
import argparse
from pathlib import Path
import utils
def main():
"""Main driver."""
args = parse_args()
codedir = utils.select_code_directory(args)
utils.perform_codegen(codedir, noformat=args.noformat, schema=args.schema)
def parse_args():
"""Parse command-line arguments."""
parser = argparse.ArgumentParser()
parser.add_argument("--codedir", type=Path, help="code directory")
parser.add_argument("--noformat", action="store_true", help="prevent reformatting")
parser.add_argument(
"--schema",
type=Path,
default=utils.PLOT_SCHEMA,
help=f"schema file (default {utils.PLOT_SCHEMA})",
)
return parser.parse_args()
if __name__ == "__main__":
main()