gnunetbib

Bibliography (BibTeX, based on AnonBib)
Log | Files | Refs | README | LICENSE

commit ada5ef826ca940049923b7a44d6aab676d78e5af
parent 1d608b170da6c72df783a44aa4e8144d1b8ca084
Author: Nick Mathewson <nickm@torproject.org>
Date:   Thu, 19 Apr 2007 16:09:26 +0000

 r12436@catbus:  nickm | 2007-04-19 12:09:20 -0400
 Make anonbib detect all of the errors in chl05-full:eurofcrypt2005: "title" defined in a proceedings; fields defined in both an article and its crossref; etc.  Also make anonbib only replace _missing_ entries with crossref entries.


svn:r211

Diffstat:
MBibTeX.py | 19+++++++++++++++++--
Manonbib.bib | 13+++++++------
2 files changed, 24 insertions(+), 8 deletions(-)

diff --git a/BibTeX.py b/BibTeX.py @@ -81,7 +81,14 @@ class BibTeX: raise ParseError("Circular crossref at %s" % ent.key) seen[cr.key] = 1 del ent.entries['crossref'] - ent.entries.update(cr.entries) + + for k in cr.entries.keys(): + if ent.entries.has_key(k): + print "ERROR: %s defined both in %s and in %s"%( + k,ent.key,cr.key) + else: + ent.entries[k] = cr.entries[k] + ent.resolve() newEntries = [] rk = config.REQUIRE_KEY @@ -92,6 +99,7 @@ class BibTeX: for ent in self.entries: if ent.type in config.OMIT_ENTRIES or not ent.has_key(rk): + ent.check() del self.byKey[ent.key] else: newEntries.append(ent) @@ -344,6 +352,8 @@ class BibTeXEntry: errs = [] if self.type == 'inproceedings': fields = 'booktitle', 'year' + elif self.type == 'proceedings': + fields = 'booktitle', 'editor' elif self.type == 'article': fields = 'journal', 'year' elif self.type == 'techreport': @@ -355,7 +365,8 @@ class BibTeXEntry: else: fields = () errs.append("ERROR: odd type %s"%self.type) - fields += 'title', 'author', 'www_section', 'year' + if self.type != 'proceedings': + fields += 'title', 'author', 'www_section', 'year' for field in fields: if self.get(field) is None or \ @@ -369,6 +380,10 @@ class BibTeXEntry: not self['booktitle'].startswith("{Proceedings of"): errs.append("ERROR: %s's booktitle doesn't start with 'Proceedings'" % self.key) + if self.type == 'proceedings': + if self.get('title'): + errs.append("ERROR: %s is a proceedings: it should have a booktitle, not a title." % self.key) + for field, value in self.entries.items(): if value.translate(ALLCHARS, PRINTINGCHARS): errs.append("ERROR: %s.%s has non-ASCII characters"%( diff --git a/anonbib.bib b/anonbib.bib @@ -50,9 +50,9 @@ @Proceedings{eurocrypt2005, editor = {Ronald Cramer}, - title = {Advances in Cryptology - EUROCRYPT 2005, 24th Annual International - Conference on the Theory and Applications of Cryptographic - Techniques, Aarhus, Denmark, May 22-26, 2005, Proceedings}, +% title = {Advances in Cryptology - EUROCRYPT 2005, 24th Annual International +% Conference on the Theory and Applications of Cryptographic +% Techniques, Aarhus, Denmark, May 22-26, 2005, Proceedings}, booktitle = {Proceedings of EUROCRYPT 2005}, publisher = {Springer}, series = {Lecture Notes in Computer Science}, @@ -2489,17 +2489,18 @@ Sudan}, www_section = credentials, www_pdf_url = "http://theory.lcs.mit.edu/~cis/pubs/lysyanskaya/cl01a.pdf", } + @inproceedings{chl05-full:eurocrypt2005, author = {Jan Camenisch and Susan Hohenberger and Anna Lysyanskaya}, title = {Compact E-Cash}, - booktitle = {Proceedings of EUROCRYPT 2005}, - year = {2005}, +% booktitle = {Proceedings of EUROCRYPT 2005}, +% year = {2005}, pages = {302-321}, ee = {http://dx.doi.org/10.1007/11426639_18}, crossref = {eurocrypt2005}, - bibsource = {DBLP, http://dblp.uni-trier.de} +% bibsource = {DBLP, http://dblp.uni-trier.de} www_section = credentials, www_pdf_url = "http://www.cs.brown.edu/~anna/papers/chl05-full.pdf", www_important = {1},