Mercurial > hg > config
changeset 365:6bbc4867a795
begin porting from shell function
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Thu, 11 Jul 2013 17:01:42 -0700 |
parents | 2e33cd82af58 |
children | ace6c399fcb1 |
files | python/quotemail.py |
diffstat | 1 files changed, 13 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /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())