diff --git a/pylot/core/read/data.py b/pylot/core/read/data.py index 07b8a10f..de4f24b6 100644 --- a/pylot/core/read/data.py +++ b/pylot/core/read/data.py @@ -63,10 +63,15 @@ class Data(object): 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: - fnout = self.evtdata.getEventID() + ID = self.evtdata.getEventID() # handle forbidden filenames especially on windows systems - fnout = fnConstructor(fnout) + fnout = fnConstructor(ID) evtformat = evtformat.upper().strip() diff --git a/pylot/core/util/defaults.py b/pylot/core/util/defaults.py index b9642d4a..b9815b45 100644 --- a/pylot/core/util/defaults.py +++ b/pylot/core/util/defaults.py @@ -12,3 +12,5 @@ FILTERDEFAULTS = {'P': {'filtertype': None, 'S': {'filtertype': 'bandpass', 'order': '4', 'freq': [.5, 5]}} + +OUTPUTFORMATS = {'QuakeML':'QUAKEML', 'VelEst':'VELEST'} \ No newline at end of file diff --git a/pylot/core/util/widgets.py b/pylot/core/util/widgets.py index e937f2cf..b6a5ec5b 100644 --- a/pylot/core/util/widgets.py +++ b/pylot/core/util/widgets.py @@ -37,6 +37,7 @@ from PySide.QtCore import (Qt, SLOT) from PySide.QtWebKit import QWebView from pylot.core.read import FilterOptions +from pylot.core.util.defaults import OUTPUTFORMATS class MPLWidget(FigureCanvasQTAgg): @@ -119,7 +120,7 @@ class OutputsTab(QWidget): eventOutputLabel = QLabel("event ouput format") eventOutputComboBox = QComboBox() - eventoutputformats = ["QuakeML", "VelEst"] + eventoutputformats = OUTPUTFORMATS.keys() eventOutputComboBox.addItems(eventoutputformats) layout = QGridLayout()