diff options
Diffstat (limited to 'check')
-rwxr-xr-x | check | 32 |
1 files changed, 16 insertions, 16 deletions
@@ -267,20 +267,20 @@ def check_subplots(r): output = os.path.abspath("test-outputs") os.makedirs(output, exist_ok=True) - mds = find_files( - "**/*.md", + subplots = find_files( + "**/*.subplot", lambda f: f == f.lower() and "subplotlib" not in f and "test-outputs" not in f, ) - for md0 in mds: - r.title(f"checking subplot {md0}") + for subplot0 in subplots: + r.title(f"checking subplot {subplot0}") - dirname = os.path.dirname(md0) or "." - md = os.path.basename(md0) - base, _ = os.path.splitext(md) + dirname = os.path.dirname(subplot0) or "." + subplot = os.path.basename(subplot0) + base, _ = os.path.splitext(subplot) doc_template = None - for template in r.get_templates(md0): + for template in r.get_templates(subplot0): if doc_template is None: doc_template = template if template == "python": @@ -293,7 +293,7 @@ def check_subplots(r): bindir = get_bin_dir(r) - r.codegen(md, "python", test_py, cwd=dirname) + r.codegen(subplot, "python", test_py, cwd=dirname) p = r.runcmd_unchecked( [ "python3", @@ -310,18 +310,18 @@ def check_subplots(r): sys.exit(1) elif template == "bash": test_sh = os.path.join(output, f"test-{base}.sh") - r.codegen(md, "bash", test_sh, cwd=dirname) + r.codegen(subplot, "bash", test_sh, cwd=dirname) r.runcmd(["bash", "-x", test_sh], cwd=dirname) elif template == "rust": - r.msg(f"Ignoring Rust template in {md0}") + r.msg(f"Ignoring Rust template in {subplot0}") else: - sys.exit(f"unknown template {template} in {md0}") + sys.exit(f"unknown template {template} in {subplot0}") - base = os.path.basename(md) - base, _ = os.path.splitext(md) + base = os.path.basename(subplot) + base, _ = os.path.splitext(subplot) base = os.path.join(output, base) - r.docgen(md, doc_template, base + ".pdf", cwd=dirname) - r.docgen(md, doc_template, base + ".html", cwd=dirname) + r.docgen(subplot, doc_template, base + ".pdf", cwd=dirname) + r.docgen(subplot, doc_template, base + ".html", cwd=dirname) def tail(filename, numlines=100): |