Skip to content

Commit

Permalink
Fix issues with imports from file
Browse files Browse the repository at this point in the history
  • Loading branch information
Ebag333 committed Jun 12, 2017
1 parent 8058039 commit a2fefcd
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 17 deletions.
34 changes: 19 additions & 15 deletions gui/shipBrowser.py
Expand Up @@ -627,7 +627,8 @@ def RefreshContent(self):

def RefreshList(self, event):
stage = self.GetActiveStage()
if stage == 3 or stage == 4:

if stage in (3, 4):
self.lpane.RefreshList(True)
event.Skip()

Expand Down Expand Up @@ -919,6 +920,10 @@ def searchStage(self, event):
self.Layout()

def importStage(self, event):
"""
The import stage handles both displaying fits after importing as well as displaying recent fits. todo: need to
reconcile these two better into a more uniform function, right now hacked together to get working
"""
self.lpane.ShowLoading(False)

self.navpanel.ShowNewFitButton(False)
Expand All @@ -932,29 +937,28 @@ def importStage(self, event):

fits = event.fits

# sort by ship name, then fit name
fits.sort(key=lambda _fit: (_fit.ship.item.name, _fit.name))

self.lastdata = fits
self.lpane.Freeze()
self.lpane.DestroyAllChildren()

if fits:
for fit in fits:
shipTrait = fit.ship.item.traits.traitText if (fit.ship.item.traits is not None) else ""
shipItem = fit[3]
shipTrait = shipItem.traits.traitText if (shipItem.traits is not None) else ""
# empty string if no traits

self.lpane.AddWidget(FitItem(
self.lpane,
fit.ID,
(
fit.ship.item.name,
shipTrait,
fit.name,
fit.booster,
fit.timestamp,
),
fit.ship.item.ID,
self.lpane,
fit[0],
(
shipItem.name,
shipTrait,
fit[1],
False,
fit[2],
fit[4]
),
shipItem.ID,
))
self.lpane.RefreshList(doFocus=False)
self.lpane.Thaw()
Expand Down
16 changes: 14 additions & 2 deletions service/conversions.py
Expand Up @@ -1064,8 +1064,20 @@ def __init__(self):
See GH issue #67 on why this is needed
"""
self.PACKS['skinnedShips'] = {
"Miasmos Amastris Edition" : "Miasmos Quafe Ultra Edition",
"Miasmos Quafe Ultramarine Edition": "Miasmos Quafe Ultra Edition",
"Rattlesnake Victory Edition" : "Rattlesnake",
"Stratios Emergency Responder" : "Stratios",
"Aliastra Catalyst" : "Catalyst",
"Inner Zone Shipping Catalyst" : "Catalyst",
"Intaki Syndicate Catalyst" : "Catalyst",
"InterBus Catalyst" : "Catalyst",
"Quafe Catalyst" : "Catalyst",
"Inner Zone Shipping Imicus" : "Imicus",
"Miasmos Amastris Edition" : "Miasmos",
"Miasmos Quafe Ultra Edition" : "Miasmos",
"Miasmos Quafe Ultramarine Edition": "Miasmos",
"Nefantar Thrasher" : "Thrasher",
"Sarum Magnate" : "Magnate",
"Tash-Murkon Magnate" : "Magnate",
"Sukuuvestaa Heron" : "Heron",
"Vherokior Probe" : "Probe",
}

0 comments on commit a2fefcd

Please sign in to comment.