diff options
author | Daniel Silverstone <dsilvers+gitlab@digital-scurf.org> | 2022-09-08 18:27:49 +0000 |
---|---|---|
committer | Daniel Silverstone <dsilvers+gitlab@digital-scurf.org> | 2022-09-08 18:27:49 +0000 |
commit | 4e54fa9ea0485aac2d750c5eb4fa9ead83ecf365 (patch) | |
tree | a7c22c35da5811f19fa02772ecc6498d87d63030 /check | |
parent | c230684f3bab80154d5224d4f2f71eafd00fd100 (diff) | |
parent | 765b2e1d4d94b2274de28d4efd24bfe77e8d93ac (diff) | |
download | subplot-4e54fa9ea0485aac2d750c5eb4fa9ead83ecf365.tar.gz |
Merge branch 'liw/yamlfile' into 'main'
feat! read document metadata from a YAML file
Closes #283
See merge request subplot/subplot!287
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): |