From abefe21796251db02bb125ca265f600de178a7a5 Mon Sep 17 00:00:00 2001 From: WatchMeCalculate Date: Tue, 5 Jun 2018 23:42:00 -0700 Subject: [PATCH 1/4] Adds exception handler for when HttpServer fails on init --- gui/esiFittings.py | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/gui/esiFittings.py b/gui/esiFittings.py index 99d8f33eb..af3da77a5 100644 --- a/gui/esiFittings.py +++ b/gui/esiFittings.py @@ -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() From b7b60e4ea60a786d6aa17f939bd1c75a0efa00fa Mon Sep 17 00:00:00 2001 From: surculus12 Date: Mon, 11 Jun 2018 15:24:17 +0000 Subject: [PATCH 2/4] resolves #1633 --- gui/builtinViews/fittingView.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui/builtinViews/fittingView.py b/gui/builtinViews/fittingView.py index 9a7a97a43..d6bf4ae0c 100644 --- a/gui/builtinViews/fittingView.py +++ b/gui/builtinViews/fittingView.py @@ -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() From 8a18047957a07caa175aa66dd6dd354621dc8d84 Mon Sep 17 00:00:00 2001 From: burnsypet Date: Tue, 12 Jun 2018 19:17:39 +0100 Subject: [PATCH 3/4] HTML export now contains EFT block --- gui/utils/exportHtml.py | 65 ++++++++++++++++++++--------------------- 1 file changed, 31 insertions(+), 34 deletions(-) diff --git a/gui/utils/exportHtml.py b/gui/utils/exportHtml.py index 0d5456dd0..233b79c78 100644 --- a/gui/utils/exportHtml.py +++ b/gui/utils/exportHtml.py @@ -195,55 +195,51 @@ class exportHtmlThread(threading.Thread): if len(fits) > 0: groupFits += len(fits) + HTMLship = ( + '
  • \n' + '

    ' + ship.name + ' ' + str( + len(fits)) + '

    \n' + '
      \n' + ) - if len(fits) == 1: + for fit in fits: if self.stopRunning: return - fit = fits[0] try: - dnaFit = Port.exportDna(getFit(fit[0])) - HTMLgroup += '
    • ' + ship.name + ": " + \ - fit[1] + '
    • \n' + eftFit = Port.exportEft(getFit(fit[0])) + print(eftFit) + + HTMLfit = ( + '
    • \n' + '

      ' + fit[1] + '

      \n' + '
        \n' + ) + + HTMLfit += '
      • ' + eftFit + '\n                   
      • \n' + + HTMLfit += '
      \n
    • \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 = ( - '
    • \n' - '

      ' + ship.name + ' ' + str( - len(fits)) + '

      \n' - '
        \n' - ) - - for fit in fits: - if self.stopRunning: - return - try: - dnaFit = Port.exportDna(getFit(fit[0])) - print(dnaFit) - HTMLship += '
      • ' + fit[ - 1] + '
      • \n' - except: - pyfalog.warning("Failed to export line") - continue - finally: - if self.callback: - wx.CallAfter(self.callback, count) - count += 1 - HTMLgroup += HTMLship + ('
      \n' - '
    • \n') + HTMLgroup += HTMLship + ('
    \n' + '
  • \n') if groupFits > 0: # Market group header HTML += ( '
  • \n' '

    ' + group.groupName + ' ' + str(groupFits) + '

    \n' - '
      \n' + HTMLgroup + + '
        \n' + + HTMLgroup + '
      \n' ' ' ) @@ -279,7 +275,8 @@ class exportHtmlThread(threading.Thread): return try: dnaFit = Port.exportDna(getFit(fit[0])) - HTML += '' + ship.name + ': ' + \ + HTML += '' \ + + ship.name + ': ' + \ fit[1] + '
      \n' except: pyfalog.error("Failed to export line") From ab6200e2c1de06ef4ee9d5ba990a86a4e7b0d446 Mon Sep 17 00:00:00 2001 From: burnsypet Date: Tue, 12 Jun 2018 20:11:39 +0100 Subject: [PATCH 4/4] Fixed line length for PEP8 --- gui/utils/exportHtml.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui/utils/exportHtml.py b/gui/utils/exportHtml.py index 233b79c78..796e3aa4c 100644 --- a/gui/utils/exportHtml.py +++ b/gui/utils/exportHtml.py @@ -90,7 +90,7 @@ class exportHtmlThread(threading.Thread):