Mercurial > hg > config
annotate python/quotemail.py @ 501:f9a4e1572b54
add http://pietrushnic.blogspot.com/2012/02/arbtt-as-productivity-improver-for.html#.Uh_LB5WZi1E
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Thu, 29 Aug 2013 15:36:08 -0700 |
parents | 6bbc4867a795 |
children | c78da6f7ca79 |
rev | line source |
---|---|
365
6bbc4867a795
begin porting from shell function
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
1 #!/usr/bin/env python |
6bbc4867a795
begin porting from shell function
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
2 |
6bbc4867a795
begin porting from shell function
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
3 """ |
6bbc4867a795
begin porting from shell function
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
4 quote as per email |
6bbc4867a795
begin porting from shell function
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
5 """ |
6bbc4867a795
begin porting from shell function
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
6 |
6bbc4867a795
begin porting from shell function
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
7 def prefix(text, quote='> '): |
6bbc4867a795
begin porting from shell function
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
8 return '\n'.join(['%s%s' % (quote, line.rstrip()) |
6bbc4867a795
begin porting from shell function
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
9 for line in text.strip().splitlines()]) |
6bbc4867a795
begin porting from shell function
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
10 |
6bbc4867a795
begin porting from shell function
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
11 if __name__ == '__main__': |
6bbc4867a795
begin porting from shell function
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
12 import sys |
6bbc4867a795
begin porting from shell function
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
13 print prefix(sys.stdin.read()) |