OUTPUTFORMATS in defaults defined; manage available formats just from here

This commit is contained in:
Sebastian Wehling-Benatelli 2014-12-17 06:35:12 +01:00
parent 8213cdc575
commit 3fe1e3906e
3 changed files with 11 additions and 3 deletions

View File

@ -63,10 +63,15 @@ class Data(object):
def exportEvent(self, fnout=None, evtformat='QUAKEML'): def exportEvent(self, fnout=None, evtformat='QUAKEML'):
from pylot.core.util.defaults import OUTPUTFORMATS
if evtformat.strip() not in OUTPUTFORMATS.values():
evtformat = OUTPUTFORMATS.values()[0]
if fnout is None: if fnout is None:
fnout = self.evtdata.getEventID() ID = self.evtdata.getEventID()
# handle forbidden filenames especially on windows systems # handle forbidden filenames especially on windows systems
fnout = fnConstructor(fnout) fnout = fnConstructor(ID)
evtformat = evtformat.upper().strip() evtformat = evtformat.upper().strip()

View File

@ -12,3 +12,5 @@ FILTERDEFAULTS = {'P': {'filtertype': None,
'S': {'filtertype': 'bandpass', 'S': {'filtertype': 'bandpass',
'order': '4', 'order': '4',
'freq': [.5, 5]}} 'freq': [.5, 5]}}
OUTPUTFORMATS = {'QuakeML':'QUAKEML', 'VelEst':'VELEST'}

View File

@ -37,6 +37,7 @@ from PySide.QtCore import (Qt,
SLOT) SLOT)
from PySide.QtWebKit import QWebView from PySide.QtWebKit import QWebView
from pylot.core.read import FilterOptions from pylot.core.read import FilterOptions
from pylot.core.util.defaults import OUTPUTFORMATS
class MPLWidget(FigureCanvasQTAgg): class MPLWidget(FigureCanvasQTAgg):
@ -119,7 +120,7 @@ class OutputsTab(QWidget):
eventOutputLabel = QLabel("event ouput format") eventOutputLabel = QLabel("event ouput format")
eventOutputComboBox = QComboBox() eventOutputComboBox = QComboBox()
eventoutputformats = ["QuakeML", "VelEst"] eventoutputformats = OUTPUTFORMATS.keys()
eventOutputComboBox.addItems(eventoutputformats) eventOutputComboBox.addItems(eventoutputformats)
layout = QGridLayout() layout = QGridLayout()