mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-18 03:58:32 +02:00
Allow editor config value to be either list or str
This commit is contained in:
parent
15ef9749ae
commit
6e7a75e9d0
1 changed files with 3 additions and 1 deletions
|
@ -130,7 +130,9 @@ def get_text_from_editor(config, template=""):
|
||||||
with codecs.open(tmpfile, 'w', "utf-8") as f:
|
with codecs.open(tmpfile, 'w', "utf-8") as f:
|
||||||
if template:
|
if template:
|
||||||
f.write(template)
|
f.write(template)
|
||||||
subprocess.call(config['editor'].split() + [tmpfile])
|
editor = config['editor']
|
||||||
|
args = editor if isinstance(editor, list) else editor.split()
|
||||||
|
subprocess.call(args + [tmpfile])
|
||||||
with codecs.open(tmpfile, "r", "utf-8") as f:
|
with codecs.open(tmpfile, "r", "utf-8") as f:
|
||||||
raw = f.read()
|
raw = f.read()
|
||||||
os.remove(tmpfile)
|
os.remove(tmpfile)
|
||||||
|
|
Loading…
Add table
Reference in a new issue