give information on files which could not be read and thus not be attended to the waveform container
This commit is contained in:
parent
82ac85d743
commit
1878b887f6
@ -134,13 +134,28 @@ class Data(object):
|
|||||||
self.dirty = False
|
self.dirty = False
|
||||||
|
|
||||||
def appendWFData(self, fnames):
|
def appendWFData(self, fnames):
|
||||||
|
|
||||||
if self.dirty is not False:
|
if self.dirty is not False:
|
||||||
self.resetWFData()
|
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:
|
for fname in fnames:
|
||||||
try:
|
try:
|
||||||
self.wfdata += read(fname)
|
self.wfdata += read(fname)
|
||||||
except TypeError:
|
except TypeError:
|
||||||
|
try:
|
||||||
self.wfdata += read(fname, format='GSE2')
|
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):
|
def getWFData(self):
|
||||||
return self.wfdata
|
return self.wfdata
|
||||||
|
Loading…
Reference in New Issue
Block a user