Remove debugging prints or move them to pyfalog

This commit is contained in:
DarkPhoenix
2019-03-23 14:01:43 +03:00
parent 87a246204b
commit 48ac6cb2af
10 changed files with 20 additions and 33 deletions

View File

@@ -171,9 +171,6 @@ def defPaths(customSavePath=None):
eos.config.saveddata_connectionstring = "sqlite:///" + saveDB + "?check_same_thread=False"
eos.config.gamedata_connectionstring = "sqlite:///" + gameDB + "?check_same_thread=False"
print(eos.config.saveddata_connectionstring)
print(eos.config.gamedata_connectionstring)
# initialize the settings
from service.settings import EOSSettings
eos.config.settings = EOSSettings.getInstance().EOSSettings # this is kind of confusing, but whatever

View File

@@ -58,7 +58,6 @@ def rel_listener(target, value, initiator):
if not target or (isinstance(value, Module) and value.isEmpty):
return
print("{} has had a relationship change :D".format(target))
target.modified = datetime.datetime.now()

View File

@@ -27,7 +27,8 @@ from logbook import Logger
import config
logging = Logger(__name__)
pyfalog = Logger(__name__)
class BitmapLoader(object):
@@ -38,7 +39,7 @@ class BitmapLoader(object):
# logging.info("Using local image files.")
# archive = None
logging.info("Using local image files.")
pyfalog.info("Using local image files.")
archive = None
cached_bitmaps = OrderedDict()
@@ -93,7 +94,7 @@ class BitmapLoader(object):
filename, img = cls.loadScaledBitmap(name, location, scale)
if img is None:
print(("Missing icon file: {0}/{1}".format(location, filename)))
pyfalog.warning("Missing icon file: {0}/{1}".format(location, filename))
return None
bmp: wx.Bitmap = img.ConvertToBitmap()
@@ -130,7 +131,7 @@ class BitmapLoader(object):
sbuf = io.StringIO(img_data)
return wx.ImageFromStream(sbuf)
except KeyError:
print(("Missing icon file from zip: {0}".format(path)))
pyfalog.warning("Missing icon file from zip: {0}".format(path))
else:
path = os.path.join(config.pyfaPath, 'imgs' + os.sep + location + os.sep + filename)

View File

@@ -202,7 +202,7 @@ class ItemView(Display):
mktgrpid = sMkt.getMarketGroupByItem(item).ID
except AttributeError:
mktgrpid = -1
print(("unable to find market group for", item.name))
pyfalog.warning("unable to find market group for {}".format(item.name))
parentname = sMkt.getParentItemByItem(item).name
# Get position of market group
metagrpid = sMkt.getMetaGroupIdByItem(item)

View File

