extract_all returns list of all produced files

This commit is contained in:
Mario Fink 2019-08-02 15:06:29 +02:00
parent 51a8312b69
commit ea406bed6b

View File

@ -78,7 +78,7 @@ cdef class pytdmripper:
def close(self): def close(self):
dummy = "" dummy = ""
#-----------------------------------------------------------------------------# #=============================================================================#
def extract_all(string tdmfile, string tdxfile, string outdirx = b"./", string prfxnam = b""): def extract_all(string tdmfile, string tdxfile, string outdirx = b"./", string prfxnam = b""):
""" """
@ -111,8 +111,13 @@ def extract_all(string tdmfile, string tdxfile, string outdirx = b"./", string p
numgr = td.num_groups() numgr = td.num_groups()
numch = td.num_channels() numch = td.num_channels()
# generate list of all files produced
filelist = []
# dump all meta information # dump all meta information
td.print_meta((outdirx.decode(encoding)+prfx+'.csv').encode(encoding)) metafile = outdirx.decode(encoding)+prfx+'.csv'
td.print_meta(metafile.encode(encoding))
filelist.append(metafile)
# dump all available groups and channels # dump all available groups and channels
for g in range(0,numgr): for g in range(0,numgr):
@ -130,3 +135,8 @@ def extract_all(string tdmfile, string tdxfile, string outdirx = b"./", string p
fichan = prfx + '_' + str(g+1) + '_' + str(c+1) + '_' + gname + '_' + cname + '.csv' fichan = prfx + '_' + str(g+1) + '_' + str(c+1) + '_' + gname + '_' + cname + '.csv'
# print channel # print channel
td.print_channel(chid,(outdirx.decode(encoding)+fichan).encode(encoding)) td.print_channel(chid,(outdirx.decode(encoding)+fichan).encode(encoding))
# append filename to list
filelist.append(fichan)
# return list of all files
return filelist