Skip to content

Commit b5e82ac

Browse files
Add files via upload
1 parent 8014a5a commit b5e82ac

File tree

1 file changed

+17
-22
lines changed

1 file changed

+17
-22
lines changed

pyarchivefile.py

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10738,27 +10738,7 @@ def _add(cat, name, fid):
1073810738
return out
1073910739

1074010740

10741-
def RePackArchiveFile(
10742-
infile,
10743-
outfile,
10744-
fmttype="auto",
10745-
compression="auto",
10746-
compresswholefile=True,
10747-
compressionlevel=None,
10748-
compressionuselist=None, # was: compressionlistalt at def time
10749-
followlink=False,
10750-
filestart=0,
10751-
seekstart=0,
10752-
seekend=0,
10753-
checksumtype=None, # was: ["crc32", ...] (mutable)
10754-
skipchecksum=False,
10755-
extradata=None, # was: [] (mutable)
10756-
jsondata=None, # was: {} (mutable)
10757-
formatspecs=None, # was: __file_format_dict__ at def time
10758-
seektoend=False,
10759-
verbose=False,
10760-
returnfp=False,
10761-
):
10741+
def RePackArchiveFile(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):
1076210742
# ---------- Safe defaults ----------
1076310743
if compressionuselist is None:
1076410744
compressionuselist = compressionlistalt
@@ -10837,6 +10817,8 @@ def RePackArchiveFile(
1083710817
if outfile == "-" or outfile is None:
1083810818
verbose = False
1083910819
fp = MkTempFile()
10820+
elif(isinstance(outfile, FileLikeAdapter)):
10821+
fp = outfile
1084010822
elif hasattr(outfile, "read") or hasattr(outfile, "write"):
1084110823
fp = outfile
1084210824
elif re.findall(__upload_proto_support__, outfile):
@@ -11098,7 +11080,6 @@ def RePackArchiveFile(
1109811080
upload_file_to_internet_file(fp, outfile)
1109911081

1110011082
if returnfp:
11101-
fp.seek(0, 0)
1110211083
return fp
1110311084
else:
1110411085
try:
@@ -11107,6 +11088,20 @@ def RePackArchiveFile(
1110711088
pass
1110811089
return True
1110911090

11091+
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):
11092+
if not isinstance(infiles, list):
11093+
infiles = [infiles]
11094+
returnout = False
11095+
for infileslist in infiles:
11096+
returnout = RePackArchiveFile(infileslist, outfile, fmttype, compression, compresswholefile, compressionlevel, compressionuselist, followlink, filestart, seekstart, seekend, checksumtype, skipchecksum, extradata, jsondata, formatspecs, seektoend, verbose, True)
11097+
if(not returnout):
11098+
break
11099+
else:
11100+
outfile = returnout
11101+
if(not returnfp and returnout):
11102+
returnout.close()
11103+
return True
11104+
return returnout
1111011105

1111111106
def RePackArchiveFileFromString(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):
1111211107
fp = MkTempFile(instr)

0 commit comments

Comments
 (0)