[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[minion-cvs] Fix a bug with pooling code under python 2.0
Update of /home/minion/cvsroot/src/minion/lib/mixminion
In directory moria.mit.edu:/tmp/cvs-serv32617/lib/mixminion
Modified Files:
ClientMain.py Packet.py
Log Message:
Fix a bug with pooling code under python 2.0
Index: ClientMain.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/ClientMain.py,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -d -r1.63 -r1.64
--- ClientMain.py 19 Feb 2003 03:40:34 -0000 1.63
+++ ClientMain.py 20 Feb 2003 00:31:12 -0000 1.64
@@ -1232,7 +1232,7 @@
for fname in fnames:
if fname.startswith("pkt_"):
handles.append(fname[4:])
- return handles
+ return handles
finally:
clientUnlock()
@@ -1271,6 +1271,7 @@
timesByServer = {}
for h in handles:
_, routing, when = self.getPacket(h)
+ print str(routing)
timesByServer.setdefault(routing, []).append(when)
for s in timesByServer.keys():
count = len(timesByServer[s])
Index: Packet.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/Packet.py,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- Packet.py 17 Feb 2003 14:40:34 -0000 1.35
+++ Packet.py 20 Feb 2003 00:31:12 -0000 1.36
@@ -573,9 +573,14 @@
def __hash__(self):
return hash(self.pack())
- def __eq__(self, other):
- return (type(self) == type(other) and self.ip == other.ip and
- self.port == other.port and self.keyinfo == other.keyinfo)
+ def __cmp__(self, other):
+ r = cmp(type(self), type(other))
+ if r: return r
+ r = cmp(self.ip, other.ip)
+ if r: return r
+ r = cmp(self.port, other.port)
+ if r: return n
+ return cmp(self.keyinfo, other.keyinfo)
def parseSMTPInfo(s):
"""Convert the encoding of an SMTP exitinfo into an SMTPInfo object."""