This commit is contained in:
blitzman
2017-02-25 16:44:31 -05:00
parent 6ab936ef09
commit 3cbd154c8a

View File

@@ -4,7 +4,9 @@ import time
import wx import wx
from service.settings import HTMLExportSettings from service.settings import HTMLExportSettings
from service.fit import Fit from service.fit import Fit
from service.port import Port
from service.market import Market from service.market import Market
from eos.db import getFit
class exportHtml(object): class exportHtml(object):
@@ -173,6 +175,7 @@ class exportHtmlThread(threading.Thread):
count = 0 count = 0
#todo: logging for export exceptions
for group in categoryList: for group in categoryList:
# init market group string to give ships something to attach to # init market group string to give ships something to attach to
HTMLgroup = '' HTMLgroup = ''
@@ -184,6 +187,7 @@ class exportHtmlThread(threading.Thread):
groupFits = 0 groupFits = 0
for ship in ships: for ship in ships:
fits = sFit.getFitsWithShip(ship.ID) fits = sFit.getFitsWithShip(ship.ID)
if len(fits) > 0: if len(fits) > 0:
groupFits += len(fits) groupFits += len(fits)
@@ -192,11 +196,11 @@ class exportHtmlThread(threading.Thread):
return return
fit = fits[0] fit = fits[0]
try: try:
dnaFit = sFit.exportDna(fit[0]) dnaFit = Port.exportDna(getFit(fit[0]))
HTMLgroup += ' <li><a data-dna="' + dnaFit + '" target="_blank">' + ship.name + ": " + \ HTMLgroup += ' <li><a data-dna="' + dnaFit + '" target="_blank">' + ship.name + ": " + \
fit[1] + '</a></li>\n' fit[1] + '</a></li>\n'
except: except Exception, e:
pass continue
finally: finally:
if self.callback: if self.callback:
wx.CallAfter(self.callback, count) wx.CallAfter(self.callback, count)
@@ -214,10 +218,11 @@ class exportHtmlThread(threading.Thread):
if self.stopRunning: if self.stopRunning:
return return
try: try:
dnaFit = sFit.exportDna(fit[0]) dnaFit = Port.exportDna(getFit(fit[0]))
print dnaFit
HTMLship += ' <li><a data-dna="' + dnaFit + '" target="_blank">' + fit[ HTMLship += ' <li><a data-dna="' + dnaFit + '" target="_blank">' + fit[
1] + '</a></li>\n' 1] + '</a></li>\n'
except: except Exception, e:
continue continue
finally: finally:
if self.callback: if self.callback:
@@ -266,10 +271,10 @@ class exportHtmlThread(threading.Thread):
if self.stopRunning: if self.stopRunning:
return return
try: try:
dnaFit = sFit.exportDna(fit[0]) dnaFit = Port.exportDna(getFit(fit[0]))
HTML += '<a class="outOfGameBrowserLink" target="_blank" href="' + dnaUrl + dnaFit + '">' + ship.name + ': ' + \ HTML += '<a class="outOfGameBrowserLink" target="_blank" href="' + dnaUrl + dnaFit + '">' + ship.name + ': ' + \
fit[1] + '</a><br> \n' fit[1] + '</a><br> \n'
except: except Exception, e:
continue continue
finally: finally:
if self.callback: if self.callback: