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

[minion-cvs] Move all the pure-server modules into a new package, "m...



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

Modified Files:
	ClientMain.py Config.py Main.py __init__.py benchmark.py 
	test.py testSupport.py 
Removed Files:
	HashLog.py MMTPServer.py Modules.py PacketHandler.py Queue.py 
	ServerMain.py 
Log Message:
Move all the pure-server modules into a new package, 'mixminion.server.'

We still need to split 'Config' and 'ServerInfo' into their client and server
components.


Index: ClientMain.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/ClientMain.py,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- ClientMain.py	11 Dec 2002 05:53:33 -0000	1.13
+++ ClientMain.py	11 Dec 2002 06:58:55 -0000	1.14
@@ -36,7 +36,6 @@
 import mixminion.Crypto
 import mixminion.BuildMessage
 import mixminion.MMTPClient
-import mixminion.Modules
 from mixminion.ServerInfo import ServerInfo
 from mixminion.Config import ClientConfig, ConfigError
 from mixminion.Packet import ParseError, parseMBOXInfo, parseSMTPInfo, \

Index: Config.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/Config.py,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- Config.py	11 Dec 2002 05:53:33 -0000	1.24
+++ Config.py	11 Dec 2002 06:58:55 -0000	1.25
@@ -716,9 +716,9 @@
 	# mess it up.
         self._syntax = SERVER_SYNTAX.copy()
 
-        import mixminion.Modules
+        import mixminion.server.Modules
 	if moduleManager is None:
-	    self.moduleManager = mixminion.Modules.ModuleManager()
+	    self.moduleManager = mixminion.server.Modules.ModuleManager()
 	else:
 	    self.moduleManager = moduleManager
         self._addCallback("Server", self.__loadModules)    

Index: Main.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/Main.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- Main.py	9 Dec 2002 04:47:40 -0000	1.11
+++ Main.py	11 Dec 2002 06:58:55 -0000	1.12
@@ -116,9 +116,9 @@
     "unittests" :      ( 'mixminion.test',       'testAll' ),
     "benchmarks" :     ( 'mixminion.benchmark',  'timeAll' ),
     "client" :         ( 'mixminion.ClientMain', 'runClient' ),
-    "server" :         ( 'mixminion.ServerMain', 'runServer' ),
-    "server-keygen" :  ( 'mixminion.ServerMain', 'runKeygen'),
-    "server-DELKEYS" : ( 'mixminion.ServerMain', 'removeKeys'),
+    "server" :         ( 'mixminion.server.ServerMain', 'runServer' ),
+    "server-keygen" :  ( 'mixminion.server.ServerMain', 'runKeygen'),
+    "server-DELKEYS" : ( 'mixminion.server.ServerMain', 'removeKeys'),
 }
 
 def printVersion(cmd,args):

