summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2014-08-26 09:54:25 (GMT)
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2014-08-26 09:54:25 (GMT)
commit3cbe6a78bb84c3ba9027b28502b9838a9461f580 (patch)
tree3eb992ce19d37368ca6e9fca019bedad8b4a6c9e
parentff33439396de9d9ec6976f5dbb5cdfb3bd5c55ce (diff)
downloadpython-sievelib-master.tar.gz
Allow greater verbosity in communicationsHEADmaster
-rw-r--r--sievelib/managesieve.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/sievelib/managesieve.py b/sievelib/managesieve.py
index 2c889e2..b1d2cd0 100644
--- a/sievelib/managesieve.py
+++ b/sievelib/managesieve.py
@@ -88,6 +88,7 @@ class Client(object):
def __dprint(self, message):
if not self.__debug:
return
+ print(message)
def __read_block(self, size):
"""Read a block of 'size' bytes from the server.
@@ -116,6 +117,7 @@ class Client(object):
buf += self.sock.recv(size)
except (socket.timeout, ssl.SSLError), e:
raise Error("Failed to read %d bytes from the server" % size)
+ self.__dprint("S: %s" % buf)
return buf
def __read_line(self):
@@ -162,6 +164,7 @@ class Client(object):
if m.group(1) == "NO":
self.__parse_error(m.group(2))
raise Response(m.group(1), m.group(2))
+ self.__dprint("S: %s" % ret)
return ret
def __read_response(self, nblines=-1):
@@ -235,7 +238,7 @@ class Client(object):
tosend = name
if len(args):
tosend += " " + " ".join(self.__prepare_args(args))
- self.__dprint("Command: %s" % tosend)
+ self.__dprint("C: %s" % tosend)
self.sock.send("%s%s" % (tosend, CRLF))
for l in extralines:
self.sock.send("%s%s" % (l, CRLF))