diff --git a/config.py b/config.py index a2f124bb3..447e81763 100644 --- a/config.py +++ b/config.py @@ -97,7 +97,7 @@ def defPaths(customSavePath): # maintenance script gameDB = os.path.join(pyfaPath, "eve.db") - ## DON'T MODIFY ANYTHING BELOW ## + # DON'T MODIFY ANYTHING BELOW import eos.config # Caching modifiers, disable all gamedata caching, its unneeded. @@ -105,43 +105,3 @@ def defPaths(customSavePath): # saveddata db location modifier, shouldn't ever need to touch this eos.config.saveddata_connectionstring = "sqlite:///" + saveDB + "?check_same_thread=False" eos.config.gamedata_connectionstring = "sqlite:///" + gameDB + "?check_same_thread=False" - -# Keeping disabled code here for now until we can determine with decent certainty that this isn't needed -''' -def getPyfaPath(Append=None): - base = getattr(sys.modules['__main__'], "__file__", sys.executable) if isFrozen() else sys.argv[0] - root = os.path.dirname(os.path.realpath(os.path.abspath(base))) - - if Append: - path = parsePath(root, Append) - else: - path = parsePath(root) - - return path - - -def getSavePath(Append=None): - root = savePath - - if Append: - path = parsePath(root, Append) - else: - path = parsePath(root) - - return path - - -def parsePath(root, Append=None): - if Append: - path = os.path.join(root, Append) - else: - path = root - - if type(path) == str: # leave unicode ones alone - try: - path = path.decode('utf8') - except UnicodeDecodeError: - path = path.decode('windows-1252') - - return path -''' \ No newline at end of file diff --git a/gui/errorDialog.py b/gui/errorDialog.py index b9e70c851..469eb9e63 100644 --- a/gui/errorDialog.py +++ b/gui/errorDialog.py @@ -1,4 +1,4 @@ -#=============================================================================== +# =============================================================================== # Copyright (C) 2010 Diego Duclos # # This file is part of pyfa. @@ -15,23 +15,25 @@ # # You should have received a copy of the GNU General Public License # along with pyfa. If not, see . -#=============================================================================== +# =============================================================================== import wx import sys import gui.utils.fonts as fonts import config + class ErrorFrame(wx.Frame): def __init__(self, exception, tb): - wx.Frame.__init__(self, None, id=wx.ID_ANY, title="pyfa error", pos=wx.DefaultPosition, size=wx.Size(500, 400), style=wx.DEFAULT_FRAME_STYLE^ wx.RESIZE_BORDER|wx.STAY_ON_TOP) + wx.Frame.__init__(self, None, id=wx.ID_ANY, title="pyfa error", pos=wx.DefaultPosition, size=wx.Size(500, 400), + style=wx.DEFAULT_FRAME_STYLE ^ wx.RESIZE_BORDER | wx.STAY_ON_TOP) - desc = "pyfa has experienced an unexpected error. Below is the " \ - "Traceback that contains crucial information about how this " \ - "error was triggered. Please contact the developers with " \ - "the information provided through the EVE Online forums " \ - "or file a GitHub issue." + desc = "pyfa has experienced an unexpected error. Below is the " \ + "Traceback that contains crucial information about how this " \ + "error was triggered. Please contact the developers with " \ + "the information provided through the EVE Online forums " \ + "or file a GitHub issue." self.SetSizeHintsSz(wx.DefaultSize, wx.DefaultSize) @@ -50,7 +52,8 @@ class ErrorFrame(wx.Frame): mainSizer.Add(wx.StaticLine(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL), 0, wx.EXPAND | wx.ALL, 5) descSizer = wx.BoxSizer(wx.HORIZONTAL) - self.descText = wx.TextCtrl(self, wx.ID_ANY, desc, wx.DefaultPosition, wx.DefaultSize, wx.TE_AUTO_URL|wx.TE_MULTILINE|wx.TE_READONLY|wx.BORDER_NONE|wx.TRANSPARENT_WINDOW ) + self.descText = wx.TextCtrl(self, wx.ID_ANY, desc, wx.DefaultPosition, wx.DefaultSize, + wx.TE_AUTO_URL | wx.TE_MULTILINE | wx.TE_READONLY | wx.BORDER_NONE | wx.TRANSPARENT_WINDOW) self.descText.SetFont(wx.Font(fonts.BIG, wx.SWISS, wx.NORMAL, wx.NORMAL)) descSizer.Add(self.descText, 1, wx.ALL, 5) mainSizer.Add(descSizer, 1, wx.EXPAND, 5) @@ -65,11 +68,11 @@ class ErrorFrame(wx.Frame): mainSizer.Add(self.eveForums, 0, wx.ALL, 2) - #mainSizer.AddSpacer((0, 5), 0, wx.EXPAND, 5) + # mainSizer.AddSpacer((0, 5), 0, wx.EXPAND, 5) - self.errorTextCtrl = wx.TextCtrl(self, wx.ID_ANY, "", wx.DefaultPosition, wx.DefaultSize, wx.TE_MULTILINE|wx.TE_READONLY|wx.TE_RICH2|wx.TE_DONTWRAP) + self.errorTextCtrl = wx.TextCtrl(self, wx.ID_ANY, "", wx.DefaultPosition, wx.DefaultSize, wx.TE_MULTILINE | wx.TE_READONLY | wx.TE_RICH2 | wx.TE_DONTWRAP) self.errorTextCtrl.SetFont(wx.Font(8, wx.FONTFAMILY_TELETYPE, wx.NORMAL, wx.NORMAL)) - mainSizer.Add(self.errorTextCtrl, 0, wx.EXPAND|wx.LEFT|wx.RIGHT, 5) + mainSizer.Add(self.errorTextCtrl, 0, wx.EXPAND | wx.LEFT | wx.RIGHT, 5) self.errorTextCtrl.AppendText("pyfa root: ") self.errorTextCtrl.AppendText(config.pyfaPath or "Unknown") @@ -88,4 +91,4 @@ class ErrorFrame(wx.Frame): self.Centre(wx.BOTH) - self.Show() \ No newline at end of file + self.Show() diff --git a/gui/graphFrame.py b/gui/graphFrame.py index addf23ad6..7a0aa3387 100644 --- a/gui/graphFrame.py +++ b/gui/graphFrame.py @@ -92,7 +92,7 @@ class GraphFrame(wx.Frame): except: cache_dir = os.path.expanduser(os.path.join("~", ".matplotlib")) - cache_file = path = os.path.join(cache_dir, 'fontList.cache') + cache_file = os.path.join(cache_dir, 'fontList.cache') if os.access(cache_dir, os.W_OK | os.X_OK) and os.path.isfile(cache_file): # remove matplotlib font cache, see #234 diff --git a/gui/utils/exportHtml.py b/gui/utils/exportHtml.py index 3ca337b07..ba075a35f 100644 --- a/gui/utils/exportHtml.py +++ b/gui/utils/exportHtml.py @@ -7,9 +7,9 @@ from service.fit import Fit from service.port import Port from service.market import Market from logbook import Logger +from eos.db import getFit pyfalog = Logger(__name__) -from eos.db import getFit class exportHtml(object): diff --git a/pyfa.py b/pyfa.py index f6c60397f..488165724 100755 --- a/pyfa.py +++ b/pyfa.py @@ -282,7 +282,6 @@ if __name__ == "__main__": if hasattr(sys, 'frozen') and options.debug: pyfalog.critical("Running in frozen mode with debug turned on. Forcing all output to be written to log.") - from gui.mainFrame import MainFrame pyfa = wx.App(False) diff --git a/service/crest.py b/service/crest.py index c0c7491c5..27f5b6c5e 100644 --- a/service/crest.py +++ b/service/crest.py @@ -1,6 +1,5 @@ # noinspection PyPackageRequirements import wx -import thread from logbook import Logger import threading import copy diff --git a/service/price.py b/service/price.py index efbb51542..facb5e389 100644 --- a/service/price.py +++ b/service/price.py @@ -23,9 +23,11 @@ from xml.dom import minidom from eos import db from service.network import Network, TimeoutError -from logbook import Logger -pyfalog = Logger(__name__) from service.fit import Fit +from logbook import Logger + +pyfalog = Logger(__name__) + VALIDITY = 24 * 60 * 60 # Price validity period, 24 hours REREQUEST = 4 * 60 * 60 # Re-request delay for failed fetches, 4 hours