Limnoria/sandbox/averagePrefix.py
2003-03-12 06:26:59 +00:00

19 lines
339 B
Python

#!/usr/bin/env python
import sys
import ircmsgs
import ircutils
sys.path.append('..')
if __name__ == '__main__':
total = 0
lines = 0
for line in sys.stdin:
msg = ircmsgs.IrcMsg(line)
if ircutils.isUserHostmask(msg.prefix):
total += len(msg.prefix)
lines += 1
print total / lines