# HG changeset patch # User Jeff Hammel # Date 1373587302 25200 # Node ID 6bbc4867a795fc41d15591e9012c0fcf5dc20c47 # Parent 2e33cd82af584dd6da45ae74e97bdb7725138faf begin porting from shell function diff -r 2e33cd82af58 -r 6bbc4867a795 python/quotemail.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/python/quotemail.py Thu Jul 11 17:01:42 2013 -0700 @@ -0,0 +1,13 @@ +#!/usr/bin/env python + +""" +quote as per email +""" + +def prefix(text, quote='> '): + return '\n'.join(['%s%s' % (quote, line.rstrip()) + for line in text.strip().splitlines()]) + +if __name__ == '__main__': + import sys + print prefix(sys.stdin.read())