# HG changeset patch # User Jeff Hammel # Date 1376083309 25200 # Node ID 5c62ebf2dd47346d620d7f517d97cc0b06c9a357 # Parent a00edb8cf3d72b670cde5fe518e9b168d99255fe python/stripirssi.py diff -r a00edb8cf3d7 -r 5c62ebf2dd47 python/stripirssi.py --- a/python/stripirssi.py Fri Aug 09 11:27:36 2013 -0700 +++ b/python/stripirssi.py Fri Aug 09 14:21:49 2013 -0700 @@ -40,12 +40,12 @@ if not line: continue # XXX desirable? prefix, rest = line.split(separator, 1) - if length is not None: + if length is None: length = len(prefix) else: if len(prefix) != length: if not line[:len(prefix)].isspace(): - raise AssertionError # XXX + raise AssertionError("Non whitespace found below pre (%s) in line %s" % (length, line)) stripped.append(line[length:]) return stripped @@ -76,7 +76,7 @@ if last: last = '%s %s' % (last, line.strip()) else: - joined.append(line.strip() + joined.append(line.strip()) else: if last: joined.append(last) @@ -98,5 +98,12 @@ # parser.add_option - strip nicks options, args = parser.parse_args(args) + log = sys.stdin.read().strip() + + # strip timestamps + lines = strip_first_column(log) + + print '\n'.join(lines) + if __name__ == '__main__': main()