|
|
@ -27,21 +27,23 @@ def parser(subparsers):
|
|
|
|
|
|
|
|
|
|
|
|
def bibdata_from_editor(ui, rp):
|
|
|
|
def bibdata_from_editor(ui, rp):
|
|
|
|
again = True
|
|
|
|
again = True
|
|
|
|
|
|
|
|
bibstr = templates.add_bib
|
|
|
|
|
|
|
|
while again:
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
bibstr = content.editor_input(config().edit_cmd,
|
|
|
|
bibstr = content.editor_input(config().edit_cmd,
|
|
|
|
templates.add_bib,
|
|
|
|
bibstr,
|
|
|
|
suffix='.bib')
|
|
|
|
suffix='.bib')
|
|
|
|
if bibstr == templates.add_bib:
|
|
|
|
if bibstr == templates.add_bib:
|
|
|
|
cont = ui.input_yn(
|
|
|
|
again = ui.input_yn(
|
|
|
|
question='Bibfile not edited. Edit again ?',
|
|
|
|
question='Bibfile not edited. Edit again ?',
|
|
|
|
default='y')
|
|
|
|
default='y')
|
|
|
|
if not cont:
|
|
|
|
if not again:
|
|
|
|
ui.exit(0)
|
|
|
|
ui.exit(0)
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
bibdata = rp.databroker.verify(bibstr)
|
|
|
|
bibdata = rp.databroker.verify(bibstr)
|
|
|
|
bibstruct.verify_bibdata(bibdata)
|
|
|
|
bibstruct.verify_bibdata(bibdata)
|
|
|
|
# REFACTOR Generate citykey
|
|
|
|
# REFACTOR Generate citykey
|
|
|
|
cont = False
|
|
|
|
again = False
|
|
|
|
except ValueError:
|
|
|
|
except ValueError:
|
|
|
|
again = ui.input_yn(
|
|
|
|
again = ui.input_yn(
|
|
|
|
question='Invalid bibfile. Edit again ?',
|
|
|
|
question='Invalid bibfile. Edit again ?',
|
|
|
|