diff options
| author | Nick Mathewson <nickm@torproject.org> | 2006-11-26 06:20:09 +0000 |
|---|---|---|
| committer | Nick Mathewson <nickm@torproject.org> | 2006-11-26 06:20:09 +0000 |
| commit | c588e8997dffc7e8dbf0f54b94c79261314ae2d8 (patch) | |
| tree | f1bdd5e1badadf48e28afe68add04fe2b7f953b1 | |
| parent | adc4079a71c331fcb5c0d506a9d152307b5daeb2 (diff) | |
| download | anonbib-c588e8997dffc7e8dbf0f54b94c79261314ae2d8.tar.gz | |
r9810@Kushana: nickm | 2006-11-26 01:19:14 -0500
Code cleanups suggested by pychecker; some quite brain-dead.
svn:r187
| -rw-r--r-- | BibTeX.py | 9 | ||||
| -rw-r--r-- | config.py | 1 | ||||
| -rw-r--r-- | metaphone.py | 8 | ||||
| -rw-r--r-- | reconcile.py | 1 | ||||
| -rwxr-xr-x | updateCache.py | 1 |
5 files changed, 4 insertions, 16 deletions
@@ -549,7 +549,7 @@ class BibTeXEntry: res.append("</span><br />\n") res.append(self.biblio_to_html()) res.append("<a href='#%s'>·</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: @@ -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: |
