import changes to graphframe

This commit is contained in:
blitzman
2017-02-07 00:33:15 -05:00
parent 5fda29e651
commit 542542f48d
2 changed files with 15 additions and 5 deletions

View File

@@ -19,6 +19,7 @@
import os
import logging
import imp
import wx
@@ -30,15 +31,15 @@ from gui.graph import Graph
from gui.bitmapLoader import BitmapLoader
from config import parsePath
# Don't actually import the thing, since it takes for fucking ever
try:
import matplotlib as mpl
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as Canvas
from matplotlib.figure import Figure
imp.find_module('matplotlib')
enabled = True
mplImported = False
except ImportError:
enabled = False
mplImported = False
logger = logging.getLogger(__name__)
if not enabled:
logger.info("Problems importing matplotlib; continuing without graphs")
@@ -50,6 +51,15 @@ class GraphFrame(wx.Frame):
global enabled
global mplImported
# Import here
try:
import matplotlib as mpl
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as Canvas
from matplotlib.figure import Figure
enabled = True
except ImportError:
enabled = False
self.legendFix = False
if not enabled:
return

View File

@@ -22,7 +22,7 @@ import wx
import config
from service.character import Character
import gui.mainFrame
import gui.graphFrame
#import gui.graphFrame
import gui.globalEvents as GE
from gui.bitmapLoader import BitmapLoader