[init] started porting to the next python version
Aiming also to avoid deprecations and outdated versions of dependencies.
This commit is contained in:
parent
710ea57503
commit
8b4eed3974
21
PyLoT.py
21
PyLoT.py
@ -30,15 +30,16 @@ import sys
|
||||
|
||||
import matplotlib
|
||||
|
||||
matplotlib.use('Qt4Agg')
|
||||
matplotlib.rcParams['backend.qt4'] = 'PySide'
|
||||
matplotlib.use('Qt5Agg')
|
||||
#matplotlib.rcParams['backend.qt4'] = 'PySide'
|
||||
|
||||
from PySide import QtGui, QtCore
|
||||
from PySide.QtCore import QCoreApplication, QSettings, Signal, QFile, \
|
||||
from PySide2 import QtGui, QtCore, QtWidgets
|
||||
from PySide2.QtCore import QCoreApplication, QSettings, Signal, QFile, \
|
||||
QFileInfo, Qt, QSize
|
||||
from PySide.QtGui import QMainWindow, QInputDialog, QIcon, QFileDialog, \
|
||||
QWidget, QHBoxLayout, QVBoxLayout, QStyle, QKeySequence, QLabel, QFrame, QAction, \
|
||||
QDialog, QErrorMessage, QApplication, QPixmap, QMessageBox, QSplashScreen, \
|
||||
from PySide2.QtGui import QIcon, QKeySequence, QPixmap
|
||||
from PySide2.QtWidgets import QMainWindow, QInputDialog, QFileDialog, \
|
||||
QWidget, QHBoxLayout, QVBoxLayout, QStyle, QLabel, QFrame, QAction, \
|
||||
QDialog, QErrorMessage, QApplication, QMessageBox, QSplashScreen, \
|
||||
QActionGroup, QListWidget, QLineEdit, QListView, QAbstractItemView, \
|
||||
QTreeView, QComboBox, QTabWidget, QPushButton, QGridLayout
|
||||
import numpy as np
|
||||
@ -53,10 +54,10 @@ except Exception as e:
|
||||
pg = None
|
||||
|
||||
try:
|
||||
from matplotlib.backends.backend_qt4agg import FigureCanvas
|
||||
from matplotlib.backends.backend_qt5agg import FigureCanvas
|
||||
except ImportError:
|
||||
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
|
||||
from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT as NavigationToolbar
|
||||
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
|
||||
from matplotlib.backends.backend_qt5agg import NavigationToolbar2QT as NavigationToolbar
|
||||
from matplotlib.figure import Figure
|
||||
|
||||
from pylot.core.analysis.magnitude import LocalMagnitude, MomentMagnitude
|
||||
|
@ -6,7 +6,7 @@
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
from PySide import QtCore
|
||||
from PySide2 import QtCore
|
||||
|
||||
qt_resource_data = b"\
|
||||
\x00\x00\x9e\x04\
|
||||
|
@ -4,8 +4,8 @@
|
||||
import matplotlib.pyplot as plt
|
||||
import numpy as np
|
||||
import obspy
|
||||
from PySide import QtGui
|
||||
from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT as NavigationToolbar
|
||||
from PySide2 import QtGui
|
||||
from matplotlib.backends.backend_qt5agg import NavigationToolbar2QT as NavigationToolbar
|
||||
from mpl_toolkits.basemap import Basemap
|
||||
from pylot.core.util.widgets import PickDlg
|
||||
from scipy.interpolate import griddata
|
||||
|
@ -1,8 +1,8 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import sys, os, traceback
|
||||
import multiprocessing
|
||||
from PySide.QtCore import QThread, Signal, Qt, Slot, QRunnable, QObject
|
||||
from PySide.QtGui import QDialog, QProgressBar, QLabel, QHBoxLayout, QPushButton
|
||||
from PySide2.QtCore import QThread, Signal, Qt, Slot, QRunnable, QObject
|
||||
from PySide2.QtWidgets import QDialog, QProgressBar, QLabel, QHBoxLayout, QPushButton
|
||||
|
||||
|
||||
class Thread(QThread):
|
||||
|
@ -17,7 +17,7 @@ from pylot.core.io.inputs import PylotParameter
|
||||
from pylot.styles import style_settings
|
||||
|
||||
from scipy.interpolate import splrep, splev
|
||||
from PySide import QtCore, QtGui
|
||||
from PySide2 import QtCore, QtGui
|
||||
|
||||
try:
|
||||
import pyqtgraph as pg
|
||||
@ -840,7 +840,7 @@ def which(program, infile=None):
|
||||
:return: full path of the executable file
|
||||
"""
|
||||
try:
|
||||
from PySide.QtCore import QSettings
|
||||
from PySide2.QtCore import QSettings
|
||||
settings = QSettings()
|
||||
for key in settings.allKeys():
|
||||
if 'binPath' in key:
|
||||
|
@ -21,21 +21,22 @@ from pylot.core.util.utils import find_horizontals, identifyPhase, loopIdentifyP
|
||||
identifyPhaseID, check4rotated
|
||||
|
||||
try:
|
||||
from matplotlib.backends.backend_qt4agg import FigureCanvas
|
||||
from matplotlib.backends.backend_qt5agg import FigureCanvas
|
||||
except ImportError:
|
||||
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
|
||||
from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT
|
||||
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
|
||||
from matplotlib.backends.backend_qt5agg import NavigationToolbar2QT
|
||||
from matplotlib.widgets import MultiCursor
|
||||
from matplotlib.tight_layout import get_renderer, get_subplotspec_list, get_tight_layout_figure
|
||||
|
||||
from PySide import QtCore, QtGui
|
||||
from PySide.QtGui import QAction, QApplication, QCheckBox, QComboBox, \
|
||||
from PySide2 import QtCore, QtGui
|
||||
from PySide2.QtGui import QIcon, QPixmap, QKeySequence
|
||||
from PySide2.QtWidgets import QAction, QApplication, QCheckBox, QComboBox, \
|
||||
QDateTimeEdit, QDialog, QDialogButtonBox, QDoubleSpinBox, QGroupBox, \
|
||||
QGridLayout, QIcon, QLabel, QLineEdit, QMessageBox, \
|
||||
QPixmap, QSpinBox, QTabWidget, QToolBar, QVBoxLayout, QHBoxLayout, QWidget, \
|
||||
QPushButton, QFileDialog, QInputDialog, QKeySequence
|
||||
from PySide.QtCore import QSettings, Qt, QUrl, Signal, Slot
|
||||
from PySide.QtWebKit import QWebView
|
||||
QGridLayout, QLabel, QLineEdit, QMessageBox, \
|
||||
QSpinBox, QTabWidget, QToolBar, QVBoxLayout, QHBoxLayout, QWidget, \
|
||||
QPushButton, QFileDialog, QInputDialog
|
||||
from PySide2.QtCore import QSettings, Qt, QUrl, Signal, Slot
|
||||
from PySide2.QtWebEngineWidgets import QWebEngineView as QWebView
|
||||
from obspy import Stream, UTCDateTime
|
||||
from obspy.core.util import AttribDict
|
||||
from obspy.taup import TauPyModel
|
||||
|
Loading…
x
Reference in New Issue
Block a user