From fbc01290d5724427ccb147e0c4a7b269cd3bdb38 Mon Sep 17 00:00:00 2001 From: Marcel Date: Tue, 17 Jul 2018 10:06:03 +0200 Subject: [PATCH] [update] make PYQTGRAPH mandatory for PyLoT (stop maintaining unused stuff)! --- PyLoT.py | 6 +----- pylot/core/util/utils.py | 7 +------ pylot/core/util/widgets.py | 9 ++------- 3 files changed, 4 insertions(+), 18 deletions(-) diff --git a/PyLoT.py b/PyLoT.py index fca18830..e38e5fb0 100755 --- a/PyLoT.py +++ b/PyLoT.py @@ -48,11 +48,7 @@ from obspy.core.util import AttribDict from pylot.core.util.obspyDMT_interface import check_obspydmt_structure -try: - import pyqtgraph as pg -except Exception as e: - print('PyLoT: Could not import pyqtgraph. {}'.format(e)) - pg = None +import pyqtgraph as pg try: from matplotlib.backends.backend_qt4agg import FigureCanvas diff --git a/pylot/core/util/utils.py b/pylot/core/util/utils.py index fecd15c8..73b732da 100644 --- a/pylot/core/util/utils.py +++ b/pylot/core/util/utils.py @@ -22,12 +22,7 @@ from pylot.styles import style_settings from scipy.interpolate import splrep, splev from PySide import QtCore, QtGui -try: - import pyqtgraph as pg -except Exception as e: - print('PyLoT: Could not import pyqtgraph. {}'.format(e)) - pg = None - +import pyqtgraph as pg def _pickle_method(m): if m.im_self is None: diff --git a/pylot/core/util/widgets.py b/pylot/core/util/widgets.py index e9bc5e4b..17c184aa 100644 --- a/pylot/core/util/widgets.py +++ b/pylot/core/util/widgets.py @@ -4404,7 +4404,7 @@ class GraphicsTab(PropTab): super(GraphicsTab, self).__init__(parent) self.pylot_mainwindow = parent._pylot_mainwindow self.init_layout() - self.add_pg_cb() + #self.add_pg_cb() self.add_nth_sample() self.add_style_settings() self.setLayout(self.main_layout) @@ -4441,12 +4441,7 @@ class GraphicsTab(PropTab): self.main_layout.addWidget(self.spinbox_nth_sample, 1, 1) def add_pg_cb(self): - try: - import pyqtgraph as pg - pg = True - except: - pg = False - + pg = True text = {True: 'Use pyqtgraphic library for plotting', False: 'Cannot use library: pyqtgraphic not found on system'} label = QLabel('PyQt graphic')