[or-cvs] r24155: {projects} Fix stuff hinted to by pylint, clean up a bit (projects/gettor/lib/gettor)

Christian Fromme kaner at strace.org
Sat Jan 29 11:12:02 UTC 2011


Author: kaner
Date: 2011-01-29 11:12:02 +0000 (Sat, 29 Jan 2011)
New Revision: 24155

Modified:
   projects/gettor/lib/gettor/blacklist.py
   projects/gettor/lib/gettor/config.py
   projects/gettor/lib/gettor/gtlog.py
   projects/gettor/lib/gettor/opt.py
   projects/gettor/lib/gettor/utils.py
Log:
Fix stuff hinted to by pylint, clean up a bit


Modified: projects/gettor/lib/gettor/blacklist.py
===================================================================
--- projects/gettor/lib/gettor/blacklist.py	2011-01-29 04:07:40 UTC (rev 24154)
+++ projects/gettor/lib/gettor/blacklist.py	2011-01-29 11:12:02 UTC (rev 24155)
@@ -80,6 +80,7 @@
         if address is None:
            log.error("Argument 'address' is None")
            return False
+        hashString = self.getHash(address)
         globPath = os.path.join(self.blacklistDir, blacklistName)
         hashVec = glob.glob(os.path.join(globPath, hashString))
         for entry in hashVec:

Modified: projects/gettor/lib/gettor/config.py
===================================================================
--- projects/gettor/lib/gettor/config.py	2011-01-29 04:07:40 UTC (rev 24154)
+++ projects/gettor/lib/gettor/config.py	2011-01-29 11:12:02 UTC (rev 24155)
@@ -188,8 +188,3 @@
 
     def getDefaultFrom(self):
         return self.useConf["defaultFrom"][0]
-
-if __name__ == "__main__" :
-    c = Config()
-    print "# This is a suitable default configuration. Tune to fit your needs."
-    c.printConfiguration()

Modified: projects/gettor/lib/gettor/gtlog.py
===================================================================
--- projects/gettor/lib/gettor/gtlog.py	2011-01-29 04:07:40 UTC (rev 24154)
+++ projects/gettor/lib/gettor/gtlog.py	2011-01-29 11:12:02 UTC (rev 24155)
@@ -87,11 +87,3 @@
     if logger is None:
         initialize()
     return logger
-
-if __name__ == "__main__" :
-    initialize()
-    print "This is the logging module. You probably do not want to call it by hand."
-    print "We'll send a test logging message now with the following subsystem: " + \
-    getLogSubSystem()
-    log = getLogger()
-    log.info("I'm a logger, logging!")

Modified: projects/gettor/lib/gettor/opt.py
===================================================================
--- projects/gettor/lib/gettor/opt.py	2011-01-29 04:07:40 UTC (rev 24154)
+++ projects/gettor/lib/gettor/opt.py	2011-01-29 11:12:02 UTC (rev 24155)
@@ -65,6 +65,3 @@
                         metavar="DIR")
 
     return cmdParser.parse_args()
-
-if __name__ == "__main__":
-    print >> sys.stderr, "You shouldn't run this directly."

Modified: projects/gettor/lib/gettor/utils.py
===================================================================
--- projects/gettor/lib/gettor/utils.py	2011-01-29 04:07:40 UTC (rev 24154)
+++ projects/gettor/lib/gettor/utils.py	2011-01-29 11:12:02 UTC (rev 24155)
@@ -271,7 +271,7 @@
         os.chmod(cmdPassFile, 0400)
         return True
     except Exception, e:
-        log.error("Creating list entry %s failed: %s" % (entry, e))
+        log.error("Creating pass file failed: %s" % e)
         return False
 
 def verifyPassword(conf, password):



More information about the tor-commits mailing list