add_cmd: fix bug
This commit is contained in:
parent
529e4e5950
commit
dbb17426d0
@ -11,8 +11,8 @@ from .. import templates
|
|||||||
|
|
||||||
def parser(subparsers):
|
def parser(subparsers):
|
||||||
parser = subparsers.add_parser('add', help='add a paper to the repository')
|
parser = subparsers.add_parser('add', help='add a paper to the repository')
|
||||||
parser.add_argument('-b', '--bibfile',
|
parser.add_argument('bibfile', nargs='?', default = None,
|
||||||
help='bibtex, bibtexml or bibyaml file', default=None)
|
help='bibtex, bibtexml or bibyaml file')
|
||||||
parser.add_argument('-d', '--docfile', help='pdf or ps file', default=None)
|
parser.add_argument('-d', '--docfile', help='pdf or ps file', default=None)
|
||||||
parser.add_argument('-t', '--tags', help='tags associated to the paper, separated by commas',
|
parser.add_argument('-t', '--tags', help='tags associated to the paper, separated by commas',
|
||||||
default=None)
|
default=None)
|
||||||
@ -25,7 +25,7 @@ def parser(subparsers):
|
|||||||
return parser
|
return parser
|
||||||
|
|
||||||
|
|
||||||
def bibdata_from_editor(rp):
|
def bibdata_from_editor(ui, rp):
|
||||||
again = True
|
again = True
|
||||||
try:
|
try:
|
||||||
bibstr = content.editor_input(config().edit_cmd,
|
bibstr = content.editor_input(config().edit_cmd,
|
||||||
@ -68,7 +68,7 @@ def command(args):
|
|||||||
# get bibfile
|
# get bibfile
|
||||||
|
|
||||||
if bibfile is None:
|
if bibfile is None:
|
||||||
bibdata = bibdata_from_editor(rp)
|
bibdata = bibdata_from_editor(ui, rp)
|
||||||
else:
|
else:
|
||||||
bibdata_raw = content.get_content(bibfile)
|
bibdata_raw = content.get_content(bibfile)
|
||||||
bibdata = rp.databroker.verify(bibdata_raw)
|
bibdata = rp.databroker.verify(bibdata_raw)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user