mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-12 01:18:31 +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:
|
with codecs.open(tmpfile, 'w', "utf-8") as f:
|
||||||
if template:
|
if template:
|
||||||
f.write(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])
|
subprocess.call(shlex.split(config['editor'], posix="win" not in sys.platform) + [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.close(filehandle)
|
os.remove(tmpfile) # delete temp file
|
||||||
os.remove(tmpfile)
|
|
||||||
if not raw:
|
if not raw:
|
||||||
prompt('[Nothing saved to file]')
|
prompt('[Nothing saved to file]')
|
||||||
return raw
|
return raw
|
||||||
|
|
Loading…
Add table
Reference in a new issue