def output_headers(msg, outfile=sys.stdout):
unix_from = msg.get_unixfrom()
if unix_from:
- output(unix_from + os.linesep)
+ output(unix_from + '\n')
for key, value in msg.items():
output("%s: %s\n" % (key, value), outfile)
output("\n", outfile) # End of headers
arguments = init()
la = len(arguments)
- if la == 0:
- infile = sys.stdin
- elif la <> 1:
+ if la >= 2:
usage(1)
- elif arguments[0] == '-':
+ if (la == 0) or (arguments[0] == '-'):
infile = sys.stdin
else:
infile = open(arguments[0], 'r')