Fri, 13 Jun 2014 01:04:30 +0300
- added verbosity setting
cobalt.py | file | annotate | diff | comparison | revisions |
--- 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:])