give information on files which could not be read and thus not be attended to the waveform container

This commit is contained in:
Sebastian Wehling-Benatelli 2015-02-18 15:31:35 +01:00
parent 82ac85d743
commit 1878b887f6

View File

@ -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