From 1878b887f67de12d653faa736255ac161edf8b0c Mon Sep 17 00:00:00 2001 From: Sebastian Wehling-Benatelli Date: Wed, 18 Feb 2015 15:31:35 +0100 Subject: [PATCH] give information on files which could not be read and thus not be attended to the waveform container --- pylot/core/read/data.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/pylot/core/read/data.py b/pylot/core/read/data.py index e6048ee8..7b8a3f94 100644 --- a/pylot/core/read/data.py +++ b/pylot/core/read/data.py @@ -134,13 +134,28 @@ class Data(object): self.dirty = False def appendWFData(self, fnames): + if self.dirty is not False: self.resetWFData() + + assert isinstance(fnames, list), "input parameter 'fnames' is " \ + "supposed to be of type 'list' " \ + "but is actually".format(type( + fnames)) + + warnmsg = '' for fname in fnames: try: self.wfdata += read(fname) except TypeError: - self.wfdata += read(fname, format='GSE2') + try: + self.wfdata += read(fname, format='GSE2') + except Exception: + warnmsg += '{0}\n'.format(fname) + if warnmsg: + warnmsg = 'WARNING: unable to read\n' + warnmsg + print warnmsg + def getWFData(self): return self.wfdata