summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2020-10-09 10:30:54 +0300
committerLars Wirzenius <liw@liw.fi>2020-10-09 10:30:54 +0300
commite8a9639a00cf4ccd2665fd3b6fe499cf77b88c14 (patch)
tree0b9c5a1d8912f98e0eeebff38ca9d5b437f241b3
parent4332fb7fbc316b5a64c99e50cb6384bda656b136 (diff)
downloadjt2-e8a9639a00cf4ccd2665fd3b6fe499cf77b88c14.tar.gz
fix(subplot/jt.py): get global symbols via global()
This is to make jt.py be lintable on its own. The symbols are available in the generated test program, when jt.py gets embedded within that, but linters don't know about that.
-rw-r--r--subplot/jt.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/subplot/jt.py b/subplot/jt.py
index d8bb7fc..1b46b0b 100644
--- a/subplot/jt.py
+++ b/subplot/jt.py
@@ -3,26 +3,32 @@ import os
def run_jt_init(ctx, dirname=None, journalname=None, title=None):
+ runcmd_run = globals()["runcmd_run"]
runcmd_run(ctx, [_binary("jt"), "init", dirname, journalname, title])
def run_jt_list_journals(ctx):
+ runcmd_run = globals()["runcmd_run"]
runcmd_run(ctx, [_binary("jt"), "list-journals"])
def run_jt_is_journal(ctx, dirname=None):
+ runcmd_run = globals()["runcmd_run"]
runcmd_run(ctx, [_binary("jt"), "is-journal", dirname])
def _binary(name):
+ srcdir = globals()["srcdir"]
return os.path.join(srcdir, "target", "debug", "jt2")
def is_directory(ctx, dirname=None):
+ assert_eq = globals()["assert_eq"]
logging.debug("checking if %r is a directory", dirname)
assert_eq(os.path.isdir(dirname), True)
def output_contains(ctx, pattern=None):
+ assert_eq = globals()["assert_eq"]
logging.debug("checking if %r contains", ctx["stdout"], pattern)
assert_eq(pattern in ctx["stdout"], True)