summaryrefslogtreecommitdiff
path: root/prequeue.py
diff options
context:
space:
mode:
authorBryan Bishop <kanzure@gmail.com>2013-06-25 20:10:38 -0700
committerBryan Bishop <kanzure@gmail.com>2013-06-25 20:10:38 -0700
commit4b2d4337b4f1edbac50fc369c0207043e0a9cce3 (patch)
tree19fc5cb20a37e7a4b7a0c29f9f07c3aa1f309872 /prequeue.py
parentac773a9dc1499f7070dc98236c66de6309885210 (diff)
parent859c70ff42588a9de354063c42f6665e5d174299 (diff)
Merge pull request #149 from yenatch/new-install
reformat install + fix source preprocessing
Diffstat (limited to 'prequeue.py')
-rw-r--r--prequeue.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/prequeue.py b/prequeue.py
new file mode 100644
index 000000000..156d3e942
--- /dev/null
+++ b/prequeue.py
@@ -0,0 +1,17 @@
+# coding: utf-8
+
+# Starting a new python process to preprocess each source file
+# creates too much overhead. Instead, a list of files to preprocess
+# is fed into a script run from a single process.
+
+import os
+import sys
+import preprocessor
+
+if __name__ == '__main__':
+ for source in sys.argv[1:]:
+ dest = os.path.splitext(source)[0] + '.tx'
+ sys.stdin = open(source, 'r')
+ sys.stdout = open(dest, 'w')
+ preprocessor.preprocess()
+