From f5ddc3370560a4b5f58ea79a513d4bf1207fa9f4 Mon Sep 17 00:00:00 2001 From: yenatch Date: Sat, 7 Dec 2013 05:05:54 -0500 Subject: preprocessor: dont write to globals.asm for each process --- pokemontools/preprocessor.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'pokemontools/preprocessor.py') diff --git a/pokemontools/preprocessor.py b/pokemontools/preprocessor.py index 5fe0851..24a74e1 100644 --- a/pokemontools/preprocessor.py +++ b/pokemontools/preprocessor.py @@ -483,22 +483,18 @@ class Preprocessor(object): for l in lines: self.read_line(l) - self.update_globals() - def update_globals(self): """ Add any labels not already in globals.asm. """ - # TODO: pokered needs to be fixed - try: - globes = open(os.path.join(self.config.path, 'globals.asm'), 'r+') + path = os.path.join(self.config.path, 'globals.asm') + if os.path.exists(path): + globes = open(path, 'r+') lines = globes.readlines() for globe in self.globes: line = 'GLOBAL ' + globe + '\n' if line not in lines: globes.write(line) - except Exception as exception: - pass # don't care if it's not there... def read_line(self, l): """ -- cgit v1.2.3