pret/pokemon-reverse-engineering-tools

BSSReader reads literally everything

Opened this issue · 1 comments

Not sure if this is a problem in my OS but a preprocessor somehow don't let me make it with this error:

Traceback (most recent call last):
    File "prequeue.py", line 11, in <module>
        import preprocessor
    File "/home/pigu/pokecrystal/preprocessor.py", line 30, in <module>
    from extras.pokemontools.battle_animations import (
    File "/home/pigu/pokecrystal/extras/pokemontools/battle_animations.py", line 43, in <module>
        objs  = { k: v for k, v in anims.items() if 'ANIM_OBJ' in v }
    File "/home/pigu/pokecrystal/extras/pokemontools/battle_animations.py", line 43, in <dictcomp>
        objs  = { k: v for k, v in anims.items() if 'ANIM_OBJ' in v }
TypeError: argument of type 'int' is not iterable

So I decided to print anims variable, it appears that it contains constant entries and every Python builtins entries as well...

http://pastebin.com/3nWbPHjK

So, is there a way to work around this problem?

Instead of writing an expression parser, constants are intepreted with eval. eval optionally takes a dict of supplementary variables (globals). If __builtins__ isn't already a key, it's added to the dict.

This was addressed some time ago in 0dd6b20 but never merged into the main fork. This is fixed in #86.