bin/clean_mail @ b44883779e1b bpollack/use-command-to-explicitly-call-ag-and-us-1442506830050
Close branch
| author | Steve Losh <steve@stevelosh.com> | 
|---|---|
| date | Thu, 17 Sep 2015 16:37:39 +0000 | 
| parents | 5ddfd5a61ea1 | 
| children | c106ae0760f8 | 
#!/usr/bin/env python import sys def next_line(): l = sys.stdin.readline() if not l: sys.exit(0) return l # Skip headers l = next_line() while l.strip(): sys.stdout.write(l) l = next_line() # One blank line in between headers and the start of the message while not l.strip(): l = next_line() sys.stdout.write('\n') sys.stdout.write(l) # Dump the rest straight through for l in sys.stdin.readlines(): sys.stdout.write(l)