Skip to content

Commit 8b55716

Browse files
author
Kazuki Suzuki Przyborowski
committed
Update pycatfile.py
1 parent 55d6fb3 commit 8b55716

1 file changed

Lines changed: 68 additions & 1 deletion

File tree

pycatfile.py

Lines changed: 68 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7331,7 +7331,7 @@ def StackedCatFileValidate(infile, fmttype="auto", filestart=0, formatspecs=__fi
73317331
while True:
73327332
if outstartfile >= outfsize: # stop when function signals False
73337333
break
7334-
is_valid_file = ArchiveFileValidate(infile, fmttype, filestart, formatspecs, seektoend, verbose, True)
7334+
is_valid_file = CatFileValidate(infile, fmttype, filestart, formatspecs, seektoend, verbose, True)
73357335
if is_valid_file is False: # stop when function signals False
73367336
outretval.append(is_valid_file)
73377337
else:
@@ -8711,6 +8711,73 @@ def CatFileListFiles(infile, fmttype="auto", filestart=0, seekstart=0, seekend=0
87118711
return True
87128712

87138713

8714+
def MultipleCatFileListFiles(infile, fmttype="auto", filestart=0, seekstart=0, seekend=0, listonly=False, contentasfile=True, uncompress=True, skipchecksum=False, formatspecs=__file_format_multi_dict__, seektoend=False, returnfp=False):
8715+
if(isinstance(infile, (list, tuple, ))):
8716+
pass
8717+
else:
8718+
infile = [infile]
8719+
outretval = {}
8720+
for curfname in infile:
8721+
outretval[curfname] = CatFileListFiles(infile, fmttype, filestart, seekstart, seekend, skipchecksum, formatspecs, seektoend, verbose, newstyle, returnfp)
8722+
return outretval
8723+
8724+
8725+
def StackedCatFileListFiles(infile, fmttype="auto", filestart=0, seekstart=0, seekend=0, skipchecksum=False, formatspecs=__file_format_multi_dict__, seektoend=False, verbose=False, newstyle=False, returnfp=False):
8726+
outretval = []
8727+
outstartfile = filestart
8728+
outfsize = float('inf')
8729+
while True:
8730+
if outstartfile >= outfsize: # stop when function signals False
8731+
break
8732+
list_file_retu = ArchiveFileListFiles(infile, fmttype, outstartfile, seekstart, seekend, skipchecksum, formatspecs, seektoend, verbose, newstyle, True)
8733+
if list_file_retu is False: # stop when function signals False
8734+
outretval.append(list_file_retu)
8735+
else:
8736+
outretval.append(True)
8737+
infile = list_file_retu
8738+
outstartfile = infile.tell()
8739+
try:
8740+
infile.seek(0, 2)
8741+
except OSError:
8742+
SeekToEndOfFile(infile)
8743+
except ValueError:
8744+
SeekToEndOfFile(infile)
8745+
outfsize = infile.tell()
8746+
infile.seek(outstartfile, 0)
8747+
if(returnfp):
8748+
return infile
8749+
else:
8750+
infile.close()
8751+
return outretval
8752+
8753+
8754+
def MultipleStackedCatFileListFiles(infile, fmttype="auto", filestart=0, seekstart=0, seekend=0, listonly=False, contentasfile=True, uncompress=True, skipchecksum=False, formatspecs=__file_format_multi_dict__, seektoend=False, returnfp=False):
8755+
if(isinstance(infile, (list, tuple, ))):
8756+
pass
8757+
else:
8758+
infile = [infile]
8759+
outretval = {}
8760+
for curfname in infile:
8761+
outretval[curfname] = StackedArchiveListFiles(curfname, fmttype, filestart, seekstart, seekend, listonly, contentasfile, uncompress, skipchecksum, formatspecs, seektoend, returnfp)
8762+
return outretval
8763+
8764+
8765+
def CatFileStringToArray(instr, filestart=0, seekstart=0, seekend=0, listonly=False, contentasfile=True, skipchecksum=False, formatspecs=__file_format_multi_dict__, seektoend=False, returnfp=False):
8766+
checkcompressfile = CheckCompressionSubType(infile, formatspecs, filestart, True)
8767+
if(IsNestedDict(formatspecs) and checkcompressfile in formatspecs):
8768+
formatspecs = formatspecs[checkcompressfile]
8769+
fp = MkTempFile(instr)
8770+
listarrayfiles = CatFileToArray(fp, "auto", filestart, seekstart, seekend, listonly, contentasfile, True, skipchecksum, formatspecs, seektoend, returnfp)
8771+
return listarrayfiles
8772+
8773+
8774+
def CatFileStringListFiles(instr, seekstart=0, seekend=0, skipchecksum=False, formatspecs=__file_format_multi_dict__, seektoend=False, verbose=False, newstyle=False, returnfp=False):
8775+
fp = MkTempFile(instr)
8776+
listarrayfiles = CatFileListFiles(
8777+
instr, seekstart, seekend, skipchecksum, formatspecs, seektoend, verbose, newstyle, returnfp)
8778+
return listarrayfiles
8779+
8780+
87148781
def CatFileStringListFiles(instr, seekstart=0, seekend=0, skipchecksum=False, formatspecs=__file_format_multi_dict__, seektoend=False, verbose=False, newstyle=False, returnfp=False):
87158782
fp = MkTempFile(instr)
87168783
listarrayfiles = CatFileListFiles(

0 commit comments

Comments
 (0)