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