summaryrefslogtreecommitdiffstats
path: root/filter.py
diff options
context:
space:
mode:
authorThibaut Horel <thibaut.horel@gmail.com>2014-08-17 20:27:44 -0400
committerThibaut Horel <thibaut.horel@gmail.com>2014-08-17 20:27:44 -0400
commitcb2e7c09daefafad97618763f43c991baf8e9365 (patch)
tree339bec874ce6b0b6efec33943b93325db63de153 /filter.py
downloadmutt-helpers-cb2e7c09daefafad97618763f43c991baf8e9365.tar.gz
Initial commit
Diffstat (limited to 'filter.py')
-rwxr-xr-xfilter.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/filter.py b/filter.py
new file mode 100755
index 0000000..59f27fe
--- /dev/null
+++ b/filter.py
@@ -0,0 +1,17 @@
+#! /usr/bin/python2
+import os
+import sys
+from subprocess import PIPE, Popen
+
+os.environ["PARINIT"] = "85rTbgqR0d1 B=.,?!_A_a Q=_s>|+"
+
+for line in sys.stdin:
+ line = line.strip()
+ print line
+ if not line:
+ break
+sys.stdout.flush()
+
+p = Popen("par", stdin=PIPE)
+for line in sys.stdin:
+ p.stdin.write(line)