PyFoxFile 0.24.2__tar.gz → 0.24.6__tar.gz
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.
- {pyfoxfile-0.24.2 → pyfoxfile-0.24.6}/PKG-INFO +1 -1
- {pyfoxfile-0.24.2 → pyfoxfile-0.24.6}/PyFoxFile.egg-info/PKG-INFO +1 -1
- {pyfoxfile-0.24.2 → pyfoxfile-0.24.6}/foxfile.py +32 -52
- {pyfoxfile-0.24.2 → pyfoxfile-0.24.6}/pyfoxfile.py +312 -658
- {pyfoxfile-0.24.2 → pyfoxfile-0.24.6}/pyproject.toml +1 -1
- {pyfoxfile-0.24.2 → pyfoxfile-0.24.6}/LICENSE +0 -0
- {pyfoxfile-0.24.2 → pyfoxfile-0.24.6}/PyFoxFile.egg-info/SOURCES.txt +0 -0
- {pyfoxfile-0.24.2 → pyfoxfile-0.24.6}/PyFoxFile.egg-info/dependency_links.txt +0 -0
- {pyfoxfile-0.24.2 → pyfoxfile-0.24.6}/PyFoxFile.egg-info/top_level.txt +0 -0
- {pyfoxfile-0.24.2 → pyfoxfile-0.24.6}/PyFoxFile.egg-info/zip-safe +0 -0
- {pyfoxfile-0.24.2 → pyfoxfile-0.24.6}/README.md +0 -0
- {pyfoxfile-0.24.2 → pyfoxfile-0.24.6}/foxneofile.py +0 -0
- {pyfoxfile-0.24.2 → pyfoxfile-0.24.6}/neofoxfile.py +0 -0
- {pyfoxfile-0.24.2 → pyfoxfile-0.24.6}/setup.cfg +0 -0
- {pyfoxfile-0.24.2 → pyfoxfile-0.24.6}/setup.py +0 -0
|
@@ -14,7 +14,7 @@
|
|
|
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: foxfile.py - Last Update:
|
|
17
|
+
$FileInfo: foxfile.py - Last Update: 11/3/2025 Ver. 0.24.6 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
|
|
@@ -91,57 +91,37 @@ __version_date_plusrc__ = pyfoxfile.__version_date_plusrc__
|
|
|
91
91
|
__version__ = pyfoxfile.__version__
|
|
92
92
|
|
|
93
93
|
# Initialize the argument parser
|
|
94
|
-
argparser = argparse.ArgumentParser(
|
|
95
|
-
description="Manipulate archive files.", conflict_handler="resolve", add_help=True)
|
|
94
|
+
argparser = argparse.ArgumentParser(description="Manipulate archive files.", conflict_handler="resolve", add_help=True)
|
|
96
95
|
|
|
97
96
|
# Version information
|
|
98
|
-
argparser.add_argument("-V", "--version", action="version",
|
|
99
|
-
version=__program_name__ + " " + __version__)
|
|
97
|
+
argparser.add_argument("-V", "--version", action="version", version=__program_name__ + " " + __version__)
|
|
100
98
|
# Input and output specifications
|
|
101
|
-
argparser.add_argument(
|
|
102
|
-
|
|
103
|
-
argparser.add_argument("-o", "--output", default=None,
|
|
104
|
-
help="Specify the name for the extracted or output archive files.")
|
|
99
|
+
argparser.add_argument("-i", "--input", nargs="+", help="Specify the file(s) to concatenate or the archive file to extract.", required=True)
|
|
100
|
+
argparser.add_argument("-o", "--output", default=None, help="Specify the name for the extracted or output archive files.")
|
|
105
101
|
# Operations
|
|
106
|
-
argparser.add_argument("-c", "--create", action="store_true",
|
|
107
|
-
|
|
108
|
-
argparser.add_argument("-
|
|
109
|
-
|
|
110
|
-
argparser.add_argument("-
|
|
111
|
-
help="Convert a tar/zip/rar/7zip file to a archive file.")
|
|
112
|
-
argparser.add_argument("-r", "--repack", action="store_true",
|
|
113
|
-
help="Re-concatenate files, fixing checksum errors if any.")
|
|
102
|
+
argparser.add_argument("-c", "--create", action="store_true", help="Perform only the concatenation operation.")
|
|
103
|
+
argparser.add_argument("-e", "--extract", action="store_true", help="Perform only the extraction operation.")
|
|
104
|
+
argparser.add_argument("-t", "--convert", action="store_true", help="Convert a tar/zip/rar/7zip file to a archive file.")
|
|
105
|
+
argparser.add_argument("-r", "--repack", action="store_true", help="Re-concatenate files, fixing checksum errors if any.")
|
|
106
|
+
argparser.add_argument("-S", "--filestart", type=int, default=0, help="Start reading file at.")
|
|
114
107
|
# File manipulation options
|
|
115
|
-
argparser.add_argument(
|
|
116
|
-
|
|
117
|
-
argparser.add_argument(
|
|
118
|
-
|
|
119
|
-
argparser.add_argument(
|
|
120
|
-
"-m", "--formatver", default=__file_format_dict__['format_ver'], help="Specify the format version.")
|
|
121
|
-
argparser.add_argument("-l", "--list", action="store_true",
|
|
122
|
-
help="List files included in the archive file.")
|
|
108
|
+
argparser.add_argument("-F", "--format", default="auto", help="Specify the format to use.")
|
|
109
|
+
argparser.add_argument("-D", "--delimiter", default=__file_format_dict__['format_delimiter'], help="Specify the delimiter to use.")
|
|
110
|
+
argparser.add_argument("-m", "--formatver", default=__file_format_dict__['format_ver'], help="Specify the format version.")
|
|
111
|
+
argparser.add_argument("-l", "--list", action="store_true", help="List files included in the archive file.")
|
|
123
112
|
# Compression options
|
|
124
|
-
argparser.add_argument("-P", "--compression", default="auto",
|
|
125
|
-
|
|
126
|
-
argparser.add_argument("-
|
|
127
|
-
help="Specify the compression level for concatenation.")
|
|
128
|
-
argparser.add_argument("-W", "--wholefile", action="store_true",
|
|
129
|
-
help="Whole file compression method to use for concatenation.")
|
|
113
|
+
argparser.add_argument("-P", "--compression", default="auto", help="Specify the compression method to use for concatenation.")
|
|
114
|
+
argparser.add_argument("-L", "--level", default=None, help="Specify the compression level for concatenation.")
|
|
115
|
+
argparser.add_argument("-W", "--wholefile", action="store_true", help="Whole file compression method to use for concatenation.")
|
|
130
116
|
# Checksum and validation
|
|
131
|
-
argparser.add_argument("-v", "--validate", action="store_true",
|
|
132
|
-
|
|
133
|
-
argparser.add_argument("-
|
|
134
|
-
help="Specify the type of checksum to use. The default is crc32.")
|
|
135
|
-
argparser.add_argument("-s", "--skipchecksum", action="store_true",
|
|
136
|
-
help="Skip the checksum check of files.")
|
|
117
|
+
argparser.add_argument("-v", "--validate", action="store_true", help="Validate archive file checksums.")
|
|
118
|
+
argparser.add_argument("-C", "--checksum", default="crc32", help="Specify the type of checksum to use. The default is crc32.")
|
|
119
|
+
argparser.add_argument("-s", "--skipchecksum", action="store_true", help="Skip the checksum check of files.")
|
|
137
120
|
# Permissions and metadata
|
|
138
|
-
argparser.add_argument("-p", "--preserve", action="store_false",
|
|
139
|
-
help="Do not preserve permissions and timestamps of files.")
|
|
121
|
+
argparser.add_argument("-p", "--preserve", action="store_false", help="Do not preserve permissions and timestamps of files.")
|
|
140
122
|
# Miscellaneous
|
|
141
|
-
argparser.add_argument("-d", "--verbose", action="store_true",
|
|
142
|
-
|
|
143
|
-
argparser.add_argument("-T", "--text", action="store_true",
|
|
144
|
-
help="Read file locations from a text file.")
|
|
123
|
+
argparser.add_argument("-d", "--verbose", action="store_true", help="Enable verbose mode to display various debugging information.")
|
|
124
|
+
argparser.add_argument("-T", "--text", action="store_true", help="Read file locations from a text file.")
|
|
145
125
|
# Parse the arguments
|
|
146
126
|
getargs = argparser.parse_args()
|
|
147
127
|
|
|
@@ -173,7 +153,7 @@ if active_action:
|
|
|
173
153
|
checkcompressfile = pyfoxfile.CheckCompressionSubType(
|
|
174
154
|
input_file, fnamedict, True)
|
|
175
155
|
if((pyfoxfile.IsNestedDict(fnamedict) and checkcompressfile in fnamedict) or (pyfoxfile.IsSingleDict(fnamedict) and checkcompressfile==fnamedict['format_magic'])):
|
|
176
|
-
tmpout = pyfoxfile.RePackFoxFile(input_file, getargs.output, getargs.compression, getargs.wholefile, getargs.level, pyfoxfile.compressionlistalt, False,
|
|
156
|
+
tmpout = pyfoxfile.RePackFoxFile(input_file, getargs.output, getargs.compression, getargs.wholefile, getargs.level, pyfoxfile.compressionlistalt, False, getargs.filestart, 0, 0, [getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum], getargs.skipchecksum, [], {}, fnamedict, getargs.verbose, False)
|
|
177
157
|
else:
|
|
178
158
|
tmpout = pyfoxfile.PackFoxFileFromInFile(
|
|
179
159
|
input_file, getargs.output, __file_format_default__, getargs.compression, getargs.wholefile, getargs.level, pyfoxfile.compressionlistalt, [getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum], [], {}, fnamedict, getargs.verbose, False)
|
|
@@ -187,48 +167,48 @@ if active_action:
|
|
|
187
167
|
input_file, fnamedict, True)
|
|
188
168
|
if((pyfoxfile.IsNestedDict(fnamedict) and checkcompressfile in fnamedict) or (pyfoxfile.IsSingleDict(fnamedict) and checkcompressfile==fnamedict['format_magic'])):
|
|
189
169
|
pyfoxfile.RePackFoxFile(input_file, getargs.output, getargs.compression, getargs.wholefile, getargs.level, pyfoxfile.compressionlistalt,
|
|
190
|
-
False,
|
|
170
|
+
False, getargs.filestart, 0, 0, [getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum], getargs.skipchecksum, [], {}, fnamedict, getargs.verbose, False)
|
|
191
171
|
else:
|
|
192
172
|
pyfoxfile.PackFoxFileFromInFile(input_file, getargs.output, __file_format_default__, getargs.compression, getargs.wholefile, getargs.level, pyfoxfile.compressionlistalt, [getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum], [], {}, fnamedict, getargs.verbose, False)
|
|
193
173
|
if(not tmpout):
|
|
194
174
|
sys.exit(1)
|
|
195
175
|
else:
|
|
196
176
|
pyfoxfile.RePackFoxFile(input_file, getargs.output, getargs.compression, getargs.wholefile, getargs.level, pyfoxfile.compressionlistalt,
|
|
197
|
-
False,
|
|
177
|
+
False, getargs.filestart, 0, 0, [getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum], getargs.skipchecksum, [], {}, fnamedict, getargs.verbose, False)
|
|
198
178
|
elif active_action == 'extract':
|
|
199
179
|
if getargs.convert:
|
|
200
180
|
checkcompressfile = pyfoxfile.CheckCompressionSubType(
|
|
201
181
|
input_file, fnamedict, True)
|
|
202
182
|
tempout = BytesIO()
|
|
203
183
|
if((pyfoxfile.IsNestedDict(fnamedict) and checkcompressfile in fnamedict) or (pyfoxfile.IsSingleDict(fnamedict) and checkcompressfile==fnamedict['format_magic'])):
|
|
204
|
-
tmpout = pyfoxfile.RePackFoxFile(input_file, tempout, getargs.compression, getargs.wholefile, getargs.level, pyfoxfile.compressionlistalt, False,
|
|
184
|
+
tmpout = pyfoxfile.RePackFoxFile(input_file, tempout, getargs.compression, getargs.wholefile, getargs.level, pyfoxfile.compressionlistalt, False, getargs.filestart, 0, 0, [getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum], getargs.skipchecksum, [], {}, fnamedict, False, False)
|
|
205
185
|
else:
|
|
206
186
|
tmpout = pyfoxfile.PackFoxFileFromInFile(
|
|
207
187
|
input_file, tempout, __file_format_default__, getargs.compression, getargs.wholefile, getargs.level, pyfoxfile.compressionlistalt, [getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum], [], {}, fnamedict, False, False)
|
|
208
188
|
if(not tmpout):
|
|
209
189
|
sys.exit(1)
|
|
210
190
|
input_file = tempout
|
|
211
|
-
pyfoxfile.UnPackFoxFile(input_file, getargs.output, False,
|
|
191
|
+
pyfoxfile.UnPackFoxFile(input_file, getargs.output, False, getargs.filestart, 0, 0, getargs.skipchecksum,
|
|
212
192
|
fnamedict, getargs.verbose, getargs.preserve, getargs.preserve, False, False)
|
|
213
193
|
elif active_action == 'list':
|
|
214
194
|
if getargs.convert:
|
|
215
195
|
checkcompressfile = pyfoxfile.CheckCompressionSubType(
|
|
216
196
|
input_file, fnamedict, True)
|
|
217
197
|
if((pyfoxfile.IsNestedDict(fnamedict) and checkcompressfile in fnamedict) or (pyfoxfile.IsSingleDict(fnamedict) and checkcompressfile==fnamedict['format_magic'])):
|
|
218
|
-
tmpout = pyfoxfile.FoxFileListFiles(input_file, "auto",
|
|
198
|
+
tmpout = pyfoxfile.FoxFileListFiles(input_file, "auto", getargs.filestart, 0, 0, getargs.skipchecksum, fnamedict, False, getargs.verbose, False, False)
|
|
219
199
|
else:
|
|
220
200
|
tmpout = pyfoxfile.InFileListFiles(input_file, getargs.verbose, fnamedict, False, False, False)
|
|
221
201
|
if(not tmpout):
|
|
222
202
|
sys.exit(1)
|
|
223
203
|
else:
|
|
224
|
-
pyfoxfile.FoxFileListFiles(input_file, "auto", 0, 0, getargs.skipchecksum, fnamedict, False, getargs.verbose, False, False)
|
|
204
|
+
pyfoxfile.FoxFileListFiles(input_file, "auto", getargs.filestart, 0, 0, getargs.skipchecksum, fnamedict, False, getargs.verbose, False, False)
|
|
225
205
|
elif active_action == 'validate':
|
|
226
206
|
if getargs.convert:
|
|
227
207
|
checkcompressfile = pyfoxfile.CheckCompressionSubType(
|
|
228
208
|
input_file, fnamedict, True)
|
|
229
209
|
tempout = BytesIO()
|
|
230
210
|
if((pyfoxfile.IsNestedDict(fnamedict) and checkcompressfile in fnamedict) or (pyfoxfile.IsSingleDict(fnamedict) and checkcompressfile==fnamedict['format_magic'])):
|
|
231
|
-
tmpout = pyfoxfile.RePackFoxFile(input_file, tempout, getargs.compression, getargs.wholefile, getargs.level, pyfoxfile.compressionlistalt, False,
|
|
211
|
+
tmpout = pyfoxfile.RePackFoxFile(input_file, tempout, getargs.compression, getargs.wholefile, getargs.level, pyfoxfile.compressionlistalt, False, getargs.filestart, 0, 0, [getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum], getargs.skipchecksum, [], {}, fnamedict, False, False, False)
|
|
232
212
|
else:
|
|
233
213
|
tmpout = pyfoxfile.PackFoxFileFromInFile(
|
|
234
214
|
input_file, tempout, __file_format_default__, getargs.compression, getargs.wholefile, getargs.level, pyfoxfile.compressionlistalt, [getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum], [], {}, fnamedict, False, False)
|
|
@@ -236,7 +216,7 @@ if active_action:
|
|
|
236
216
|
if(not tmpout):
|
|
237
217
|
sys.exit(1)
|
|
238
218
|
fvalid = pyfoxfile.StackedFoxFileValidate(
|
|
239
|
-
input_file, "auto",
|
|
219
|
+
input_file, "auto", getargs.filestart, fnamedict, False, getargs.verbose, False)
|
|
240
220
|
if(not getargs.verbose):
|
|
241
221
|
import sys
|
|
242
222
|
import logging
|