From a484bab67d4f8f2e669b6c862d768b5b544c6083 Mon Sep 17 00:00:00 2001 From: "Fabien C. Y. Benureau" Date: Sat, 5 Jan 2019 00:49:42 +0900 Subject: [PATCH] cleanup PR --- pubs/bibstruct.py | 4 +--- pubs/repo.py | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/pubs/bibstruct.py b/pubs/bibstruct.py index 9e3e3f4..30af00b 100644 --- a/pubs/bibstruct.py +++ b/pubs/bibstruct.py @@ -51,11 +51,9 @@ def author_last(author_str): return author_str.split(',')[0] -def generate_citekey(bibdata, generate=True): +def generate_citekey(bibdata): """ 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. """ citekey, entry = get_entry(bibdata) diff --git a/pubs/repo.py b/pubs/repo.py index bb687b6..f747bf3 100644 --- a/pubs/repo.py +++ b/pubs/repo.py @@ -200,6 +200,7 @@ class Repository(object): """ # can't have `/` in 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: base_key = bibstruct.generate_citekey(bibentry) for n in itertools.count():