[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] make the debugging information somewhat less chatty
Update of /home/or/cvsroot/control/python
In directory moria:/tmp/cvs-serv21130
Modified Files:
TorCtl1.py
Log Message:
make the debugging information somewhat less chatty
Index: TorCtl1.py
===================================================================
RCS file: /home/or/cvsroot/control/python/TorCtl1.py,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- TorCtl1.py 19 Nov 2005 19:42:31 -0000 1.22
+++ TorCtl1.py 22 Nov 2005 05:56:23 -0000 1.23
@@ -100,7 +100,7 @@
more = []
while 1:
line = f.readline()
- if debugFile:
+ if debugFile and tp != "+":
debugFile.write(" %s" % line)
if line in (".\r\n", ".\n"):
break
@@ -134,7 +134,11 @@
def _doSend(self, msg):
if self._debugFile:
- self._debugFile.write(">>> %s" % msg)
+ amsg = msg
+ lines = amsg.split("\n")
+ if len(lines) > 3:
+ amsg = "\n".join(lines[:3])
+ self._debugFile.write(">>> %s" % amsg)
self._s.write(msg)
def _sendAndRecv(self, msg="", expectedTypes=("250", "251")):
@@ -148,7 +152,7 @@
assert msg.endswith("\r\n")
lines = self._sendImpl(self._doSend, msg)
- print lines
+ # print lines
for tp, msg, _ in lines:
if tp[0] in '45':
raise TorCtl.ErrorReply("%s %s"%(tp, msg))