@@ -82,7 +82,7 @@ class FitSpawner(gui.multiSwitch.TabSpawner):
if not isinstance(view, FittingView):
view = FittingView(self.multiSwitch)
print("###################### Created new view:" + repr(view))
pyfalog.debug("###################### Created new view:" + repr(view))
self.multiSwitch.ReplaceActivePage(view)
view.fitSelected(event)
@@ -174,8 +174,8 @@ class FittingView(d.Display):
self.Bind(wx.EVT_MOTION, self.OnMouseMove)
self.Bind(wx.EVT_LEAVE_WINDOW, self.OnLeaveWindow)
self.parent.Bind(EVT_NOTEBOOK_PAGE_CHANGED, self.pageChanged)
print("------------------ new fitting view -------------------")
print(self)
pyfalog.debug("------------------ new fitting view -------------------")
pyfalog.debug(self)
def OnLeaveWindow(self, event):
self.SetToolTip(None)
@@ -224,16 +224,7 @@ class FittingView(d.Display):
wx.PostEvent(self.mainFrame, FitSelected(fitID=fitID))
def Destroy(self):
# @todo: when wxPython 4.0.2 is release, https://github.com/pyfa-org/Pyfa/issues/1586#issuecomment-390074915
# Make sure to remove the shitty checks that I have to put in place for these handlers to ignore when self is None
print("+++++ Destroy " + repr(self))
# print(self.parent.Unbind(EVT_NOTEBOOK_PAGE_CHANGED))
# print(self.mainFrame.Unbind(GE.FIT_CHANGED, handler=self.fitChanged))
# print(self.mainFrame.Unbind(EVT_FIT_RENAMED, handler=self.fitRenamed ))
# print(self.mainFrame.Unbind(EVT_FIT_REMOVED, handler=self.fitRemoved))
# print(self.mainFrame.Unbind(ITEM_SELECTED, handler=self.appendItem))
pyfalog.debug("+++++ Destroy " + repr(self))
d.Display.Destroy(self)
def pageChanged(self, event):
@@ -296,7 +287,6 @@ class FittingView(d.Display):
delete fit caused change in stats (projected)
todo: move this to the notebook, not the page. We don't want the page being responsible for deleting itself
"""
print('_+_+_+_+_+_ Fit Removed: {} {} activeFitID: {}, eventFitID: {}'.format(repr(self), str(bool(self)), self.activeFitID, event.fitID))
pyfalog.debug("FittingView::fitRemoved")
if not self:
event.Skip()
@@ -331,7 +321,7 @@ class FittingView(d.Display):
event.Skip()
def fitSelected(self, event):
print('====== Fit Selected: ' + repr(self) + str(bool(self)))
pyfalog.debug('====== Fit Selected: ' + repr(self) + str(bool(self)))
if self.parent.IsActive(self):
fitID = event.fitID

View File

@@ -93,8 +93,8 @@ class GraphFrame(wx.Frame):
graphFrame_enabled = True
if int(mpl.__version__[0]) < 1:
print(("pyfa: Found matplotlib version ", mpl.__version__, " - activating OVER9000 workarounds"))
print("pyfa: Recommended minimum matplotlib version is 1.0.0")
pyfalog.warning("pyfa: Found matplotlib version {} - activating OVER9000 workarounds".format(mpl.__version__))
pyfalog.warning("pyfa: Recommended minimum matplotlib version is 1.0.0")
self.legendFix = True
mplImported = True

View File

@@ -73,17 +73,18 @@ from service.settings import HTMLExportSettings, SettingsProvider
from service.update import Update
import gui.fitCommands as cmd
pyfalog = Logger(__name__)
disableOverrideEditor = False
try:
from gui.propertyEditor import AttributeEditor
except ImportError as e:
AttributeEditor = None
print(("Error loading Attribute Editor: %s.\nAccess to Attribute Editor is disabled." % e.message))
pyfalog.warning("Error loading Attribute Editor: %s.\nAccess to Attribute Editor is disabled." % e.message)
disableOverrideEditor = True
pyfalog = Logger(__name__)
pyfalog.debug("Done loading mainframe imports")
@@ -421,7 +422,7 @@ class MainFrame(wx.Frame):
if '.' not in os.path.basename(path):
path += ".xml"
else:
print(("oops, invalid fit format %d" % format_))
pyfalog.warning("oops, invalid fit format %d" % format_)
try:
dlg.Destroy()
except RuntimeError:

View File

@@ -68,7 +68,7 @@ class exportHtmlThread(threading.Thread):
FILE.write(HTML)
FILE.close()
except IOError as ex:
print(("Failed to write to " + settings.getPath()))
pyfalog.warning("Failed to write to " + settings.getPath())
pass
except Exception as ex:
pass

View File

@@ -155,7 +155,6 @@ class Esi(EsiAccess):
res.json()
)
cdata = res.json()
print(cdata)
currentCharacter = self.getSsoCharacter(cdata['CharacterName'])

View File

@@ -50,7 +50,7 @@ class DeferRecalc:
def __enter__(self):
self._recalc = self.sFit.recalc
self.sFit.recalc = lambda x: print('Deferred Recalc')
self.sFit.recalc = lambda x: pyfalog.debug('Deferred Recalc')
def __exit__(self, *args):
self.sFit.recalc = self._recalc