[reformat] reformatted imports and parentheses indentation
This commit is contained in:
parent
5f0e59d95a
commit
f01c6109a8
43
QtPyLoT.py
43
QtPyLoT.py
@ -23,8 +23,9 @@ https://www.iconfinder.com/iconsets/flavour
|
|||||||
(http://www.gnu.org/copyleft/lesser.html)
|
(http://www.gnu.org/copyleft/lesser.html)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import os, sys
|
import os
|
||||||
from os.path import expanduser
|
import sys
|
||||||
|
|
||||||
import matplotlib
|
import matplotlib
|
||||||
|
|
||||||
matplotlib.use('Qt4Agg')
|
matplotlib.use('Qt4Agg')
|
||||||
@ -44,12 +45,12 @@ from pylot.core.read.inputs import FilterOptions, AutoPickParameter
|
|||||||
from pylot.core.pick.autopick import autopickevent
|
from pylot.core.pick.autopick import autopickevent
|
||||||
from pylot.core.loc.nll import locate as locateNll
|
from pylot.core.loc.nll import locate as locateNll
|
||||||
from pylot.core.util.defaults import FILTERDEFAULTS
|
from pylot.core.util.defaults import FILTERDEFAULTS
|
||||||
from pylot.core.util.errors import FormatError, DatastructureError,\
|
from pylot.core.util.errors import FormatError, DatastructureError, \
|
||||||
OverwriteError
|
OverwriteError
|
||||||
from pylot.core.util.connection import checkurl
|
from pylot.core.util.connection import checkurl
|
||||||
from pylot.core.util.utils import fnConstructor, createEvent, getLogin,\
|
from pylot.core.util.utils import fnConstructor, createEvent, getLogin, \
|
||||||
createCreationInfo, getGlobalTimes
|
createCreationInfo, getGlobalTimes
|
||||||
from pylot.core.util.widgets import FilterOptionsDialog, NewEventDlg,\
|
from pylot.core.util.widgets import FilterOptionsDialog, NewEventDlg, \
|
||||||
MPLWidget, PropertiesDlg, HelpForm, createAction, PickDlg
|
MPLWidget, PropertiesDlg, HelpForm, createAction, PickDlg
|
||||||
from pylot.core.util.structure import DATASTRUCTURE
|
from pylot.core.util.structure import DATASTRUCTURE
|
||||||
from pylot.core.util.thread import AutoPickThread
|
from pylot.core.util.thread import AutoPickThread
|
||||||
@ -58,6 +59,7 @@ import icons_rc
|
|||||||
|
|
||||||
locateTool = dict(nll=locateNll)
|
locateTool = dict(nll=locateNll)
|
||||||
|
|
||||||
|
|
||||||
class MainWindow(QMainWindow):
|
class MainWindow(QMainWindow):
|
||||||
__version__ = _getVersionString()
|
__version__ = _getVersionString()
|
||||||
closing = Signal()
|
closing = Signal()
|
||||||
@ -85,7 +87,7 @@ class MainWindow(QMainWindow):
|
|||||||
self.dispComponent = str(settings.value("plotting/dispComponent", "Z"))
|
self.dispComponent = str(settings.value("plotting/dispComponent", "Z"))
|
||||||
if settings.value("data/dataRoot", None) is None:
|
if settings.value("data/dataRoot", None) is None:
|
||||||
dirname = QFileDialog().getExistingDirectory(
|
dirname = QFileDialog().getExistingDirectory(
|
||||||
caption='Choose data root ...')
|
caption='Choose data root ...')
|
||||||
settings.setValue("data/dataRoot", dirname)
|
settings.setValue("data/dataRoot", dirname)
|
||||||
settings.sync()
|
settings.sync()
|
||||||
|
|
||||||
@ -115,7 +117,7 @@ class MainWindow(QMainWindow):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
self.startTime = min(
|
self.startTime = min(
|
||||||
[tr.stats.starttime for tr in self.data.wfdata])
|
[tr.stats.starttime for tr in self.data.wfdata])
|
||||||
except:
|
except:
|
||||||
self.startTime = UTCDateTime()
|
self.startTime = UTCDateTime()
|
||||||
|
|
||||||
@ -613,8 +615,8 @@ class MainWindow(QMainWindow):
|
|||||||
else:
|
else:
|
||||||
self.updateStatus('Filter loaded ... '
|
self.updateStatus('Filter loaded ... '
|
||||||
'[{0}: {1} Hz]'.format(
|
'[{0}: {1} Hz]'.format(
|
||||||
self.getFilterOptions().getFilterType(),
|
self.getFilterOptions().getFilterType(),
|
||||||
self.getFilterOptions().getFreq()))
|
self.getFilterOptions().getFreq()))
|
||||||
if self.filterAction.isChecked():
|
if self.filterAction.isChecked():
|
||||||
self.filterWaveformData()
|
self.filterWaveformData()
|
||||||
|
|
||||||
@ -671,15 +673,15 @@ class MainWindow(QMainWindow):
|
|||||||
self.logDockWidget.setWidget(self.listWidget)
|
self.logDockWidget.setWidget(self.listWidget)
|
||||||
self.addDockWidget(Qt.LeftDockWidgetArea, self.logDockWidget)
|
self.addDockWidget(Qt.LeftDockWidgetArea, self.logDockWidget)
|
||||||
self.addListItem('loading default values for local data ...')
|
self.addListItem('loading default values for local data ...')
|
||||||
home = expanduser("~")
|
home = os.path.expanduser("~")
|
||||||
autopick_parameter = AutoPickParameter('%s/.pylot/autoPyLoT_local.in' % home)
|
autopick_parameter = AutoPickParameter('%s/.pylot/autoPyLoT_local.in' % home)
|
||||||
self.addListItem(str(autopick_parameter))
|
self.addListItem(str(autopick_parameter))
|
||||||
|
|
||||||
# Create the worker thread and run it
|
# Create the worker thread and run it
|
||||||
self.thread = AutoPickThread(parent=self,
|
self.thread = AutoPickThread(parent=self,
|
||||||
func=autopickevent,
|
func=autopickevent,
|
||||||
data=self.getData().getWFData(),
|
data=self.getData().getWFData(),
|
||||||
param=autopick_parameter)
|
param=autopick_parameter)
|
||||||
self.thread.message.connect(self.addListItem)
|
self.thread.message.connect(self.addListItem)
|
||||||
self.thread.start()
|
self.thread.start()
|
||||||
self.thread.finished.connect(self.finalizeAutoPick)
|
self.thread.finished.connect(self.finalizeAutoPick)
|
||||||
@ -698,10 +700,10 @@ class MainWindow(QMainWindow):
|
|||||||
msgBox.setText("The picks for station {0} have been "
|
msgBox.setText("The picks for station {0} have been "
|
||||||
"changed.".format(station))
|
"changed.".format(station))
|
||||||
msgBox.setDetailedText("Old picks:\n"
|
msgBox.setDetailedText("Old picks:\n"
|
||||||
"{old_picks}\n\n"
|
"{old_picks}\n\n"
|
||||||
"New picks:\n"
|
"New picks:\n"
|
||||||
"{new_picks}".format(old_picks=stat_picks,
|
"{new_picks}".format(old_picks=stat_picks,
|
||||||
new_picks=picks))
|
new_picks=picks))
|
||||||
msgBox.setInformativeText("Do you want to save your changes?")
|
msgBox.setInformativeText("Do you want to save your changes?")
|
||||||
msgBox.setStandardButtons(QMessageBox.Save | QMessageBox.Cancel)
|
msgBox.setStandardButtons(QMessageBox.Save | QMessageBox.Cancel)
|
||||||
msgBox.setDefaultButton(QMessageBox.Save)
|
msgBox.setDefaultButton(QMessageBox.Save)
|
||||||
@ -789,7 +791,6 @@ class MainWindow(QMainWindow):
|
|||||||
if extlocpath is None or locroot is None:
|
if extlocpath is None or locroot is None:
|
||||||
self.PyLoTprefs()
|
self.PyLoTprefs()
|
||||||
|
|
||||||
|
|
||||||
def check4Loc(self):
|
def check4Loc(self):
|
||||||
return self.picksNum() > 4
|
return self.picksNum() > 4
|
||||||
|
|
||||||
@ -810,12 +811,12 @@ class MainWindow(QMainWindow):
|
|||||||
if self.getData() is not None:
|
if self.getData() is not None:
|
||||||
if not self.getData().isNew():
|
if not self.getData().isNew():
|
||||||
self.setWindowTitle(
|
self.setWindowTitle(
|
||||||
"PyLoT - processing event %s[*]" % self.getData().getID())
|
"PyLoT - processing event %s[*]" % self.getData().getID())
|
||||||
elif self.getData().isNew():
|
elif self.getData().isNew():
|
||||||
self.setWindowTitle("PyLoT - New event [*]")
|
self.setWindowTitle("PyLoT - New event [*]")
|
||||||
else:
|
else:
|
||||||
self.setWindowTitle(
|
self.setWindowTitle(
|
||||||
"PyLoT - seismic processing the python way[*]")
|
"PyLoT - seismic processing the python way[*]")
|
||||||
self.setWindowModified(self.dirty)
|
self.setWindowModified(self.dirty)
|
||||||
|
|
||||||
def tutorUser(self):
|
def tutorUser(self):
|
||||||
@ -853,7 +854,7 @@ class MainWindow(QMainWindow):
|
|||||||
def helpHelp(self):
|
def helpHelp(self):
|
||||||
if checkurl():
|
if checkurl():
|
||||||
form = HelpForm(
|
form = HelpForm(
|
||||||
'https://ariadne.geophysik.ruhr-uni-bochum.de/trac/PyLoT/wiki')
|
'https://ariadne.geophysik.ruhr-uni-bochum.de/trac/PyLoT/wiki')
|
||||||
else:
|
else:
|
||||||
form = HelpForm(':/help.html')
|
form = HelpForm(':/help.html')
|
||||||
form.show()
|
form.show()
|
||||||
|
Loading…
Reference in New Issue
Block a user