Merge branch 'master' of https://github.com/pyfa-org/Pyfa
This commit is contained in:
@@ -741,7 +741,7 @@ class FittingView(d.Display):
|
||||
# noinspection PyPropertyAccess
|
||||
def MakeSnapshot(self, maxColumns=1337):
|
||||
if self.FVsnapshot:
|
||||
del self.FVsnapshot
|
||||
self.FVsnapshot = None
|
||||
|
||||
tbmp = wx.Bitmap(16, 16)
|
||||
tdc = wx.MemoryDC()
|
||||
|
||||
@@ -157,6 +157,19 @@ class EveFittings(wx.Frame):
|
||||
self.statusbar.SetStatusText(msg)
|
||||
|
||||
|
||||
class ESIServerExceptionHandler(object):
|
||||
def __init__(self, parentWindow, ex):
|
||||
dlg = wx.MessageDialog(parentWindow,
|
||||
"There was an issue starting up the localized server, try setting "
|
||||
"Login Authentication Method to Manual by going to Preferences -> EVE SS0 -> "
|
||||
"Login Authentication Method. If this doesn't fix the problem please file an "
|
||||
"issue on Github.",
|
||||
"Add Character Error",
|
||||
wx.OK | wx.ICON_ERROR)
|
||||
dlg.ShowModal()
|
||||
pyfalog.error(ex)
|
||||
|
||||
|
||||
class ESIExceptionHandler(object):
|
||||
# todo: make this a generate excetpion handler for all calls
|
||||
def __init__(self, parentWindow, ex):
|
||||
@@ -325,10 +338,12 @@ class SsoCharacterMgmt(wx.Dialog):
|
||||
self.lcCharacters.SetColumnWidth(0, wx.LIST_AUTOSIZE)
|
||||
self.lcCharacters.SetColumnWidth(1, wx.LIST_AUTOSIZE)
|
||||
|
||||
@staticmethod
|
||||
def addChar(event):
|
||||
sEsi = Esi.getInstance()
|
||||
sEsi.login()
|
||||
def addChar(self, event):
|
||||
try:
|
||||
sEsi = Esi.getInstance()
|
||||
sEsi.login()
|
||||
except Exception as ex:
|
||||
ESIServerExceptionHandler(self, ex)
|
||||
|
||||
def delChar(self, event):
|
||||
item = self.lcCharacters.GetFirstSelected()
|
||||
|
||||
@@ -90,7 +90,7 @@ class exportHtmlThread(threading.Thread):
|
||||
<link rel="stylesheet" href="https://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.css" />
|
||||
<script src="https://code.jquery.com/jquery-1.11.0.min.js"></script>
|
||||
<script>
|
||||
// http://stackoverflow.com/questions/32453806/uncaught-securityerror-failed-to-execute-replacestate-on-history-cannot-be
|
||||
//http://stackoverflow.com/questions/32453806/uncaught-securityerror-failed-to-execute-replacestate-on-history-cannot-be
|
||||
$(document).bind('mobileinit',function(){
|
||||
$.mobile.changePage.defaults.changeHash = false;
|
||||
$.mobile.hashListeningEnabled = false;
|
||||
@@ -195,55 +195,51 @@ class exportHtmlThread(threading.Thread):
|
||||
|
||||
if len(fits) > 0:
|
||||
groupFits += len(fits)
|
||||
HTMLship = (
|
||||
' <li data-role="collapsible" data-iconpos="right" data-shadow="false" '
|
||||
'data-corners="false">\n'
|
||||
' <h2>' + ship.name + ' <span class="ui-li-count">' + str(
|
||||
len(fits)) + '</span></h2>\n'
|
||||
' <ul data-role="listview" data-shadow="false" data-inset="true" '
|
||||
'data-corners="false">\n'
|
||||
)
|
||||
|
||||
if len(fits) == 1:
|
||||
for fit in fits:
|
||||
if self.stopRunning:
|
||||
return
|
||||
fit = fits[0]
|
||||
try:
|
||||
dnaFit = Port.exportDna(getFit(fit[0]))
|
||||
HTMLgroup += ' <li><a data-dna="' + dnaFit + '" target="_blank">' + ship.name + ": " + \
|
||||
fit[1] + '</a></li>\n'
|
||||
eftFit = Port.exportEft(getFit(fit[0]))
|
||||
print(eftFit)
|
||||
|
||||
HTMLfit = (
|
||||
' <li data-role="collapsible" data-iconpos="right" data-shadow="false" '
|
||||
'data-corners="false">\n'
|
||||
' <h2>' + fit[1] + '</h2>\n'
|
||||
' <ul data-role="listview" data-shadow="false" data-inset="true" '
|
||||
'data-corners="false">\n'
|
||||
)
|
||||
|
||||
HTMLfit += ' <li><pre>' + eftFit + '\n </pre></li>\n'
|
||||
|
||||
HTMLfit += ' </ul>\n </li>\n'
|
||||
HTMLship += HTMLfit
|
||||
except:
|
||||
pyfalog.warning("Failed to export line")
|
||||
pass
|
||||
continue
|
||||
finally:
|
||||
if self.callback:
|
||||
wx.CallAfter(self.callback, count)
|
||||
count += 1
|
||||
else:
|
||||
# Ship group header
|
||||
HTMLship = (
|
||||
' <li data-role="collapsible" data-iconpos="right" data-shadow="false" data-corners="false">\n'
|
||||
' <h2>' + ship.name + ' <span class="ui-li-count">' + str(
|
||||
len(fits)) + '</span></h2>\n'
|
||||
' <ul data-role="listview" data-shadow="false" data-inset="true" data-corners="false">\n'
|
||||
)
|
||||
|
||||
for fit in fits:
|
||||
if self.stopRunning:
|
||||
return
|
||||
try:
|
||||
dnaFit = Port.exportDna(getFit(fit[0]))
|
||||
print(dnaFit)
|
||||
HTMLship += ' <li><a data-dna="' + dnaFit + '" target="_blank">' + fit[
|
||||
1] + '</a></li>\n'
|
||||
except:
|
||||
pyfalog.warning("Failed to export line")
|
||||
continue
|
||||
finally:
|
||||
if self.callback:
|
||||
wx.CallAfter(self.callback, count)
|
||||
count += 1
|
||||
HTMLgroup += HTMLship + (' </ul>\n'
|
||||
' </li>\n')
|
||||
HTMLgroup += HTMLship + (' </ul>\n'
|
||||
' </li>\n')
|
||||
|
||||
if groupFits > 0:
|
||||
# Market group header
|
||||
HTML += (
|
||||
' <li data-role="collapsible" data-iconpos="right" data-shadow="false" data-corners="false">\n'
|
||||
' <h2>' + group.groupName + ' <span class="ui-li-count">' + str(groupFits) + '</span></h2>\n'
|
||||
' <ul data-role="listview" data-shadow="false" data-inset="true" data-corners="false">\n' + HTMLgroup +
|
||||
' <ul data-role="listview" data-shadow="false" data-inset="true" data-corners="false">\n'
|
||||
+ HTMLgroup +
|
||||
' </ul>\n'
|
||||
' </li>'
|
||||
)
|
||||
@@ -279,7 +275,8 @@ class exportHtmlThread(threading.Thread):
|
||||
return
|
||||
try:
|
||||
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'
|
||||
except:
|
||||
pyfalog.error("Failed to export line")
|
||||
|
||||
Reference in New Issue
Block a user