diff options
-rw-r--r-- | preprocessor.py | 4 | ||||
-rw-r--r-- | prequeue.py | 13 |
2 files changed, 11 insertions, 6 deletions
diff --git a/preprocessor.py b/preprocessor.py index 317a2fe6..cb9353af 100644 --- a/preprocessor.py +++ b/preprocessor.py @@ -279,7 +279,9 @@ def setup_processor(): def main(): processor = setup_processor() - processor.preprocess() + output = processor.preprocess() + processor.update_globals() + return output if __name__ == '__main__': main() diff --git a/prequeue.py b/prequeue.py index 6ad16d2c..00bcee36 100644 --- a/prequeue.py +++ b/prequeue.py @@ -13,17 +13,20 @@ import preprocessor def main(): processor = preprocessor.setup_processor() + stdin = sys.stdin + stdout = sys.stdout + for source in sys.argv[1:]: dest = os.path.splitext(source)[0] + '.tx' - - stdout = sys.stdout - sys.stdin = open(source, 'r') sys.stdout = open(dest, 'w') - processor.preprocess() - sys.stdout = stdout + processor.update_globals() + + sys.stdin = stdin + sys.stdout = stdout + if __name__ == '__main__': main() |