mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-11 09:08:32 +02:00
parent
126e188c0f
commit
9441998ecf
1 changed files with 2 additions and 2 deletions
|
@ -163,11 +163,11 @@ def get_text_from_editor(config, template=""):
|
|||
with codecs.open(tmpfile, 'w', "utf-8") as f:
|
||||
if template:
|
||||
f.write(template)
|
||||
os.close(filehandle) # remove process lock on temp file
|
||||
subprocess.call(shlex.split(config['editor'], posix="win" not in sys.platform) + [tmpfile])
|
||||
with codecs.open(tmpfile, "r", "utf-8") as f:
|
||||
raw = f.read()
|
||||
os.close(filehandle)
|
||||
os.remove(tmpfile)
|
||||
os.remove(tmpfile) # delete temp file
|
||||
if not raw:
|
||||
prompt('[Nothing saved to file]')
|
||||
return raw
|
||||
|
|
Loading…
Add table
Reference in a new issue