From 21b6108345e2274deeca9285068521e088d50105 Mon Sep 17 00:00:00 2001 From: lastpoet Date: Mon, 4 Oct 2010 20:39:34 +0100 Subject: [PATCH] Fix matplotlib warning Harmonise matplotlib backend --- pyfpdb/GuiGraphViewer.py | 4 +++- pyfpdb/GuiSessionViewer.py | 2 +- pyfpdb/GuiTourneyGraphViewer.py | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) mode change 100755 => 100644 pyfpdb/GuiSessionViewer.py diff --git a/pyfpdb/GuiGraphViewer.py b/pyfpdb/GuiGraphViewer.py index e6e783a6..df584d11 100644 --- a/pyfpdb/GuiGraphViewer.py +++ b/pyfpdb/GuiGraphViewer.py @@ -35,8 +35,10 @@ import Filters import Charset try: + calluse = not 'matplotlib' in sys.modules import matplotlib - matplotlib.use('GTKCairo') + if calluse: + matplotlib.use('GTKCairo') from matplotlib.figure import Figure from matplotlib.backends.backend_gtk import FigureCanvasGTK as FigureCanvas from matplotlib.backends.backend_gtkagg import NavigationToolbar2GTKAgg as NavigationToolbar diff --git a/pyfpdb/GuiSessionViewer.py b/pyfpdb/GuiSessionViewer.py old mode 100755 new mode 100644 index 53360680..d12f1d10 --- a/pyfpdb/GuiSessionViewer.py +++ b/pyfpdb/GuiSessionViewer.py @@ -30,7 +30,7 @@ try: calluse = not 'matplotlib' in sys.modules import matplotlib if calluse: - matplotlib.use('GTK') + matplotlib.use('GTKCairo') from matplotlib.figure import Figure from matplotlib.backends.backend_gtk import FigureCanvasGTK as FigureCanvas from matplotlib.backends.backend_gtkagg import NavigationToolbar2GTKAgg as NavigationToolbar diff --git a/pyfpdb/GuiTourneyGraphViewer.py b/pyfpdb/GuiTourneyGraphViewer.py index a1a5cc7d..04f3b626 100644 --- a/pyfpdb/GuiTourneyGraphViewer.py +++ b/pyfpdb/GuiTourneyGraphViewer.py @@ -35,8 +35,10 @@ import Filters import Charset try: + calluse = not 'matplotlib' in sys.modules import matplotlib - matplotlib.use('GTKCairo') + if calluse: + matplotlib.use('GTKCairo') from matplotlib.figure import Figure from matplotlib.backends.backend_gtk import FigureCanvasGTK as FigureCanvas from matplotlib.backends.backend_gtkagg import NavigationToolbar2GTKAgg as NavigationToolbar