From c588e8997dffc7e8dbf0f54b94c79261314ae2d8 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Sun, 26 Nov 2006 06:20:09 +0000 Subject: r9810@Kushana: nickm | 2006-11-26 01:19:14 -0500 Code cleanups suggested by pychecker; some quite brain-dead. svn:r187 --- BibTeX.py | 9 +-------- config.py | 1 + metaphone.py | 8 ++------ reconcile.py | 1 - updateCache.py | 1 - 5 files changed, 4 insertions(+), 16 deletions(-) diff --git a/BibTeX.py b/BibTeX.py index 2062988..065aa5b 100644 --- a/BibTeX.py +++ b/BibTeX.py @@ -549,7 +549,7 @@ class BibTeXEntry: res.append("
\n") res.append(self.biblio_to_html()) res.append("·"%url_untranslate(self.key)) - res.append("

"), + res.append("

") if self.get('www_remarks'): res.append("

%s"%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 index 68fbbf7..41ee14e 100644 --- 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 index e86d4fc..8eb8257 100644 --- 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 index 5df1465..111ac73 100644 --- 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 index 8e1af06..de3216c 100755 --- 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: -- cgit v1.2.3-70-g09d2