Index: __init__.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/__init__.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- __init__.py	9 Dec 2002 04:47:40 -0000	1.8
+++ __init__.py	11 Dec 2002 06:58:55 -0000	1.9
@@ -7,19 +7,13 @@
    """
 
 __version__ = "0.0.1a0"
-__all__ = [ ]
-
-import mixminion.BuildMessage
-import mixminion.Crypto
-import mixminion.MMTPServer
-import mixminion.PacketHandler
-import mixminion.Common
-import mixminion.HashLog
-import mixminion.Modules
-import mixminion.Queue
-import mixminion.Config
-import mixminion.MMTPClient
-import mixminion.Packet
-import mixminion.ServerInfo
-import mixminion.ServerMain
-import mixminion.ClientMain
+## __all__ = [ ]
+## import mixminion.BuildMessage
+## import mixminion.Crypto
+## import mixminion.Common
+## import mixminion.Config
+## import mixminion.MMTPClient
+## import mixminion.Packet
+## import mixminion.ServerInfo
+## import mixminion.ClientMain
+## import mixminion.server

Index: benchmark.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/benchmark.py,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- benchmark.py	11 Dec 2002 05:53:33 -0000	1.16
+++ benchmark.py	11 Dec 2002 06:58:55 -0000	1.17
@@ -286,7 +286,7 @@
                     pass
 
 def _hashlogTiming(fname, load):
-    from mixminion.HashLog import HashLog
+    from mixminion.server.HashLog import HashLog
 
     # Try more realistic access patterns.
     prng = AESCounterPRNG("a"*16)
@@ -381,7 +381,7 @@
     def seenHash(self,h): return 0
     def logHash(self,h): pass
 
-from mixminion.PacketHandler import PacketHandler
+from mixminion.server.PacketHandler import PacketHandler
 from mixminion.Packet import SMTP_TYPE
 
 def serverProcessTiming():

Index: test.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/test.py,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -d -r1.45 -r1.46
--- test.py	11 Dec 2002 05:53:33 -0000	1.45
+++ test.py	11 Dec 2002 06:58:55 -0000	1.46
@@ -841,7 +841,7 @@
 
 
 #----------------------------------------------------------------------
-from mixminion.HashLog import HashLog
+from mixminion.server.HashLog import HashLog
 
 class HashLogTests(unittest.TestCase):
     def test_hashlog(self):
@@ -935,8 +935,8 @@
 
 #----------------------------------------------------------------------
 import mixminion.BuildMessage as BuildMessage
-import mixminion.Modules
-from mixminion.Modules import *
+import mixminion.server.Modules
+from mixminion.server.Modules import *
 
 # Dummy PRNG class that just returns 0-valued bytes.  We use this to make
 # generated padding predictable in our BuildMessage tests below.
@@ -1634,7 +1634,7 @@
 
 class PacketHandlerTests(unittest.TestCase):
     def setUp(self):
-        from mixminion.PacketHandler import PacketHandler
+        from mixminion.server.PacketHandler import PacketHandler
         self.pk1 = getRSAKey(0,1024)
         self.pk2 = getRSAKey(1,1024)
         self.pk3 = getRSAKey(2,1024)
@@ -1738,7 +1738,7 @@
         bfm = BuildMessage.buildForwardMessage
         brm = BuildMessage.buildReplyMessage
         brbi = BuildMessage._buildReplyBlockImpl
-        from mixminion.PacketHandler import ContentError
+        from mixminion.server.PacketHandler import ContentError
 
         # A long intermediate header needs to fail.
         server1X = FakeServerInfo("127.0.0.1", 1, self.pk1, "X"*20)
@@ -1859,7 +1859,7 @@
 # QUEUE
 
 from mixminion.Common import waitForChildren
-from mixminion.Queue import *
+from mixminion.server.Queue import *
 
 class TestDeliveryQueue(DeliveryQueue):
     def __init__(self,d):
@@ -2275,7 +2275,7 @@
 # MMTP
 # FFFF Write more tests
 
-import mixminion.MMTPServer
+import mixminion.server.MMTPServer
 import mixminion.MMTPClient
 
 # Run on a different port so we don't conflict with any actual servers
@@ -2324,7 +2324,7 @@
     """Helper function: create a new MMTP server with a listener connection
        Return a tuple of AsyncServer, ListenerConnection, list of received
        messages, and keyid."""
-    server = mixminion.MMTPServer.AsyncServer()
+    server = mixminion.server.MMTPServer.AsyncServer()
     messagesIn = []
     def receivedHook(pkt,m=messagesIn):
 	m.append(pkt)
@@ -2332,9 +2332,9 @@
 		   receiveMessage=receivedHook):
 	tls = context.sock(sock, serverMode=1)
 	sock.setblocking(0)
-	return mixminion.MMTPServer.MMTPServerConnection(sock,tls,
+	return mixminion.server.MMTPServer.MMTPServerConnection(sock,tls,
 							 receiveMessage)
-    listener = mixminion.MMTPServer.ListenConnection("127.0.0.1",
+    listener = mixminion.server.MMTPServer.ListenConnection("127.0.0.1",
 						 TEST_PORT, 5, conFactory)
     listener.register(server)
     pk = _ml.rsa_PEM_read_key(open(pkfile, 'r'), public=0)
@@ -2405,8 +2405,8 @@
         self.server = server
 
         messages = ["helloxxx"*4096, "helloyyy"*4096]
-        async = mixminion.MMTPServer.AsyncServer()
-        clientcon = mixminion.MMTPServer.MMTPClientConnection(
+        async = mixminion.server.MMTPServer.AsyncServer()
+        clientcon = mixminion.server.MMTPServer.MMTPClientConnection(
            _getTLSContext(0), "127.0.0.1", TEST_PORT, keyid, messages[:],
 	   [None, None], None)
         clientcon.register(async)
@@ -2428,7 +2428,7 @@
         self.failUnless(messagesIn == messages)
 
         # Again, with bad keyid.
-        clientcon = mixminion.MMTPServer.MMTPClientConnection(
+        clientcon = mixminion.server.MMTPServer.MMTPClientConnection(
            _getTLSContext(0), "127.0.0.1", TEST_PORT, "Z"*20,
            messages[:], [None, None], None)
         clientcon.register(async)
@@ -2861,10 +2861,10 @@
 # Text of an example module that we load dynamically.
 EXAMPLE_MODULE_TEXT = \
 """
-import mixminion.Modules
+import mixminion.server.Modules
 from mixminion.Config import ConfigError
 
-class TestModule(mixminion.Modules.DeliveryModule):
+class TestModule(mixminion.server.Modules.DeliveryModule):
     def __init__(self):
 	self.processedMessages = []
 	self.processedAll = []
@@ -2896,11 +2896,11 @@
 	self.processedMessages.append(message)
 	self.processedAll.append( (message, tag, exitType, exitInfo) )
 	if exitInfo == 'fail?':
-	    return mixminion.Modules.DELIVER_FAIL_RETRY
+	    return mixminion.server.Modules.DELIVER_FAIL_RETRY
 	elif exitInfo == 'fail!':
