cosmetics in edit_cmd
This commit is contained in:
parent
9c47951532
commit
f62b31542d
@ -23,11 +23,11 @@ def command(args):
|
|||||||
rp = repo.Repository(config())
|
rp = repo.Repository(config())
|
||||||
key = parse_reference(ui, rp, reference)
|
key = parse_reference(ui, rp, reference)
|
||||||
paper = rp.get_paper(key)
|
paper = rp.get_paper(key)
|
||||||
filepath = rp._bibfile(key)
|
filepath = rp._metafile(key) if meta else rp._bibfile(key)
|
||||||
if meta:
|
|
||||||
filepath = rp._metafile(key)
|
|
||||||
with open(filepath) as f:
|
with open(filepath) as f:
|
||||||
content = f.read()
|
content = f.read()
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
# Get new content from user
|
# Get new content from user
|
||||||
content = editor_input(config().edit_cmd, content)
|
content = editor_input(config().edit_cmd, content)
|
||||||
@ -46,10 +46,10 @@ def command(args):
|
|||||||
except repo.CiteKeyCollision:
|
except repo.CiteKeyCollision:
|
||||||
options = ['overwrite', 'edit again', 'abort']
|
options = ['overwrite', 'edit again', 'abort']
|
||||||
choice = options[ui.input_choice(
|
choice = options[ui.input_choice(
|
||||||
options,
|
options, ['o', 'e', 'a'],
|
||||||
['o', 'e', 'a'],
|
|
||||||
question='A paper already exist with this citekey.'
|
question='A paper already exist with this citekey.'
|
||||||
)]
|
)]
|
||||||
|
|
||||||
if choice == 'abort':
|
if choice == 'abort':
|
||||||
break
|
break
|
||||||
elif choice == 'overwrite':
|
elif choice == 'overwrite':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user