Skip to content

Commit 4fc57f7

Browse files
Add files via upload
1 parent bb2a64a commit 4fc57f7

1 file changed

Lines changed: 18 additions & 23 deletions

File tree

pyfoxfile.py

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10729,27 +10729,7 @@ def _add(cat, name, fid):
1072910729
return out
1073010730

1073110731

10732-
def RePackFoxFile(
10733-
infile,
10734-
outfile,
10735-
fmttype="auto",
10736-
compression="auto",
10737-
compresswholefile=True,
10738-
compressionlevel=None,
10739-
compressionuselist=None, # was: compressionlistalt at def time
10740-
followlink=False,
10741-
filestart=0,
10742-
seekstart=0,
10743-
seekend=0,
10744-
checksumtype=None, # was: ["crc32", ...] (mutable)
10745-
skipchecksum=False,
10746-
extradata=None, # was: [] (mutable)
10747-
jsondata=None, # was: {} (mutable)
10748-
formatspecs=None, # was: __file_format_dict__ at def time
10749-
seektoend=False,
10750-
verbose=False,
10751-
returnfp=False,
10752-
):
10732+
def RePackFoxFile(infile, outfile, fmttype="auto", compression="auto", compresswholefile=True, compressionlevel=None, compressionuselist=None, followlink=False, filestart=0, seekstart=0, seekend=0, checksumtype=None, skipchecksum=False, extradata=None, jsondata=None, formatspecs=None, seektoend=False, verbose=False, returnfp=False):
1075310733
# ---------- Safe defaults ----------
1075410734
if compressionuselist is None:
1075510735
compressionuselist = compressionlistalt
@@ -10772,7 +10752,7 @@ def RePackFoxFile(
1077210752
listarrayfiles = FoxFileToArray(
1077310753
infile, "auto", filestart, seekstart, seekend,
1077410754
False, True, True, skipchecksum, formatspecs, seektoend, returnfp
10775-
)
10755+
)[0]
1077610756

1077710757
# Light guard on required structure
1077810758
if not listarrayfiles or 'ffilelist' not in listarrayfiles or 'fnumfiles' not in listarrayfiles:
@@ -10828,6 +10808,8 @@ def RePackFoxFile(
1082810808
if outfile == "-" or outfile is None:
1082910809
verbose = False
1083010810
fp = MkTempFile()
10811+
elif(isinstance(outfile, FileLikeAdapter)):
10812+
fp = outfile
1083110813
elif hasattr(outfile, "read") or hasattr(outfile, "write"):
1083210814
fp = outfile
1083310815
elif re.findall(__upload_proto_support__, outfile):
@@ -11089,7 +11071,6 @@ def RePackFoxFile(
1108911071
upload_file_to_internet_file(fp, outfile)
1109011072

1109111073
if returnfp:
11092-
fp.seek(0, 0)
1109311074
return fp
1109411075
else:
1109511076
try:
@@ -11098,6 +11079,20 @@ def RePackFoxFile(
1109811079
pass
1109911080
return True
1110011081

11082+
def RePackMultipleArchiveFile(infiles, outfile, fmttype="auto", compression="auto", compresswholefile=True, compressionlevel=None, compressionuselist=None, followlink=False, filestart=0, seekstart=0, seekend=0, checksumtype=None, skipchecksum=False, extradata=None, jsondata=None, formatspecs=None, seektoend=False, verbose=False, returnfp=False):
11083+
if not isinstance(infiles, list):
11084+
infiles = [infiles]
11085+
returnout = False
11086+
for infileslist in infiles:
11087+
returnout = RePackArchiveFile(infileslist, outfile, fmttype, compression, compresswholefile, compressionlevel, compressionuselist, followlink, filestart, seekstart, seekend, checksumtype, skipchecksum, extradata, jsondata, formatspecs, seektoend, verbose, True)
11088+
if(not returnout):
11089+
break
11090+
else:
11091+
outfile = returnout
11092+
if(not returnfp and returnout):
11093+
returnout.close()
11094+
return True
11095+
return returnout
1110111096

1110211097
def RePackFoxFileFromString(instr, outfile, fmttype="auto", compression="auto", compresswholefile=True, compressionlevel=None, compressionuselist=compressionlistalt, followlink=False, filestart=0, seekstart=0, seekend=0, checksumtype=["crc32", "crc32", "crc32"], skipchecksum=False, extradata=[], jsondata={}, formatspecs=__file_format_dict__, seektoend=False, verbose=False, returnfp=False):
1110311098
fp = MkTempFile(instr)

0 commit comments

Comments
 (0)