You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is because Pyfa defaults to DNA when no other importation method matches the incoming clipboard data. And when you do a DNA import, you split with : and then take the first number and get the item for that number. Item 42 is Spiced Wine, and that is fed into Pyfa's Ship class, which blindly accepts whatever Item it receives.
A cursory glance tell me that there is no current isShip or equivalent attribute or function to determine if an item is a ship or not. Modules don't have this problem, because as part of their __init__ they try to calculate slot, and if slot cannot be found it raises an error. This isn't much of a problem when Pyfa is the only one initializing Ship with data, but here we take user input and don't double check.
A quick fix would be make sure that DNA, when split, contains at least 3 elements (because DNA, as an EVE client standard, always ends with ::). Although many programs out there accept it without the trailing :: (including the eve client), I haven't seen one that exports without it, so it should be an easy and sane commit.
A proper fix would be to check at time of Ship.__init__ that it is indeed a ship. I'll poke around with it and see if there's an easy way to figure this out (via rig count? ship-specific attribute?).
The text was updated successfully, but these errors were encountered:
Actually, it was very easy to enforce ships only in Ship.__init__.
Because of this, I think I'll forgo enforcing requirement of :: in DNA just in case there's a third part tool out there that exports it incorrectly. I'm going to keep DNA import the same for now.
Copy the number 42 to your clipboard
Paste into Pyfa
New fit created:
Spiced Wine - DNA Imported
This is because Pyfa defaults to DNA when no other importation method matches the incoming clipboard data. And when you do a DNA import, you split with
:
and then take the first number and get the item for that number. Item 42 is Spiced Wine, and that is fed into Pyfa'sShip
class, which blindly accepts whateverItem
it receives.A cursory glance tell me that there is no current
isShip
or equivalent attribute or function to determine if an item is a ship or not. Modules don't have this problem, because as part of their__init__
they try to calculate slot, and if slot cannot be found it raises an error. This isn't much of a problem when Pyfa is the only one initializingShip
with data, but here we take user input and don't double check.A quick fix would be make sure that DNA, when split, contains at least 3 elements (because DNA, as an EVE client standard, always ends with
::
). Although many programs out there accept it without the trailing::
(including the eve client), I haven't seen one that exports without it, so it should be an easy and sane commit.A proper fix would be to check at time of
Ship.__init__
that it is indeed a ship. I'll poke around with it and see if there's an easy way to figure this out (via rig count? ship-specific attribute?).The text was updated successfully, but these errors were encountered: