From 0798280f9a79f087d4fac183a3897f32e6f9ee84 Mon Sep 17 00:00:00 2001 From: Olivier Mangin Date: Fri, 22 Feb 2013 16:45:02 +0100 Subject: [PATCH] Partial FIX of pretty person representer. - removes unnecessary information - removes bibtex purification that does not behave as expected - in current state a bug in pybtex still make the display incorrect --- papers/pretty.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/papers/pretty.py b/papers/pretty.py index 99d15e0..ccfeb93 100644 --- a/papers/pretty.py +++ b/papers/pretty.py @@ -4,13 +4,15 @@ from color import colored from pybtex.bibtex.utils import bibtex_purify +# A bug in pybtex makes the abbreviation wrong here +# (Submitted with racker ID: ID: 3605659) +# The purification should also be applied to names but unfortunately +# it removes dots which is annoying on abbreviations. def person_repr(p): - return bibtex_purify(' '.join(s for s in [ + return ' '.join(s for s in [ ' '.join(p.first(abbr=True)), - ' '.join(p.middle(abbr=True)), - ' '.join(p.prelast(abbr=False)), ' '.join(p.last(abbr=False)), - ' '.join(p.lineage(abbr=True))] if s)) + ' '.join(p.lineage(abbr=True))] if s) def short_authors(bibentry): @@ -23,6 +25,7 @@ def short_authors(bibentry): except KeyError: # When no author is defined return '' + def bib_oneliner(bibentry): authors = short_authors(bibentry) title = bibtex_purify(bibentry.fields['title'])