diff options
author | Bryan Bishop <kanzure@gmail.com> | 2013-12-09 17:48:11 -0800 |
---|---|---|
committer | Bryan Bishop <kanzure@gmail.com> | 2013-12-09 17:48:11 -0800 |
commit | 58de3846c732a5e3e856ea8935a6e6ab830af82a (patch) | |
tree | f0e3918e1e9f0955c656c720f78a3fc169d53ad2 /pokemontools/preprocessor.py | |
parent | 4294fdc140677f98df38affe7955a97223b778e9 (diff) | |
parent | f35bb2c5cc390ec0008cede2721104592dbcb29d (diff) |
Merge pull request #59 from yenatch/dependencies
Use a mapfile instead of labels.json; object dependency handling
Diffstat (limited to 'pokemontools/preprocessor.py')
-rw-r--r-- | pokemontools/preprocessor.py | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/pokemontools/preprocessor.py b/pokemontools/preprocessor.py index f4e92b6..bde5f70 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): """ |