summaryrefslogtreecommitdiff
path: root/subplot/jt.py
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-04-03 11:04:40 +0300
committerLars Wirzenius <liw@liw.fi>2021-04-03 18:27:15 +0300
commitced4b9e5ff28016f500c5bfea91a3b33297f65d1 (patch)
treeeaa7db09063e5c1e18275981267733bf88533ce9 /subplot/jt.py
parent6e60becfb6fd87b1101b97006910396132be7777 (diff)
downloadjt2-ced4b9e5ff28016f500c5bfea91a3b33297f65d1.tar.gz
feat: allow setting name of directory where new entries go
Also, some refactoring that happened along the way.
Diffstat (limited to 'subplot/jt.py')
-rw-r--r--subplot/jt.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/subplot/jt.py b/subplot/jt.py
index 312a22a..6ce75b0 100644
--- a/subplot/jt.py
+++ b/subplot/jt.py
@@ -153,3 +153,9 @@ def file_contains(ctx, variable=None, pattern=None):
data = f.read()
logging.debug(f"file content: {data!r}")
assert pattern in data
+
+
+def file_name_has_suffix(ctx, varname=None, suffix=None):
+ variables = ctx.get("variables", {})
+ filename = variables[varname]
+ assert filename.endswith(suffix)