PyFoxFile 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.
@@ -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: foxfile.py - Last Update: 11/6/2025 Ver. 0.25.2 RC 1 - Author: cooldude2k $
17
+ $FileInfo: foxfile.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
- import pyfoxfile
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 crc32.")
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 = pyfoxfile.CheckCompressionSubType(
154
168
  input_file, fnamedict, True)
155
169
  if((pyfoxfile.IsNestedDict(fnamedict) and checkcompressfile in fnamedict) or (pyfoxfile.IsSingleDict(fnamedict) and checkcompressfile==fnamedict['format_magic'])):
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.checksum], getargs.skipchecksum, [], {}, fnamedict, getargs.verbose, False)
170
+ tmpout = pyfoxfile.RePackFoxFile(input_file, getargs.output, "auto", getargs.compression, getargs.wholefile, getargs.level, pyfoxfile.compressionlistalt, 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)
157
171
  else:
158
172
  tmpout = pyfoxfile.PackFoxFileFromInFile(
159
- input_file, getargs.output, __file_format_default__, getargs.compression, getargs.wholefile, getargs.level, pyfoxfile.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, pyfoxfile.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
- pyfoxfile.PackFoxFile(getargs.input, getargs.output, getargs.text, __file_format_default__, getargs.compression, getargs.wholefile, getargs.level, pyfoxfile.compressionlistalt, False, [getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum], [], {}, fnamedict, getargs.verbose, False)
177
+ pyfoxfile.PackFoxFile(getargs.input, getargs.output, getargs.text, __file_format_default__, getargs.compression, getargs.wholefile, getargs.level, pyfoxfile.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 = pyfoxfile.CheckCompressionSubType(
167
181
  input_file, fnamedict, True)
168
182
  if((pyfoxfile.IsNestedDict(fnamedict) and checkcompressfile in fnamedict) or (pyfoxfile.IsSingleDict(fnamedict) and checkcompressfile==fnamedict['format_magic'])):
169
- pyfoxfile.RePackFoxFile(input_file, getargs.output, getargs.compression, getargs.wholefile, getargs.level, pyfoxfile.compressionlistalt,
170
- False, getargs.filestart, 0, 0, [getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum], getargs.skipchecksum, [], {}, fnamedict, getargs.verbose, False)
183
+ pyfoxfile.RePackFoxFile(input_file, getargs.output, "auto", getargs.compression, getargs.wholefile, getargs.level, pyfoxfile.compressionlistalt,
184
+ 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)
171
185
  else:
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, getargs.checksum], [], {}, fnamedict, getargs.verbose, False)
186
+ 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, getargs.checksum], [], {}, fnamedict, getargs.insecretkey, getargs.verbose, False)
173
187
  if(not tmpout):
174
188
  sys.exit(1)
175
189
  else:
