summaryrefslogtreecommitdiff
path: root/subplot/jt.py
diff options
context:
space:
mode:
Diffstat (limited to 'subplot/jt.py')
-rw-r--r--subplot/jt.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/subplot/jt.py b/subplot/jt.py
index b9a7122..380cde4 100644
--- a/subplot/jt.py
+++ b/subplot/jt.py
@@ -2,6 +2,13 @@ import logging
import os
+def create_script(ctx, filename=None):
+ get_file = globals()["get_file"]
+ text = get_file(filename)
+ open(filename, "wb").write(text)
+ os.chmod(filename, 0o755)
+
+
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])
@@ -24,6 +31,15 @@ def run_jt_new(ctx, title=None, dirname=None):
)
+def run_jt_edit(ctx, editor=None, dirname=None):
+ runcmd_run = globals()["runcmd_run"]
+ env = dict(os.environ)
+ env["JT_LOG"] = "jt"
+ runcmd_run(
+ ctx, [_binary("jt"), "edit", "--dirname", dirname, "--editor", editor], env=env
+ )
+
+
def run_jt_finish(ctx, dirname=None):
runcmd_run = globals()["runcmd_run"]
runcmd_run(ctx, [_binary("jt"), "finish", "--dirname", dirname])