From 49bdd9301996248ab17d3ebae9c3dc40ab22f247 Mon Sep 17 00:00:00 2001 From: jgrizou Date: Thu, 4 Jul 2013 10:50:35 +0200 Subject: [PATCH] Enable edit command with option, e.g. "gvim -f" --- papers/files.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/papers/files.py b/papers/files.py index fa79d03..41ffc5d 100644 --- a/papers/files.py +++ b/papers/files.py @@ -151,7 +151,7 @@ def _parse_bibdata_formated_stream(stream, fmt): pass raise ValueError('content format is not recognized.') -def parse_bibdata(content, format_ = None): +def parse_bibdata(content, format_=None): """Parse bib data from string or stream. Raise ValueError if no bibdata is present. @@ -188,7 +188,9 @@ def editor_input(editor, initial="", suffix=None): tfile_name = temp_file.name temp_file.write(initial) temp_file.flush() - subprocess.call([editor, tfile_name]) + cmd = editor.split() # this enable editor command with option, e.g. gvim -f + cmd.append(tfile_name) + subprocess.call(cmd) with open(tfile_name) as temp_file: content = temp_file.read() os.remove(tfile_name)