1414 Copyright 2018-2024 Game Maker 2k - http://intdb.sourceforge.net/
1515 Copyright 2018-2024 Kazuki Przyborowski - https://github.com/KazukiPrzyborowski
1616
17- $FileInfo: altcatfile .py - Last Update: 1/24 /2025 Ver. 0.17.2 RC 1 - Author: cooldude2k $
17+ $FileInfo: altarchivefile .py - Last Update: 1/26 /2025 Ver. 0.17.4 RC 1 - Author: cooldude2k $
1818'''
1919
2020from __future__ import absolute_import , division , print_function , unicode_literals , generators , with_statement , nested_scopes
2121import os
2222import argparse
23- import pycatfile
23+ import pyarchivefile
2424import configparser
2525from io import BytesIO
2626
27- __project__ = pycatfile .__project__
28- __program_name__ = pycatfile .__program_name__
29- __file_format_name__ = pycatfile .__file_format_name__
30- __file_format_lower__ = pycatfile .__file_format_lower__
31- __file_format_magic__ = pycatfile .__file_format_magic__
32- __file_format_len__ = pycatfile .__file_format_len__
33- __file_format_hex__ = pycatfile .__file_format_hex__
34- __file_format_delimiter__ = pycatfile .__file_format_delimiter__
35- __file_format_dict__ = pycatfile .__file_format_dict__
36- __file_format_default__ = pycatfile .__file_format_default__
37- __use_new_style__ = pycatfile .__use_new_style__
38- __use_advanced_list__ = pycatfile .__use_advanced_list__
39- __use_alt_inode__ = pycatfile .__use_alt_inode__
40- __project_url__ = pycatfile .__project_url__
41- __version_info__ = pycatfile .__version_info__
42- __version_date_info__ = pycatfile .__version_date_info__
43- __version_date__ = pycatfile .__version_date__
44- __version_date_plusrc__ = pycatfile .__version_date_plusrc__
45- __version__ = pycatfile .__version__
27+ __project__ = pyarchivefile .__project__
28+ __program_name__ = pyarchivefile .__program_name__
29+ __file_format_name__ = pyarchivefile .__file_format_name__
30+ __file_format_lower__ = pyarchivefile .__file_format_lower__
31+ __file_format_magic__ = pyarchivefile .__file_format_magic__
32+ __file_format_len__ = pyarchivefile .__file_format_len__
33+ __file_format_hex__ = pyarchivefile .__file_format_hex__
34+ __file_format_delimiter__ = pyarchivefile .__file_format_delimiter__
35+ __file_format_dict__ = pyarchivefile .__file_format_dict__
36+ __file_format_default__ = pyarchivefile .__file_format_default__
37+ __use_new_style__ = pyarchivefile .__use_new_style__
38+ __use_advanced_list__ = pyarchivefile .__use_advanced_list__
39+ __use_alt_inode__ = pyarchivefile .__use_alt_inode__
40+ __project_url__ = pyarchivefile .__project_url__
41+ __version_info__ = pyarchivefile .__version_info__
42+ __version_date_info__ = pyarchivefile .__version_date_info__
43+ __version_date__ = pyarchivefile .__version_date__
44+ __version_date_plusrc__ = pyarchivefile .__version_date_plusrc__
45+ __version__ = pyarchivefile .__version__
4646
4747
4848def decode_unicode_escape (value ):
@@ -56,7 +56,7 @@ def load_config():
5656 if 'PYCATFILE_CONFIG_FILE' in os .environ and os .path .exists (os .environ ['PYCATFILE_CONFIG_FILE' ]):
5757 scriptconf = os .environ ['PYCATFILE_CONFIG_FILE' ]
5858 else :
59- scriptconf = os .path .join (os .path .dirname (__file__ ), "catfile .ini" )
59+ scriptconf = os .path .join (os .path .dirname (__file__ ), "archivefile .ini" )
6060
6161 config = configparser .ConfigParser ()
6262 __file_format_default__ = decode_unicode_escape (config .get ('config' , 'default' ))
@@ -70,7 +70,7 @@ def load_config():
7070 }
7171 else :
7272 return {
73- 'name' : "CatFile " ,
73+ 'name' : "ArchiveFile " ,
7474 'delimiter' : "\x00 " ,
7575 'version' : "001" ,
7676 'extension' : ".cat"
@@ -83,17 +83,17 @@ def main():
8383
8484 # Argument Parsing
8585 parser = argparse .ArgumentParser (
86- description = "Combined utility for CatFile operations with dynamic and static modes."
86+ description = "Combined utility for ArchiveFile operations with dynamic and static modes."
8787 )
8888 parser .add_argument ("-i" , "--input" , nargs = "+" , required = True , help = "Input file(s) for processing." )
8989 parser .add_argument ("-o" , "--output" , help = "Output file name." )
9090 parser .add_argument ("-m" , "--mode" , choices = ["dynamic" , "static" ], default = "static" ,
9191 help = "Choose mode: 'dynamic' (runtime arguments) or 'static' (config-based). Default: static." )
92- parser .add_argument ("--create" , action = "store_true" , help = "Create a concatenated file." )
93- parser .add_argument ("--extract" , action = "store_true" , help = "Extract files from a concatenated archive." )
94- parser .add_argument ("--list" , action = "store_true" , help = "List contents of a concatenated file." )
95- parser .add_argument ("--repack" , action = "store_true" , help = "Repack a concatenated file." )
96- parser .add_argument ("--validate" , action = "store_true" , help = "Validate a concatenated file." )
92+ parser .add_argument ("--create" , action = "store_true" , help = "Create a archive file." )
93+ parser .add_argument ("--extract" , action = "store_true" , help = "Extract files from a archive archive." )
94+ parser .add_argument ("--list" , action = "store_true" , help = "List contents of a archive file." )
95+ parser .add_argument ("--repack" , action = "store_true" , help = "Repack a archive file." )
96+ parser .add_argument ("--validate" , action = "store_true" , help = "Validate a archive file." )
9797 parser .add_argument ("--format" , help = "Format name (dynamic mode only)." )
9898 parser .add_argument ("--delimiter" , help = "Delimiter character (dynamic mode only)." )
9999 parser .add_argument ("--formatver" , help = "Format version (dynamic mode only)." )
@@ -132,15 +132,15 @@ def main():
132132
133133 # Determine operation
134134 if args .create :
135- pycatfile .PackArchiveFile (args .input , args .output , False , __file_format_default__ , args .compression , args .level , pycatfile .compressionlistalt , False , [args .checksum , args .checksum , args .checksum ], [], format_dict , args .verbose , False )
135+ pyarchivefile .PackArchiveFile (args .input , args .output , False , __file_format_default__ , args .compression , args .level , pyarchivefile .compressionlistalt , False , [args .checksum , args .checksum , args .checksum ], [], format_dict , args .verbose , False )
136136 elif args .repack :
137- pycatfile .RePackArchiveFile ( input_file , args .output , args .compression , args .level , pycatfile .compressionlistalt , [args .checksum , args .checksum , args .checksum ], args .verbose )
137+ pyarchivefile .RePackArchiveFile ( input_file , args .output , args .compression , args .level , pyarchivefile .compressionlistalt , [args .checksum , args .checksum , args .checksum ], args .verbose )
138138 elif args .extract :
139- pycatfile .UnPackArchiveFile (input_file , args .output , args .verbose , args .preserve )
139+ pyarchivefile .UnPackArchiveFile (input_file , args .output , args .verbose , args .preserve )
140140 elif args .list :
141- pycatfile .ArchiveFileListFiles (input_file , verbose = args .verbose )
141+ pyarchivefile .ArchiveFileListFiles (input_file , verbose = args .verbose )
142142 elif args .validate :
143- is_valid = pycatfile .ArchiveFileValidate (input_file , verbose = args .verbose )
143+ is_valid = pyarchivefile .ArchiveFileValidate (input_file , verbose = args .verbose )
144144 result_msg = "Validation result for {}: {}" .format (input_file , 'Valid' if is_valid else 'Invalid' )
145145 print (result_msg )
146146 else :
0 commit comments