blitzmann / fitShop

Tool to use in Eve Online for evaluating the value of items sourced from various places within the game and out
0 stars 0 forks source link

Investigate incompatible typing with result returns #3

Open blitzmann opened 11 years ago

blitzmann commented 11 years ago

With commit 2881ac6 changes were pushed that refactored the return results slightly. The list of items now returns as a dictionary like so:

{typeID: {item properties}, ...}, where as before it was a list such as: [{item properties}]

The reason for this change: the EveFit class has a property called modules with is a list of itemIDs associated with that fit. I do not store other item information in EveFit since all that information is already in an EveItem instance. So, when displaying the fittings for the ship, I needed access to the item properties, hence the change to a key-value.

However, I ran into some problems. On submission of the fit, everything worked as expected. the the item keys and the fit module typeIDs were stored as int. However, when loading from a saved result, the module list continued to be int however the items keys were all loaded as strings. This caused me to not be able to get the item properties (as the key types were not the same). I was forced to explicitly define both the item keys and module list as strings (line 165 and 606 fitShop.py)

This must be looked into further.