From 94052ab5b94a8817c62f1d3d06da2e1c9d5be658 Mon Sep 17 00:00:00 2001 From: yenatch Date: Sun, 8 Dec 2013 17:05:28 -0500 Subject: prequeue: dont initialize a new preprocessor for each file --- preprocessor.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'preprocessor.py') diff --git a/preprocessor.py b/preprocessor.py index b5f2e3a4a..c9f90553b 100644 --- a/preprocessor.py +++ b/preprocessor.py @@ -51,17 +51,16 @@ def load_pokecrystal_macros(): return ourmacros -def preprocess(config, macros, lines=None): - """ - Entry point for the preprocessor. - """ +def setup_processor(): + config = configuration.Config() + macros = load_pokecrystal_macros() processor = preprocessor.Preprocessor(config, macros) - return processor.preprocess(lines=lines) + return processor def main(): - config = configuration.Config() - macros = load_pokecrystal_macros() - return preprocess(config, macros) + processor = setup_processor() + processor.preprocess() + processor.update_globals # only run against stdin when not included as a module if __name__ == "__main__": -- cgit v1.2.3 From dd7989cef8e393980f482b69ab2472170ee44da8 Mon Sep 17 00:00:00 2001 From: yenatch Date: Thu, 19 Dec 2013 04:49:20 -0500 Subject: preprocessor: battle animation macros --- preprocessor.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'preprocessor.py') diff --git a/preprocessor.py b/preprocessor.py index c9f90553b..93508c027 100644 --- a/preprocessor.py +++ b/preprocessor.py @@ -25,6 +25,11 @@ from extras.pokemontools.audio import ( Note, ) +from extras.pokemontools.battle_animations import ( + Wait, + battle_animation_classes, +) + def load_pokecrystal_macros(): """ Construct a list of macros that are needed for pokecrystal preprocessing. @@ -40,6 +45,7 @@ def load_pokecrystal_macros(): ChannelCommand, OctaveCommand, Note, + Wait, ] ourmacros += command_classes @@ -48,6 +54,7 @@ def load_pokecrystal_macros(): ourmacros += movement_command_classes ourmacros += music_classes ourmacros += effect_classes + ourmacros += battle_animation_classes return ourmacros -- cgit v1.2.3 From e56aa096a31c288031770acb8570f5249281c4b0 Mon Sep 17 00:00:00 2001 From: yenatch Date: Wed, 25 Dec 2013 06:19:37 -0500 Subject: preprocessor: rename macro class Wait to BattleAnimWait --- preprocessor.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'preprocessor.py') diff --git a/preprocessor.py b/preprocessor.py index 93508c027..f5bc08637 100644 --- a/preprocessor.py +++ b/preprocessor.py @@ -26,7 +26,7 @@ from extras.pokemontools.audio import ( ) from extras.pokemontools.battle_animations import ( - Wait, + BattleAnimWait, battle_animation_classes, ) @@ -45,7 +45,6 @@ def load_pokecrystal_macros(): ChannelCommand, OctaveCommand, Note, - Wait, ] ourmacros += command_classes @@ -54,7 +53,7 @@ def load_pokecrystal_macros(): ourmacros += movement_command_classes ourmacros += music_classes ourmacros += effect_classes - ourmacros += battle_animation_classes + ourmacros += battle_animation_classes + [BattleAnimWait] return ourmacros -- cgit v1.2.3