From b21b113edd9f4418a367b0fb85a2d347d2c27d50 Mon Sep 17 00:00:00 2001 From: Marcel Date: Mon, 12 Aug 2019 11:58:04 +0200 Subject: [PATCH] [bugfix] dataprocessing, xml [update] save images as svg/jpg --- pylot/core/util/dataprocessing.py | 2 +- pylot/core/util/widgets.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pylot/core/util/dataprocessing.py b/pylot/core/util/dataprocessing.py index f2ded63a..9ada2df9 100644 --- a/pylot/core/util/dataprocessing.py +++ b/pylot/core/util/dataprocessing.py @@ -196,7 +196,7 @@ class Metadata(object): for network in inventory.networks: for station in network.stations: station_name = station.code - network_name = network_name.code + network_name = network.code if not station_name in self.stations_dict.keys(): st_id = '{}.{}'.format(network_name, station_name) self.stations_dict[st_id] = {'latitude': station[0].latitude, diff --git a/pylot/core/util/widgets.py b/pylot/core/util/widgets.py index 618253bb..7af88575 100644 --- a/pylot/core/util/widgets.py +++ b/pylot/core/util/widgets.py @@ -1117,10 +1117,10 @@ class PylotCanvas(FigureCanvas): def saveFigure(self): if self.figure: fd = QtGui.QFileDialog() - fname, filter = fd.getSaveFileName(self.parent(), filter='Images (*.png)') + fname, filter = fd.getSaveFileName(self.parent(), filter='Images (*.png *.svg *.jpg)') if not fname: return - if not fname.endswith('.png'): + if not any([fname.endswith(item) for item in ['.png', '.svg', '.jpg']]): fname += '.png' self.figure.savefig(fname)