# HG changeset patch # User Santeri Piippo # Date 1402610670 -10800 # Node ID 0604f6b9f781a1cffd36aa690b7be73296af9d14 # Parent dd467db4b18e25bde7d69db6f1a53970ad8bdbe7 - added verbosity setting diff -r dd467db4b18e -r 0604f6b9f781 cobalt.py --- a/cobalt.py Fri Jun 13 00:49:09 2014 +0300 +++ b/cobalt.py Fri Jun 13 01:04:30 2014 +0300 @@ -145,6 +145,7 @@ self.umode = cfg['umode'] if 'umode' in cfg else '' self.cfg = cfg self.mynick = '' + self.verbose = cfg['verbose'] if 'verbose' in cfg else False if not 'conflictsuffix' in self.cfg: self.cfg['conflictsuffix'] = '`' @@ -186,7 +187,8 @@ def send_all_now (self): for line in self.send_buffer: - print "[%s] <- %s" % (self.name, line) + if self.verbose: + print "[%s] <- %s" % (self.name, line) self.send ("%s\n" % line) self.send_buffer = [] @@ -194,7 +196,8 @@ lines = self.recv (4096).splitlines() for utfline in lines: line = utfline.decode("utf-8").encode("ascii","ignore") - print "[%s] -> %s" % (self.name, line) + if self.verbose: + print "[%s] -> %s" % (self.name, line) if line.startswith ("PING :"): self.write ("PONG :%s" % line[6:])