[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[minion-cvs] Fix all pychecker complaints



Update of /home/minion/cvsroot/src/minion/lib/mixminion
In directory moria.mit.edu:/tmp/cvs-serv30564/lib/mixminion

Modified Files:
	ClientMain.py Config.py test.py 
Log Message:
Fix all pychecker complaints

Index: ClientMain.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/ClientMain.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- ClientMain.py	9 Dec 2002 04:47:39 -0000	1.11
+++ ClientMain.py	9 Dec 2002 06:11:01 -0000	1.12
@@ -133,10 +133,10 @@
 		return ServerInfo(fname=name, assumeValid=0)
 	    except OSError, e:
 		raise MixError("Couldn't read descriptor %s: %s" %
-			       (s, e))
+			       (name, e))
 	    except ConfigError, e:
 		raise MixError("Couldn't parse descriptor %s: %s" %
-			       (s, e))	    
+			       (name, e))	    
 	else:
 	    return None
 

Index: Config.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/Config.py,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- Config.py	9 Dec 2002 04:47:40 -0000	1.22
+++ Config.py	9 Dec 2002 06:11:01 -0000	1.23
@@ -368,7 +368,6 @@
         elif type == 'SEC':
             curSection = [ ]
             sections.append( (val, curSection) )
-	    lastKey = None
         elif type == 'ENT':
             key,val = val
             if curSection is None:

Index: test.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/test.py,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -d -r1.43 -r1.44
--- test.py	9 Dec 2002 04:47:40 -0000	1.43
+++ test.py	9 Dec 2002 06:11:01 -0000	1.44
@@ -3286,8 +3286,7 @@
 _FAKE_HOME = None
 def _getServerKeyring():
     global _FAKE_HOME
-    if _FAKE_HOME is None:
-	_FAKE_HOME = mix_mktemp()
+    _FAKE_HOME = mix_mktemp()
     cfg = SERVERCFG % { 'home' : _FAKE_HOME }
     try:
 	suspendLog()
@@ -3399,16 +3398,15 @@
     [ "Lisa",	  "3 days",  "10.0.0.11", (-10,-1,5),   () ],
 ]
 
-_EXAMPLE_DESCRIPTORS_TIME = 0
 def getExampleServerDescriptors():
     """Helper function: generate a list of list of ServerInfo objects based 
        on the values of _EXAMPLE_DESCRIPTORS_INP"""
     if _EXAMPLE_DESCRIPTORS:
  	return _EXAMPLE_DESCRIPTORS
-    global _EXAMPLE_DESCRIPTORS_TIME
+
     gen = mixminion.ServerInfo.generateServerDescriptorAndKeys
     tmpkeydir = mix_mktemp()
-    _EXAMPLE_DESCRIPTORS_TIME = now = time.time()
+    now = time.time()
 
     sys.stdout.flush()
     
@@ -3456,6 +3454,9 @@
 
 import mixminion.ClientMain
 
+# variable to hold the latest instance of FakeBCC.
+BCC_INSTANCE = None
+
 class ClientMainTests(unittest.TestCase):
     def testTrivialKeystore(self):
 	"""Check out ClientMain's keystore implementation"""
@@ -3604,11 +3605,11 @@
 	    # First, two forward messages that end with 'joe' and go via
 	    # SMTP
 	    payload = "Hey Joe, where you goin' with that gun in your hand?"
-	    m1 = client.generateForwardMessage(
+	    client.generateForwardMessage(
 		parseAddress("joe@cledonism.net"),
 		payload,
 		path1=["Lola", "Joe"], path2=["Alice", "Joe"])
-	    m2 = client.generateForwardMessage(
+            client.generateForwardMessage(
 		parseAddress("smtp:joe@cledonism.net"),
 		"Hey Joe, where you goin' with that gun in your hand?",
 		path1=["Lola", "Joe"], path2=["Alice", "Joe"])
@@ -3624,12 +3625,12 @@
 	    
 	    # Now try an mbox message, with an explicit last hop.
 	    payload = "Hey, Lo', where you goin' with that pun in your hand?"
-	    m1 = client.generateForwardMessage(
+	    client.generateForwardMessage(
 		parseAddress("mbox:granola"),
 		payload,
 		path1=["Lola", "Joe"], path2=["Alice", "Lola"])
 	    # And an mbox message with a last hop implicit in the address
-	    m1 = client.generateForwardMessage(
+	    client.generateForwardMessage(
 		parseAddress("mbox:granola@Lola"),
 		payload,
 		path1=["Lola", "Joe"], path2=["Alice"])