I'm starting off with the Spell Timer in the config file:
Create a couple of dataclasses to have structured data types to be able to get some type hints and protections
Moved the valid_spells into a new file that will hold constants
this should help keep the source files down to more manageable sizes
it also allows tests to be able to stub in custom values for the functions that rely on them
Replaced some file open() calls with the more pythonic with open()
Removed the check to see if a spell_timing file existed, there were a few logic paths to try and determine if the file would need to be "new" or just "updated", but the difference between the two paths were not that necessary
instead, this will just always update the valid_spells, since it's so fast now
Always generate the spell timer data with only spells that do not have a duration of 0
In order to write meaningful tests for the config.py file (https://github.com/mgeitz/eqalert/issues/240) we'll need to break it up into more manageable pieces.
I'm starting off with the Spell Timer in the config file:
Create a couple of dataclasses to have structured data types to be able to get some type hints and protections
Moved the
valid_spells
into a new file that will hold constantsReplaced some file
open()
calls with the more pythonicwith open()
Removed the check to see if a spell_timing file existed, there were a few logic paths to try and determine if the file would need to be "new" or just "updated", but the difference between the two paths were not that necessary
Always generate the spell timer data with only spells that do not have a duration of 0