|
|
|
@ -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)
|
|
|
|
|