many bugfixes when adding paper through editor
This commit is contained in:
parent
e6d4c33846
commit
523fe888a3
@ -27,27 +27,29 @@ def parser(subparsers):
|
|||||||
|
|
||||||
def bibdata_from_editor(ui, rp):
|
def bibdata_from_editor(ui, rp):
|
||||||
again = True
|
again = True
|
||||||
try:
|
bibstr = templates.add_bib
|
||||||
bibstr = content.editor_input(config().edit_cmd,
|
while again:
|
||||||
templates.add_bib,
|
try:
|
||||||
suffix='.bib')
|
bibstr = content.editor_input(config().edit_cmd,
|
||||||
if bibstr == templates.add_bib:
|
bibstr,
|
||||||
cont = ui.input_yn(
|
suffix='.bib')
|
||||||
question='Bibfile not edited. Edit again ?',
|
if bibstr == templates.add_bib:
|
||||||
|
again = ui.input_yn(
|
||||||
|
question='Bibfile not edited. Edit again ?',
|
||||||
|
default='y')
|
||||||
|
if not again:
|
||||||
|
ui.exit(0)
|
||||||
|
else:
|
||||||
|
bibdata = rp.databroker.verify(bibstr)
|
||||||
|
bibstruct.verify_bibdata(bibdata)
|
||||||
|
# REFACTOR Generate citykey
|
||||||
|
again = False
|
||||||
|
except ValueError:
|
||||||
|
again = ui.input_yn(
|
||||||
|
question='Invalid bibfile. Edit again ?',
|
||||||
default='y')
|
default='y')
|
||||||
if not cont:
|
if not again:
|
||||||
ui.exit(0)
|
ui.exit(0)
|
||||||
else:
|
|
||||||
bibdata = rp.databroker.verify(bibstr)
|
|
||||||
bibstruct.verify_bibdata(bibdata)
|
|
||||||
# REFACTOR Generate citykey
|
|
||||||
cont = False
|
|
||||||
except ValueError:
|
|
||||||
again = ui.input_yn(
|
|
||||||
question='Invalid bibfile. Edit again ?',
|
|
||||||
default='y')
|
|
||||||
if not again:
|
|
||||||
ui.exit(0)
|
|
||||||
|
|
||||||
return bibdata
|
return bibdata
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user