176
- pyfoxfile.RePackFoxFile(input_file, getargs.output, getargs.compression, getargs.wholefile, getargs.level, pyfoxfile.compressionlistalt,
177
- False, getargs.filestart, 0, 0, [getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum], getargs.skipchecksum, [], {}, fnamedict, getargs.verbose, False)
190
+ pyfoxfile.RePackFoxFile(input_file, getargs.output, "auto", getargs.compression, getargs.wholefile, getargs.level, pyfoxfile.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 = pyfoxfile.CheckCompressionSubType(
181
195
  input_file, fnamedict, True)
182
196
  tempout = BytesIO()
183
197
  if((pyfoxfile.IsNestedDict(fnamedict) and checkcompressfile in fnamedict) or (pyfoxfile.IsSingleDict(fnamedict) and checkcompressfile==fnamedict['format_magic'])):
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.checksum], getargs.skipchecksum, [], {}, fnamedict, False, False)
198
+ tmpout = pyfoxfile.RePackFoxFile(input_file, tempout, "auto", getargs.compression, getargs.wholefile, getargs.level, pyfoxfile.compressionlistalt, False, getargs.filestart, 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 = pyfoxfile.PackFoxFileFromInFile(
187
- input_file, tempout, __file_format_default__, getargs.compression, getargs.wholefile, getargs.level, pyfoxfile.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, pyfoxfile.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,28 +209,28 @@ if active_action:
195
209
  checkcompressfile = pyfoxfile.CheckCompressionSubType(
196
210
  input_file, fnamedict, True)
197
211
  if((pyfoxfile.IsNestedDict(fnamedict) and checkcompressfile in fnamedict) or (pyfoxfile.IsSingleDict(fnamedict) and checkcompressfile==fnamedict['format_magic'])):
198
- tmpout = pyfoxfile.FoxFileListFiles(input_file, "auto", getargs.filestart, 0, 0, getargs.skipchecksum, fnamedict, False, getargs.verbose, False, False)
212
+ tmpout = pyfoxfile.FoxFileListFiles(input_file, "auto", getargs.filestart, 0, 0, getargs.skipchecksum, fnamedict, getargs.insecretkey, False, getargs.verbose, False, False)
199
213
  else:
200
- tmpout = pyfoxfile.InFileListFiles(input_file, getargs.verbose, fnamedict, False, False, False)
214
+ tmpout = pyfoxfile.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
- pyfoxfile.FoxFileListFiles(input_file, "auto", getargs.filestart, 0, 0, getargs.skipchecksum, fnamedict, False, getargs.verbose, False, False)
218
+ pyfoxfile.FoxFileListFiles(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 = pyfoxfile.CheckCompressionSubType(
208
222
  input_file, fnamedict, True)
209
223
  tempout = BytesIO()
210
224
  if((pyfoxfile.IsNestedDict(fnamedict) and checkcompressfile in fnamedict) or (pyfoxfile.IsSingleDict(fnamedict) and checkcompressfile==fnamedict['format_magic'])):
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.checksum], getargs.skipchecksum, [], {}, fnamedict, False, False, False)
225
+ tmpout = pyfoxfile.RePackFoxFile(input_file, tempout, "auto", getargs.compression, getargs.wholefile, getargs.level, pyfoxfile.compressionlistalt, False, getargs.filestart, 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 = pyfoxfile.PackFoxFileFromInFile(
214
- input_file, tempout, __file_format_default__, getargs.compression, getargs.wholefile, getargs.level, pyfoxfile.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, pyfoxfile.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 = pyfoxfile.StackedFoxFileValidate(
219
- input_file, "auto", getargs.filestart, fnamedict, False, getargs.verbose, False)
233
+ input_file, "auto", getargs.filestart, fnamedict, getargs.insecretkey, False, getargs.verbose, False)
220
234
  if(not getargs.verbose):
221
235
  import sys
222
236
  import logging
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PyFoxFile
3
- Version: 0.25.2
3
+ Version: 0.26.0
4
4
  Summary: A tar like file format name archivefile.
5
5
  Home-page: https://github.com/GameMaker2k/PyFoxFile
6
6
  Download-URL: https://github.com/GameMaker2k/PyFoxFile/archive/master.tar.gz
@@ -0,0 +1,10 @@
1
+ pyfoxfile.py,sha256=6rpin1hzjAp_T0Z_GVLm-a2E_eJSy6UbgH5DS_ZRc_A,598729
2
+ pyfoxfile-0.26.0.data/scripts/foxfile.py,sha256=_Y_lrcKUcndqXX9GZD2OhphBxq9lJBJkqMpyuWo_eC4,15298
3
+ pyfoxfile-0.26.0.data/scripts/foxneofile.py,sha256=vrQsZFkSyq5TqQmakzz3AtvxAqQTECTcb9JTzWYDzng,5128
4
+ pyfoxfile-0.26.0.data/scripts/neofoxfile.py,sha256=axk89rmrILol-ZNoTVj0wtTVvt8E_ovrq1oojSQKUj8,7114
5
+ pyfoxfile-0.26.0.dist-info/licenses/LICENSE,sha256=WM1VWxTUVrQbvEa-LC7cKTaBHXiqSTyYPoJvsZSbd7E,1513
6
+ pyfoxfile-0.26.0.dist-info/METADATA,sha256=9nFNUIv8z-VQjF7bJscnA__O1qPjt192Z0ZUDALTfL4,911
7
+ pyfoxfile-0.26.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
8
+ pyfoxfile-0.26.0.dist-info/top_level.txt,sha256=VTOkpGfBWHNht7FKfnbccd32n_Jgk8Df5NKKfzaliTc,10
9
+ pyfoxfile-0.26.0.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
10
+ pyfoxfile-0.26.0.dist-info/RECORD,,