-	    return mixminion.Modules.DELIVER_FAIL_NORETRY
+	    return mixminion.server.Modules.DELIVER_FAIL_NORETRY
 	else:
-	    return mixminion.Modules.DELIVER_OK
+	    return mixminion.server.Modules.DELIVER_OK
 """
 
 class ModuleManagerTests(unittest.TestCase):
@@ -2951,7 +2951,7 @@
 	queue = manager.queues['TestModule']
 	# Did the test module's delivery queue get the messages?
 	self.failUnless(isinstance(queue,
-			   mixminion.Modules.SimpleModuleDeliveryQueue))
+			   mixminion.server.Modules.SimpleModuleDeliveryQueue))
 	self.assertEquals(3, queue.count())
 	# Has it processed any yet? (No.)
 	self.assertEquals(exampleMod.processedMessages, [])
@@ -3049,8 +3049,8 @@
 
     def testDecoding(self):
 	'test decoding and test encapsulation.'
-	em = mixminion.Modules._escapeMessage
-	eme = mixminion.Modules._escapeMessageForEmail
+	em = mixminion.server.Modules._escapeMessage
+	eme = mixminion.server.Modules._escapeMessageForEmail
 
 	message = "Somebody set up us the module!\n\n(What you say?)\n"
 	binmessage = hexread("00ADD1EDC0FFEED00DAD")*40
@@ -3126,7 +3126,7 @@
 	manager = self.getManager()
 
 	# Configure the module.
-	module = mixminion.Modules.MixmasterSMTPModule()
+	module = mixminion.server.Modules.MixmasterSMTPModule()
 	module.configure({"Delivery/SMTP-Via-Mixmaster" :
 			  {"Enabled":1, "Server": "nonesuch",
 			   "SubjectLine":'foobar', 
@@ -3170,7 +3170,7 @@
 	   with a stub function so that we don't actually send anything."""
         # Configure the module
 	manager = self.getManager()
-	module = mixminion.Modules.MBoxModule()	
+	module = mixminion.server.Modules.MBoxModule()	
 	addrfile = mix_mktemp()
 	writeFile(addrfile, MBOX_ADDRESS_SAMPLE)
 	module.configure({'Server':{'Nickname': "nickname"},
@@ -3188,8 +3188,8 @@
 			   module.addresses)
 	queue = manager.queues['MBOX']
 	# Stub out sendSMTPMessage.
-	replaceFunction(mixminion.Modules, 'sendSMTPMessage',
- 	         lambda *args: mixminion.Modules.DELIVER_OK)
+	replaceFunction(mixminion.server.Modules, 'sendSMTPMessage',
+ 	         lambda *args: mixminion.server.Modules.DELIVER_OK)
 	try:
 	    # Try queueing a message...
 	    queue.queueDeliveryMessage((MBOX_TYPE, 'mixdiddy', "x"*20),
@@ -3227,7 +3227,7 @@
     def testDirectoryDump(self):
 	"""Check out the DirectoryStoreModule that we use for testing on
 	   machines with unreliable/nonexistant SMTP."""
-	eme = mixminion.Modules._escapeMessageForEmail
+	eme = mixminion.server.Modules._escapeMessageForEmail
 	dir = mix_mktemp()
 	manager = self.getManager()
 	# Configure the module: disabled and enabled (queueless mode)
@@ -3311,7 +3311,7 @@
 	    resumeLog()
 
 #----------------------------------------------------------------------
-import mixminion.ServerMain
+import mixminion.server.ServerMain
 
 # Sample server configuration to test ServerMain.
 SERVERCFG = """
@@ -3338,7 +3338,7 @@
 	conf = mixminion.Config.ServerConfig(string=cfg)
     finally:
 	resumeLog()
-    return mixminion.ServerMain.ServerKeyring(conf)
+    return mixminion.server.ServerMain.ServerKeyring(conf)
 
 class ServerMainTests(unittest.TestCase):
     def testServerKeyring(self):

Index: testSupport.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/testSupport.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- testSupport.py	9 Dec 2002 04:47:40 -0000	1.9
+++ testSupport.py	11 Dec 2002 06:58:55 -0000	1.10
@@ -16,7 +16,7 @@
 import mixminion.Common
 from mixminion.Common import waitForChildren, createPrivateDir, LOG
 from mixminion.Config import _parseBoolean, ConfigError
-from mixminion.Modules import DeliveryModule, ImmediateDeliveryQueue, \
+from mixminion.server.Modules import DeliveryModule, ImmediateDeliveryQueue, \
      SimpleModuleDeliveryQueue, DELIVER_OK, DELIVER_FAIL_RETRY, \
      DELIVER_FAIL_NORETRY, _escapeMessageForEmail
 

--- HashLog.py DELETED ---

--- MMTPServer.py DELETED ---

--- Modules.py DELETED ---

--- PacketHandler.py DELETED ---

--- Queue.py DELETED ---

--- ServerMain.py DELETED ---