From 76e06c801ffd2b61076c90266a77776a29768b42 Mon Sep 17 00:00:00 2001 From: wmayer Date: Sat, 21 Sep 2013 15:45:25 +0200 Subject: [PATCH] 0001231: Annoying messages at startup --- src/Mod/Plot/InitGui.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/Mod/Plot/InitGui.py b/src/Mod/Plot/InitGui.py index e19720a3f..2afc60afa 100644 --- a/src/Mod/Plot/InitGui.py +++ b/src/Mod/Plot/InitGui.py @@ -35,13 +35,12 @@ class PlotWorkbench ( Workbench ): cmdlst = ["Plot_SaveFig", "Plot_Axes", "Plot_Series", "Plot_Grid", "Plot_Legend", "Plot_Labels", "Plot_Positions"] self.appendToolbar(str(QtCore.QT_TRANSLATE_NOOP("Plot", "Plot edition tools")),cmdlst) self.appendMenu(str(QtCore.QT_TRANSLATE_NOOP("Plot", "Plot")),cmdlst) + try: + import matplotlib + except ImportError: + from PyQt4 import QtCore, QtGui + msg = QtGui.QApplication.translate("plot_console", "matplotlib not found, Plot module will be disabled", + None,QtGui.QApplication.UnicodeUTF8) + FreeCAD.Console.PrintMessage(msg + '\n') -try: - import matplotlib - Gui.addWorkbench(PlotWorkbench()) -except ImportError: - from PyQt4 import QtCore, QtGui - msg = QtGui.QApplication.translate("plot_console", "matplotlib not found, Plot module will be disabled", - None,QtGui.QApplication.UnicodeUTF8) - FreeCAD.Console.PrintMessage(msg + '\n') - +Gui.addWorkbench(PlotWorkbench())