diff options
| author | Nick Mathewson <nickm@torproject.org> | 2011-04-06 20:08:19 +0000 |
|---|---|---|
| committer | Nick Mathewson <nickm@torproject.org> | 2011-04-06 20:08:19 +0000 |
| commit | e7250feed7046f5e4d45d6ee733e8a6209f3afb4 (patch) | |
| tree | 0e3918119f79daf038809f6fb13ab0c0feebe639 /BibTeX.py | |
| parent | f6712eaaa8e3e14bf8b36a7ab9b83742ffc6d570 (diff) | |
| download | anonbib-e7250feed7046f5e4d45d6ee733e8a6209f3afb4.tar.gz | |
Add new code to handle month ranges and funky page ranges
svn:r358
Diffstat (limited to 'BibTeX.py')
| -rw-r--r-- | BibTeX.py | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -247,7 +247,12 @@ def sortEntriesByDate(entries): tmp.append((20000*13, i, ent)) continue try: - mon = MONTHS.index(ent.get("month")) + monthname = ent.get("month") + if monthname is not None: + match = re.match(r"(\w+)--\w+", monthname) + if match: + monthname = match.group(1) + mon = MONTHS.index(monthname) except ValueError: print "Unknown month %r in %s"%(ent.get("month"), ent.key) mon = 0 @@ -387,7 +392,7 @@ class BibTeXEntry: not self['booktitle'].startswith("{Proceedings of"): errs.append("ERROR: %s's booktitle (%r) doesn't start with 'Proceedings of'" % (self.key, self['booktitle'])) - if self.has_key("pages") and not re.match(r'\d+--\d+', self['pages']): + if self.has_key("pages") and not re.search(r'\d+--\d+', self['pages']): errs.append("ERROR: Misformed pages in %s"%self.key) if self.type == 'proceedings': @@ -401,7 +406,7 @@ class BibTeXEntry: if field.startswith("www_") and field not in WWW_FIELDS: errs.append("ERROR: unknown www field %s"% field) if value.strip()[-1:] == '.' and \ - field not in ("notes", "www_remarks"): + field not in ("notes", "www_remarks", "author"): errs.append("ERROR: %s.%s has an extraneous period"%(self.key, field)) return errs |
