PyArchiveFile 0.25.2__py3-none-any.whl → 0.26.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyarchivefile-0.25.2.data → pyarchivefile-0.26.0.data}/scripts/archivefile.py +31 -22
- {pyarchivefile-0.25.2.dist-info → pyarchivefile-0.26.0.dist-info}/METADATA +1 -1
- pyarchivefile-0.26.0.dist-info/RECORD +10 -0
- pyarchivefile.py +799 -723
- pyarchivefile-0.25.2.dist-info/RECORD +0 -10
- {pyarchivefile-0.25.2.data → pyarchivefile-0.26.0.data}/scripts/archiveneofile.py +0 -0
- {pyarchivefile-0.25.2.data → pyarchivefile-0.26.0.data}/scripts/neoarchivefile.py +0 -0
- {pyarchivefile-0.25.2.dist-info → pyarchivefile-0.26.0.dist-info}/WHEEL +0 -0
- {pyarchivefile-0.25.2.dist-info → pyarchivefile-0.26.0.dist-info}/licenses/LICENSE +0 -0
- {pyarchivefile-0.25.2.dist-info → pyarchivefile-0.26.0.dist-info}/top_level.txt +0 -0
- {pyarchivefile-0.25.2.dist-info → pyarchivefile-0.26.0.dist-info}/zip-safe +0 -0
|
@@ -14,16 +14,28 @@
|
|
|
14
14
|
Copyright 2018-2024 Game Maker 2k - http://intdb.sourceforge.net/
|
|
15
15
|
Copyright 2018-2024 Kazuki Przyborowski - https://github.com/KazukiPrzyborowski
|
|
16
16
|
|
|
17
|
-
$FileInfo: archivefile.py - Last Update: 11/
|
|
17
|
+
$FileInfo: archivefile.py - Last Update: 11/12/2025 Ver. 0.26.0 RC 1 - Author: cooldude2k $
|
|
18
18
|
'''
|
|
19
19
|
|
|
20
20
|
from __future__ import absolute_import, division, print_function, unicode_literals, generators, with_statement, nested_scopes
|
|
21
21
|
import os
|
|
22
22
|
import sys
|
|
23
|
+
import logging
|
|
23
24
|
import argparse
|
|
24
25
|
import pyarchivefile
|
|
25
26
|
import binascii
|
|
26
27
|
|
|
28
|
+
# Text streams (as provided by Python)
|
|
29
|
+
PY_STDIN_TEXT = sys.stdin
|
|
30
|
+
PY_STDOUT_TEXT = sys.stdout
|
|
31
|
+
PY_STDERR_TEXT = sys.stderr
|
|
32
|
+
|
|
33
|
+
# Binary-friendly streams (use .buffer on Py3, fall back on Py2)
|
|
34
|
+
PY_STDIN_BUF = getattr(sys.stdin, "buffer", sys.stdin)
|
|
35
|
+
PY_STDOUT_BUF = getattr(sys.stdout, "buffer", sys.stdout)
|
|
36
|
+
PY_STDERR_BUF = getattr(sys.stderr, "buffer", sys.stderr)
|
|
37
|
+
logging.basicConfig(format="%(message)s", stream=PY_STDOUT_TEXT, level=logging.DEBUG)
|
|
38
|
+
|
|
27
39
|
# Conditional import and signal handling for Unix-like systems
|
|
28
40
|
if os.name != 'nt': # Not Windows
|
|
29
41
|
import signal
|
|
@@ -117,6 +129,8 @@ argparser.add_argument("-W", "--wholefile", action="store_true", help="Whole fil
|
|
|
117
129
|
argparser.add_argument("-v", "--validate", action="store_true", help="Validate archive file checksums.")
|
|
118
130
|
argparser.add_argument("-C", "--checksum", default="md5", help="Specify the type of checksum to use. The default is md5.")
|
|
119
131
|
argparser.add_argument("-s", "--skipchecksum", action="store_true", help="Skip the checksum check of files.")
|
|
132
|
+
argparser.add_argument("-k", "--insecretkey", default=None, help="Secretkey to use for checksum input.")
|
|
133
|
+
argparser.add_argument("-K", "--outsecretkey", default=None, help="Secretkey to use for checksum output.")
|
|
120
134
|
# Permissions and metadata
|
|
121
135
|
argparser.add_argument("-p", "--preserve", action="store_false", help="Do not preserve permissions and timestamps of files.")
|
|
122
136
|
# Miscellaneous
|
|
@@ -153,38 +167,38 @@ if active_action:
|
|
|
153
167
|
checkcompressfile = pyarchivefile.CheckCompressionSubType(
|
|
154
168
|
input_file, fnamedict, 0, True)
|
|
155
169
|
if((pyarchivefile.IsNestedDict(fnamedict) and checkcompressfile in fnamedict) or (pyarchivefile.IsSingleDict(fnamedict) and checkcompressfile==fnamedict['format_magic'])):
|
|
156
|
-
tmpout = pyarchivefile.RePackArchiveFile(input_file, getargs.output, getargs.compression, getargs.wholefile, getargs.level, pyarchivefile.compressionlistalt, False, 0, 0, 0, [getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum], getargs.skipchecksum, [], {}, fnamedict, getargs.verbose, False)
|
|
170
|
+
tmpout = pyarchivefile.RePackArchiveFile(input_file, getargs.output, "auto", getargs.compression, getargs.wholefile, getargs.level, pyarchivefile.compressionlistalt, False, 0, 0, 0, [getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum], getargs.skipchecksum, [], {}, fnamedict, getargs.insecretkey, getargs.outsecretkey, False, getargs.verbose, False)
|
|
157
171
|
else:
|
|
158
172
|
tmpout = pyarchivefile.PackArchiveFileFromInFile(
|
|
159
|
-
input_file, getargs.output, __file_format_default__, getargs.compression, getargs.wholefile, getargs.level, pyarchivefile.compressionlistalt, [getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum], [], {}, fnamedict, getargs.verbose, False)
|
|
173
|
+
input_file, getargs.output, __file_format_default__, getargs.compression, getargs.wholefile, getargs.level, pyarchivefile.compressionlistalt, [getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum], [], {}, fnamedict, getargs.insecretkey, getargs.verbose, False)
|
|
160
174
|
if(not tmpout):
|
|
161
175
|
sys.exit(1)
|
|
162
176
|
else:
|
|
163
|
-
pyarchivefile.PackArchiveFile(getargs.input, getargs.output, getargs.text, __file_format_default__, getargs.compression, getargs.wholefile, getargs.level, pyarchivefile.compressionlistalt, False, [getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum], [], {}, fnamedict, getargs.verbose, False)
|
|
177
|
+
pyarchivefile.PackArchiveFile(getargs.input, getargs.output, getargs.text, __file_format_default__, getargs.compression, getargs.wholefile, getargs.level, pyarchivefile.compressionlistalt, False, [getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum], [], {}, fnamedict, getargs.insecretkey, getargs.verbose, False)
|
|
164
178
|
elif active_action == 'repack':
|
|
165
179
|
if getargs.convert:
|
|
166
180
|
checkcompressfile = pyarchivefile.CheckCompressionSubType(
|
|
167
181
|
input_file, fnamedict, 0, True)
|
|
168
182
|
if((pyarchivefile.IsNestedDict(fnamedict) and checkcompressfile in fnamedict) or (pyarchivefile.IsSingleDict(fnamedict) and checkcompressfile==fnamedict['format_magic'])):
|
|
169
|
-
pyarchivefile.RePackArchiveFile(input_file, getargs.output, getargs.compression, getargs.wholefile, getargs.level, pyarchivefile.compressionlistalt,
|
|
170
|
-
False, 0, 0, 0, [getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum], getargs.skipchecksum, [], {}, fnamedict, getargs.verbose, False)
|
|
183
|
+
pyarchivefile.RePackArchiveFile(input_file, getargs.output, "auto", getargs.compression, getargs.wholefile, getargs.level, pyarchivefile.compressionlistalt,
|
|
184
|
+
False, 0, 0, 0, [getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum], getargs.skipchecksum, [], {}, fnamedict, getargs.insecretkey, getargs.outsecretkey, False, getargs.verbose, False)
|
|
171
185
|
else:
|
|
172
|
-
pyarchivefile.PackArchiveFileFromInFile(input_file, getargs.output, __file_format_default__, getargs.compression, getargs.wholefile, getargs.level, pyarchivefile.compressionlistalt, [getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum], [], {}, fnamedict, getargs.verbose, False)
|
|
186
|
+
pyarchivefile.PackArchiveFileFromInFile(input_file, getargs.output, __file_format_default__, getargs.compression, getargs.wholefile, getargs.level, pyarchivefile.compressionlistalt, [getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum], [], {}, fnamedict, getargs.insecretkey, getargs.verbose, False)
|
|
173
187
|
if(not tmpout):
|
|
174
188
|
sys.exit(1)
|
|
175
189
|
else:
|
|
176
|
-
pyarchivefile.RePackArchiveFile(input_file, getargs.output, getargs.compression, getargs.wholefile, getargs.level, pyarchivefile.compressionlistalt,
|
|
177
|
-
False, getargs.filestart, 0, 0, [getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum], getargs.skipchecksum, [], {}, fnamedict, getargs.verbose, False)
|
|
190
|
+
pyarchivefile.RePackArchiveFile(input_file, getargs.output, "auto", getargs.compression, getargs.wholefile, getargs.level, pyarchivefile.compressionlistalt,
|
|
191
|
+
False, getargs.filestart, 0, 0, [getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum], getargs.skipchecksum, [], {}, fnamedict, getargs.insecretkey, getargs.outsecretkey, False, getargs.verbose, False)
|
|
178
192
|
elif active_action == 'extract':
|
|
179
193
|
if getargs.convert:
|
|
180
194
|
checkcompressfile = pyarchivefile.CheckCompressionSubType(
|
|
181
195
|
input_file, fnamedict, 0, True)
|
|
182
196
|
tempout = BytesIO()
|
|
183
197
|
if((pyarchivefile.IsNestedDict(fnamedict) and checkcompressfile in fnamedict) or (pyarchivefile.IsSingleDict(fnamedict) and checkcompressfile==fnamedict['format_magic'])):
|
|
184
|
-
tmpout = pyarchivefile.RePackArchiveFile(input_file, tempout, getargs.compression, getargs.wholefile, getargs.level, pyarchivefile.compressionlistalt, False, 0, 0, 0, [getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum], getargs.skipchecksum, [], {}, fnamedict, False, False)
|
|
198
|
+
tmpout = pyarchivefile.RePackArchiveFile(input_file, tempout, "auto", getargs.compression, getargs.wholefile, getargs.level, pyarchivefile.compressionlistalt, False, 0, 0, 0, [getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum], getargs.skipchecksum, [], {}, fnamedict, getargs.insecretkey, getargs.outsecretkey, False, False)
|
|
185
199
|
else:
|
|
186
200
|
tmpout = pyarchivefile.PackArchiveFileFromInFile(
|
|
187
|
-
input_file, tempout, __file_format_default__, getargs.compression, getargs.wholefile, getargs.level, pyarchivefile.compressionlistalt, [getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum], [], {}, fnamedict, False, False)
|
|
201
|
+
input_file, tempout, __file_format_default__, getargs.compression, getargs.wholefile, getargs.level, pyarchivefile.compressionlistalt, [getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum], [], {}, fnamedict, getargs.insecretkey, False, False)
|
|
188
202
|
if(not tmpout):
|
|
189
203
|
sys.exit(1)
|
|
190
204
|
input_file = tempout
|
|
@@ -195,33 +209,28 @@ if active_action:
|
|
|
195
209
|
checkcompressfile = pyarchivefile.CheckCompressionSubType(
|
|
196
210
|
input_file, fnamedict, 0, True)
|
|
197
211
|
if((pyarchivefile.IsNestedDict(fnamedict) and checkcompressfile in fnamedict) or (pyarchivefile.IsSingleDict(fnamedict) and checkcompressfile==fnamedict['format_magic'])):
|
|
198
|
-
tmpout = pyarchivefile.ArchiveFileListFiles(input_file, "auto", getargs.filestart, 0, 0, getargs.skipchecksum, fnamedict, False, getargs.verbose, False, False)
|
|
212
|
+
tmpout = pyarchivefile.ArchiveFileListFiles(input_file, "auto", getargs.filestart, 0, 0, getargs.skipchecksum, fnamedict, getargs.insecretkey, False, getargs.verbose, False, False)
|
|
199
213
|
else:
|
|
200
|
-
tmpout = pyarchivefile.InFileListFiles(input_file, getargs.verbose, fnamedict, False, False, False)
|
|
214
|
+
tmpout = pyarchivefile.InFileListFiles(input_file, getargs.verbose, fnamedict, getargs.insecretkey, False, False, False)
|
|
201
215
|
if(not tmpout):
|
|
202
216
|
sys.exit(1)
|
|
203
217
|
else:
|
|
204
|
-
pyarchivefile.ArchiveFileListFiles(input_file, "auto", getargs.filestart, 0, 0, getargs.skipchecksum, fnamedict, False, getargs.verbose, False, False)
|
|
218
|
+
pyarchivefile.ArchiveFileListFiles(input_file, "auto", getargs.filestart, 0, 0, getargs.skipchecksum, fnamedict, getargs.insecretkey, False, getargs.verbose, False, False)
|
|
205
219
|
elif active_action == 'validate':
|
|
206
220
|
if getargs.convert:
|
|
207
221
|
checkcompressfile = pyarchivefile.CheckCompressionSubType(
|
|
208
222
|
input_file, fnamedict, 0, True)
|
|
209
223
|
tempout = BytesIO()
|
|
210
224
|
if((pyarchivefile.IsNestedDict(fnamedict) and checkcompressfile in fnamedict) or (pyarchivefile.IsSingleDict(fnamedict) and checkcompressfile==fnamedict['format_magic'])):
|
|
211
|
-
tmpout = pyarchivefile.RePackArchiveFile(input_file, tempout, getargs.compression, getargs.wholefile, getargs.level, pyarchivefile.compressionlistalt, False, 0, 0, 0, [getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum], getargs.skipchecksum, [], {}, fnamedict, False, False, False)
|
|
225
|
+
tmpout = pyarchivefile.RePackArchiveFile(input_file, tempout, "auto", getargs.compression, getargs.wholefile, getargs.level, pyarchivefile.compressionlistalt, False, 0, 0, 0, [getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum], getargs.skipchecksum, [], {}, fnamedict, getargs.insecretkey, getargs.outsecretkey, False, False, False)
|
|
212
226
|
else:
|
|
213
227
|
tmpout = pyarchivefile.PackArchiveFileFromInFile(
|
|
214
|
-
input_file, tempout, __file_format_default__, getargs.compression, getargs.wholefile, getargs.level, pyarchivefile.compressionlistalt, [getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum], [], {}, fnamedict, False, False)
|
|
228
|
+
input_file, tempout, __file_format_default__, getargs.compression, getargs.wholefile, getargs.level, pyarchivefile.compressionlistalt, [getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum], [], {}, fnamedict, getargs.insecretkey, False, False)
|
|
215
229
|
input_file = tempout
|
|
216
230
|
if(not tmpout):
|
|
217
231
|
sys.exit(1)
|
|
218
232
|
fvalid = pyarchivefile.StackedArchiveFileValidate(
|
|
219
|
-
input_file, "auto", getargs.filestart, fnamedict, False, getargs.verbose, False)
|
|
220
|
-
if(not getargs.verbose):
|
|
221
|
-
import sys
|
|
222
|
-
import logging
|
|
223
|
-
logging.basicConfig(format="%(message)s",
|
|
224
|
-
stream=sys.stdout, level=logging.DEBUG)
|
|
233
|
+
input_file, "auto", getargs.filestart, fnamedict, getargs.insecretkey, False, getargs.verbose, False)
|
|
225
234
|
if(fvalid):
|
|
226
235
|
pyarchivefile.VerbosePrintOut("File is valid: \n" + str(input_file))
|
|
227
236
|
else:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: PyArchiveFile
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.26.0
|
|
4
4
|
Summary: A tar like file format name archivefile.
|
|
5
5
|
Home-page: https://github.com/GameMaker2k/PyArchiveFile
|
|
6
6
|
Download-URL: https://github.com/GameMaker2k/PyArchiveFile/archive/master.tar.gz
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
pyarchivefile.py,sha256=ApsejVrTHProriwkoMi0OtpcbjkazmCxh0F120hSjAg,598220
|
|
2
|
+
pyarchivefile-0.26.0.data/scripts/archivefile.py,sha256=HLWlTHa0DHLwySUwYLsZxvjz84stZgXA-ZUsqD6DrW0,15350
|
|
3
|
+
pyarchivefile-0.26.0.data/scripts/archiveneofile.py,sha256=m2jQVSnpapc2fd9R1fyvvERCNT3JLKymcwE5_bl0Rfk,5140
|
|
4
|
+
pyarchivefile-0.26.0.data/scripts/neoarchivefile.py,sha256=wx4Ct6o3pnACJWhOFW9cLtoJ_e_alIWIj29Iey5Eb1w,7334
|
|
5
|
+
pyarchivefile-0.26.0.dist-info/licenses/LICENSE,sha256=WM1VWxTUVrQbvEa-LC7cKTaBHXiqSTyYPoJvsZSbd7E,1513
|
|
6
|
+
pyarchivefile-0.26.0.dist-info/METADATA,sha256=IaLu596jGzHfCM7mOfZVWAIi7-DcC9h395GiIkolAp4,927
|
|
7
|
+
pyarchivefile-0.26.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
8
|
+
pyarchivefile-0.26.0.dist-info/top_level.txt,sha256=dXsHVLesKNVXuVZeri6pRuRPo3y1HrcPsUrIw5KU5fk,14
|
|
9
|
+
pyarchivefile-0.26.0.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
10
|
+
pyarchivefile-0.26.0.dist-info/RECORD,,
|