PyCatFile 0.24.0__tar.gz → 0.24.4__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PyCatFile
3
- Version: 0.24.0
3
+ Version: 0.24.4
4
4
  Summary: A tar like file format name archivefile.
5
5
  Home-page: https://github.com/GameMaker2k/PyCatFile
6
6
  Download-URL: https://github.com/GameMaker2k/PyCatFile/archive/master.tar.gz
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PyCatFile
3
- Version: 0.24.0
3
+ Version: 0.24.4
4
4
  Summary: A tar like file format name archivefile.
5
5
  Home-page: https://github.com/GameMaker2k/PyCatFile
6
6
  Download-URL: https://github.com/GameMaker2k/PyCatFile/archive/master.tar.gz
@@ -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: catfile.py - Last Update: 10/29/2025 Ver. 0.24.0 RC 1 - Author: cooldude2k $
17
+ $FileInfo: catfile.py - Last Update: 11/3/2025 Ver. 0.24.4 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__ = pycatfile.__version_date_plusrc__
91
91
  __version__ = pycatfile.__version__
92
92
 
93
93
  # Initialize the argument parser
94
- argparser = argparse.ArgumentParser(
95
- description="Manipulate concatenated 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
- "-i", "--input", nargs="+", help="Specify the file(s) to concatenate or the concatenated file to extract.", required=True)
103
- argparser.add_argument("-o", "--output", default=None,
104
- help="Specify the name for the extracted or output concatenated 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
- help="Perform only the concatenation operation.")
108
- argparser.add_argument("-e", "--extract", action="store_true",
109
- help="Perform only the extraction operation.")
110
- argparser.add_argument("-t", "--convert", action="store_true",
111
- help="Convert a tar/zip/rar/7zip file to a concatenated 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
- "-F", "--format", default="auto", help="Specify the format to use.")
117
- argparser.add_argument(
118
- "-D", "--delimiter", default=__file_format_dict__['format_delimiter'], help="Specify the delimiter to use.")
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 concatenated 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
- help="Specify the compression method to use for concatenation.")
126
- argparser.add_argument("-L", "--level", default=None,
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
- help="Validate concatenated file checksums.")
133
- argparser.add_argument("-C", "--checksum", default="crc32",
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
- help="Enable verbose mode to display various debugging information.")
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 = pycatfile.CheckCompressionSubType(
174
154
  input_file, fnamedict, 0, True)
175
155
  if((pycatfile.IsNestedDict(fnamedict) and checkcompressfile in fnamedict) or (pycatfile.IsSingleDict(fnamedict) and checkcompressfile==fnamedict['format_magic'])):
176
- tmpout = pycatfile.RePackCatFile(input_file, getargs.output, getargs.compression, getargs.wholefile, getargs.level, pycatfile.compressionlistalt, False, 0, 0, 0, [getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum], getargs.skipchecksum, [], {}, fnamedict, getargs.verbose, False)
156
+ tmpout = pycatfile.RePackCatFile(input_file, getargs.output, getargs.compression, getargs.wholefile, getargs.level, pycatfile.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 = pycatfile.PackCatFileFromInFile(
179
159
  input_file, getargs.output, __file_format_default__, getargs.compression, getargs.wholefile, getargs.level, pycatfile.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, 0, True)
188
168
  if((pycatfile.IsNestedDict(fnamedict) and checkcompressfile in fnamedict) or (pycatfile.IsSingleDict(fnamedict) and checkcompressfile==fnamedict['format_magic'])):
189
169
  pycatfile.RePackCatFile(input_file, getargs.output, getargs.compression, getargs.wholefile, getargs.level, pycatfile.compressionlistalt,
190
- False, 0, 0, 0, [getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum], getargs.skipchecksum, [], {}, fnamedict, getargs.verbose, 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
  pycatfile.PackCatFileFromInFile(input_file, getargs.output, __file_format_default__, getargs.compression, getargs.wholefile, getargs.level, pycatfile.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
  pycatfile.RePackCatFile(input_file, getargs.output, getargs.compression, getargs.wholefile, getargs.level, pycatfile.compressionlistalt,
197
- False, 0, 0, 0, [getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum], getargs.skipchecksum, [], {}, fnamedict, getargs.verbose, 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 = pycatfile.CheckCompressionSubType(
201
181
  input_file, fnamedict, 0, True)
202
182
  tempout = BytesIO()
203
183
  if((pycatfile.IsNestedDict(fnamedict) and checkcompressfile in fnamedict) or (pycatfile.IsSingleDict(fnamedict) and checkcompressfile==fnamedict['format_magic'])):
204
- tmpout = pycatfile.RePackCatFile(input_file, tempout, getargs.compression, getargs.wholefile, getargs.level, pycatfile.compressionlistalt, False, 0, 0, 0, [getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum], getargs.skipchecksum, [], {}, fnamedict, False, False)
184
+ tmpout = pycatfile.RePackCatFile(input_file, tempout, getargs.compression, getargs.wholefile, getargs.level, pycatfile.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 = pycatfile.PackCatFileFromInFile(
207
187
  input_file, tempout, __file_format_default__, getargs.compression, getargs.wholefile, getargs.level, pycatfile.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
- pycatfile.UnPackCatFile(input_file, getargs.output, False, 0, 0, 0, getargs.skipchecksum,
191
+ pycatfile.UnPackCatFile(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 = pycatfile.CheckCompressionSubType(
216
196
  input_file, fnamedict, 0, True)
217
197
  if((pycatfile.IsNestedDict(fnamedict) and checkcompressfile in fnamedict) or (pycatfile.IsSingleDict(fnamedict) and checkcompressfile==fnamedict['format_magic'])):
218
- tmpout = pycatfile.CatFileListFiles(input_file, "auto", 0, 0, 0, getargs.skipchecksum, fnamedict, False, getargs.verbose, False, False)
198
+ tmpout = pycatfile.CatFileListFiles(input_file, "auto", getargs.filestart, 0, 0, getargs.skipchecksum, fnamedict, False, getargs.verbose, False, False)
219
199
  else:
220
200
  tmpout = pycatfile.InFileListFiles(input_file, getargs.verbose, fnamedict, False, False, False)
221
201
  if(not tmpout):
222
202
  sys.exit(1)
223
203
  else:
224
- pycatfile.CatFileListFiles(input_file, "auto", 0, 0, 0, getargs.skipchecksum, fnamedict, False, getargs.verbose, False, False)
204
+ pycatfile.CatFileListFiles(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 = pycatfile.CheckCompressionSubType(
228
208
  input_file, fnamedict, 0, True)
229
209
  tempout = BytesIO()
230
210
  if((pycatfile.IsNestedDict(fnamedict) and checkcompressfile in fnamedict) or (pycatfile.IsSingleDict(fnamedict) and checkcompressfile==fnamedict['format_magic'])):
231
- tmpout = pycatfile.RePackCatFile(input_file, tempout, getargs.compression, getargs.wholefile, getargs.level, pycatfile.compressionlistalt, False, 0, 0, 0, [getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum], getargs.skipchecksum, [], {}, fnamedict, False, False, False)
211
+ tmpout = pycatfile.RePackCatFile(input_file, tempout, getargs.compression, getargs.wholefile, getargs.level, pycatfile.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 = pycatfile.PackCatFileFromInFile(
234
214
  input_file, tempout, __file_format_default__, getargs.compression, getargs.wholefile, getargs.level, pycatfile.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 = pycatfile.StackedCatFileValidate(
239
- input_file, "auto", 0, fnamedict, False, getargs.verbose, False)
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