diff options
author | Bryan Bishop <kanzure@gmail.com> | 2013-08-31 11:04:27 -0500 |
---|---|---|
committer | Bryan Bishop <kanzure@gmail.com> | 2013-08-31 11:04:27 -0500 |
commit | 70be18427b069cae7ffcfb84811ae268fa18afce (patch) | |
tree | e76233549123599ff935c44045377267e6546d44 /prequeue.py | |
parent | ca0981eb36a86c1cd868e6f8ca13b42162afdc3f (diff) |
don't call load_pokecrystal_macros 2000 times
Also, don't call make_macro_table 2000 times by only calling it once and
passing the result.
Diffstat (limited to 'prequeue.py')
-rw-r--r-- | prequeue.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/prequeue.py b/prequeue.py index 2c8f4cf5a..58790f702 100644 --- a/prequeue.py +++ b/prequeue.py @@ -9,9 +9,15 @@ import os import sys import preprocessor -if __name__ == '__main__': +def main(): + macros = preprocessor.load_pokecrystal_macros() + macro_table = preprocessor.make_macro_table(macros) + 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(preprocessor.load_pokecrystal_macros()) + preprocessor.preprocess(macro_table) + +if __name__ == '__main__': + main() |