gnunetbib

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

commit aa48b4d0bc4a43d9bbfbd48346abcb0b8d1cc2fb
parent 2ea2082b537718412665bbc8896de6e45075a659
Author: Nick Mathewson <nickm@torproject.org>
Date:   Sun, 26 Nov 2006 06:20:09 +0000

 r9810@Kushana:  nickm | 2006-11-26 01:19:14 -0500
 Code cleanups suggested by pychecker; some  quite brain-dead.


svn:r187

Diffstat:
MBibTeX.py | 9+--------
Mconfig.py | 1+
Mmetaphone.py | 8++------
Mreconcile.py | 1-
MupdateCache.py | 1-
5 files changed, 4 insertions(+), 16 deletions(-)

diff --git a/BibTeX.py b/BibTeX.py @@ -549,7 +549,7 @@ class BibTeXEntry: res.append("</span><br />\n") res.append(self.biblio_to_html()) res.append("<a href='#%s'>&middot;</a>"%url_untranslate(self.key)) - res.append("</p>"), + res.append("</p>") if self.get('www_remarks'): res.append("<p class='remarks'>%s</span>"%htmlize( @@ -667,12 +667,6 @@ class ParsedAuthor: (self.von == o.von) and (self.jr == o.jr)) - def __neq__(self, o): - return ((self.first != o.first) or - (self.last != o.last) or - (self.von != o.von) or - (self.jr != o.jr)) - def __hash__(self): return hash(repr(self)) @@ -1170,7 +1164,6 @@ def parseString(string, result=None): return r if __name__ == '__main__': - import sys if len(sys.argv)>1: fname=sys.argv[1] else: diff --git a/config.py b/config.py @@ -10,6 +10,7 @@ _KEYS = [ "ALPHABETIZE_AUTHOR_AS","AUTHOR_URLS","CACHE_DIR","CACHE_SECTIONS", for _k in _KEYS: globals()[_k]=None +del _k def load(cfgFile): mod = {} diff --git a/metaphone.py b/metaphone.py @@ -9,8 +9,6 @@ Based on the original C++ metaphone implementation.) """ -import string - TRIPLES = { 'dge': 'j', 'dgi': 'j', @@ -62,7 +60,7 @@ def metaphone(s): # Change "x" to "s" if s[0] == 'x': - x = "s%s" % s[1:] + s = "s%s" % s[1:] # Get rid of "h" in "wh". if s[:2] == 'wh': @@ -118,15 +116,13 @@ def metaphone(s): vowelBefore = prevLtr in "aeiou" curLtr = s[idx] - nextLtr2 = nextLtr3 = ' ' + nextLtr2 = ' ' if idx < lastChar: nextLtr = s[idx+1] vowelAfter = nextLtr in "aeiou" frontvAfter = nextLtr in "eiy" if idx+1 < lastChar: nextLtr2 = s[idx+2] - if idx+2 < lastChar: - nextLtr3 = s[idx+3] else: nextLtr = ' ' vowelAfter = frontvAfter = 0 diff --git a/reconcile.py b/reconcile.py @@ -100,7 +100,6 @@ class MasterBibTeX(BibTeX.BibTeX): return 0 def _initialize(self, name): - n1 = name name = " ".join(name).lower() name = re.sub(r'([a-z])[a-z\.]*', r'\1', name) name = clean(name) diff --git a/updateCache.py b/updateCache.py @@ -111,7 +111,6 @@ def downloadAll(bibtex, missingOnly=0): key = e.key section = e.get("www_cache_section", ".") for ftype, url in urls.items(): - fname = getCacheFname(key, ftype, section) if missingOnly: cachedURL = getCachedURL(key, ftype, section) if cachedURL == url: