cleanup PR
This commit is contained in:
parent
6865e29d15
commit
a484bab67d
@ -51,11 +51,9 @@ def author_last(author_str):
|
|||||||
return author_str.split(',')[0]
|
return author_str.split(',')[0]
|
||||||
|
|
||||||
|
|
||||||
def generate_citekey(bibdata, generate=True):
|
def generate_citekey(bibdata):
|
||||||
""" Generate a citekey from bib_data.
|
""" Generate a citekey from bib_data.
|
||||||
|
|
||||||
:param generate: if False, return the citekey defined in the file,
|
|
||||||
does not generate a new one.
|
|
||||||
:raise ValueError: if no author nor editor is defined.
|
:raise ValueError: if no author nor editor is defined.
|
||||||
"""
|
"""
|
||||||
citekey, entry = get_entry(bibdata)
|
citekey, entry = get_entry(bibdata)
|
||||||
|
@ -200,6 +200,7 @@ class Repository(object):
|
|||||||
"""
|
"""
|
||||||
# can't have `/` in citekeys
|
# can't have `/` in citekeys
|
||||||
# FIXME: a bit crude, but efficient for now (and allows unicode citekeys)
|
# FIXME: a bit crude, but efficient for now (and allows unicode citekeys)
|
||||||
|
# TODO: check that the generated citekey does not have a slash too.
|
||||||
if '/' in base_key:
|
if '/' in base_key:
|
||||||
base_key = bibstruct.generate_citekey(bibentry)
|
base_key = bibstruct.generate_citekey(bibentry)
|
||||||
for n in itertools.count():
|
for n in itertools.count():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user