Skip to content

v0.5.1-rev0 - Add command name lookup array

Compare
Choose a tag to compare
@Askaholic Askaholic released this 25 Apr 21:42
1963778

New in this version

Command names can be looked up through the NAMES array:

>>>  from fafreplay import commands
>>> commands.NAMES[0]
"Advance"

New in the previous version

Note that as of version 0.5.1, there is an additional constant commands.MAX that defines the maximum valid command id. This can be used to verify validity of command ids or to construct a parser that parses all commands:

>>> from fafreplay import commands, Parser
>>> if command_id > commands.MAX:
...     raise Exception("Invalid command id")
>>> parser = Parser(commands=range(commands.MAX + 1))

Also note that the commands argument to Parser can now be any iterable. Again, both of these changes are available in 0.5.1