Check the ness to see if it's an implant, booster, or something else.

Log it if it's something else and don't try and import it. This prevents
a bad line from failing the entire import, and (hopefully) we know about
it.
This commit is contained in:
Ebag333
2016-12-27 12:32:52 -08:00
parent 7ee4d1d588
commit f9ba95b3de

View File

@@ -406,11 +406,12 @@ class Port(object):
cargoMap[modName] = 0
cargoMap[modName] += extraAmount
elif item.category.name == "Implant":
try:
if "implantness" in item.attributes:
fit.implants.append(Implant(item))
except ValueError:
# Passed item isn't an implant. Try loading it as a booster.
elif "boosterness" in item.attributes:
fit.boosters.append(Booster(item))
else:
logger.error("Failed to import implant: %s", line)
# elif item.category.name == "Subsystem":
# try:
# subsystem = Module(item)