PyCatFile 0.15.12__tar.gz → 0.15.16__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.1
2
2
  Name: PyCatFile
3
- Version: 0.15.12
3
+ Version: 0.15.16
4
4
  Summary: A tar like file format name catfile after unix cat command (concatenate files) .
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.1
2
2
  Name: PyCatFile
3
- Version: 0.15.12
3
+ Version: 0.15.16
4
4
  Summary: A tar like file format name catfile after unix cat command (concatenate files) .
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: 12/20/2024 Ver. 0.15.12 RC 1 - Author: cooldude2k $
17
+ $FileInfo: catfile.py - Last Update: 12/21/2024 Ver. 0.15.14 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
@@ -98,7 +98,7 @@ argparser.add_argument("-V", "--version", action="version",
98
98
  version=__program_name__ + " " + __version__)
99
99
  # Input and output specifications
100
100
  argparser.add_argument(
101
- "-i", "--input", help="Specify the file(s) to concatenate or the concatenated file to extract.", required=True)
101
+ "-i", "--input", nargs="+", help="Specify the file(s) to concatenate or the concatenated file to extract.", required=True)
102
102
  argparser.add_argument("-o", "--output", default=None,
103
103
  help="Specify the name for the extracted or output concatenated files.")
104
104
  # Operations
@@ -161,19 +161,20 @@ fnamedict = {'format_name': fname, 'format_magic': fnamemagic, 'format_lower': f
161
161
  actions = ['create', 'extract', 'list', 'repack', 'validate']
162
162
  active_action = next(
163
163
  (action for action in actions if getattr(getargs, action)), None)
164
+ input_file = getargs.input[0]
164
165
 
165
166
  # Execute the appropriate functions based on determined actions and arguments
166
167
  if active_action:
167
168
  if active_action == 'create':
168
169
  if getargs.convert:
169
170
  checkcompressfile = pycatfile.CheckCompressionSubType(
170
- getargs.input, fnamedict, True)
171
+ input_file, fnamedict, True)
171
172
  if(checkcompressfile == "catfile"):
172
- tmpout = pycatfile.RePackArchiveFile(getargs.input, getargs.output, getargs.compression, getargs.wholefile,
173
+ tmpout = pycatfile.RePackArchiveFile(input_file, getargs.output, getargs.compression, getargs.wholefile,
173
174
  getargs.level, False, 0, 0, getargs.checksum, getargs.skipchecksum, [], fnamedict, getargs.verbose, False)
174
175
  else:
175
176
  tmpout = pycatfile.PackArchiveFileFromInFile(
176
- getargs.input, getargs.output, getargs.compression, getargs.wholefile, getargs.level, getargs.checksum, [], fnamedict, getargs.verbose, False)
177
+ input_file, getargs.output, getargs.compression, getargs.wholefile, getargs.level, getargs.checksum, [], fnamedict, getargs.verbose, False)
177
178
  if(not tmpout):
178
179
  sys.exit(1)
179
180
  else:
@@ -182,72 +183,72 @@ if active_action:
182
183
  elif active_action == 'repack':
183
184
  if getargs.convert:
184
185
  checkcompressfile = pycatfile.CheckCompressionSubType(
185
- getargs.input, fnamedict, True)
186
+ input_file, fnamedict, True)
186
187
  if(checkcompressfile == "catfile"):
187
- pycatfile.RePackArchiveFile(getargs.input, getargs.output, getargs.compression, getargs.wholefile, getargs.level,
188
+ pycatfile.RePackArchiveFile(input_file, getargs.output, getargs.compression, getargs.wholefile, getargs.level,
188
189
  False, 0, 0, getargs.checksum, getargs.skipchecksum, [], fnamedict, getargs.verbose, False)
189
190
  else:
190
- pycatfile.PackArchiveFileFromInFile(getargs.input, getargs.output, getargs.compression,
191
+ pycatfile.PackArchiveFileFromInFile(input_file, getargs.output, getargs.compression,
191
192
  getargs.wholefile, getargs.level, getargs.checksum, [], fnamedict, getargs.verbose, False)
192
193
  if(not tmpout):
193
194
  sys.exit(1)
194
195
  else:
195
- pycatfile.RePackArchiveFile(getargs.input, getargs.output, getargs.compression, getargs.wholefile, getargs.level,
196
+ pycatfile.RePackArchiveFile(input_file, getargs.output, getargs.compression, getargs.wholefile, getargs.level,
196
197
  False, 0, 0, getargs.checksum, getargs.skipchecksum, [], fnamedict, getargs.verbose, False)
197
198
  elif active_action == 'extract':
198
199
  if getargs.convert:
199
200
  checkcompressfile = pycatfile.CheckCompressionSubType(
200
- getargs.input, fnamedict, True)
201
+ input_file, fnamedict, True)
201
202
  tempout = BytesIO()
202
203
  if(checkcompressfile == "catfile"):
203
- tmpout = pycatfile.RePackArchiveFile(getargs.input, tempout, getargs.compression, getargs.wholefile,
204
+ tmpout = pycatfile.RePackArchiveFile(input_file, tempout, getargs.compression, getargs.wholefile,
204
205
  getargs.level, False, 0, 0, getargs.checksum, getargs.skipchecksum, [], fnamedict, False, False)
205
206
  else:
206
207
  tmpout = pycatfile.PackArchiveFileFromInFile(
207
- getargs.input, tempout, getargs.compression, getargs.wholefile, getargs.level, getargs.checksum, [], fnamedict, False, False)
208
+ input_file, tempout, getargs.compression, getargs.wholefile, getargs.level, getargs.checksum, [], fnamedict, False, False)
208
209
  if(not tmpout):
209
210
  sys.exit(1)
210
- getargs.input = tempout
211
- pycatfile.UnPackArchiveFile(getargs.input, getargs.output, False, 0, 0, getargs.skipchecksum,
211
+ input_file = tempout
212
+ pycatfile.UnPackArchiveFile(input_file, getargs.output, False, 0, 0, getargs.skipchecksum,
212
213
  fnamedict, getargs.verbose, getargs.preserve, getargs.preserve, False)
213
214
  elif active_action == 'list':
214
215
  if getargs.convert:
215
216
  checkcompressfile = pycatfile.CheckCompressionSubType(
216
- getargs.input, fnamedict, True)
217
+ input_file, fnamedict, True)
217
218
  if(checkcompressfile == "catfile"):
218
219
  tmpout = pycatfile.ArchiveFileListFiles(
219
- getargs.input, 0, 0, getargs.skipchecksum, fnamedict, getargs.verbose, False)
220
+ input_file, 0, 0, getargs.skipchecksum, fnamedict, getargs.verbose, False)
220
221
  else:
221
222
  tmpout = pycatfile.InFileListFiles(
222
- getargs.input, getargs.verbose, fnamedict, False)
223
+ input_file, getargs.verbose, fnamedict, False)
223
224
  if(not tmpout):
224
225
  sys.exit(1)
225
226
  else:
226
227
  pycatfile.ArchiveFileListFiles(
227
- getargs.input, 0, 0, getargs.skipchecksum, fnamedict, getargs.verbose, False)
228
+ input_file, 0, 0, getargs.skipchecksum, fnamedict, getargs.verbose, False)
228
229
  elif active_action == 'validate':
229
230
  if getargs.convert:
230
231
  checkcompressfile = pycatfile.CheckCompressionSubType(
231
- getargs.input, fnamedict, True)
232
+ input_file, fnamedict, True)
232
233
  tempout = BytesIO()
233
234
  if(checkcompressfile == "catfile"):
234
- tmpout = pycatfile.RePackArchiveFile(getargs.input, tempout, getargs.compression, getargs.wholefile,
235
+ tmpout = pycatfile.RePackArchiveFile(input_file, tempout, getargs.compression, getargs.wholefile,
235
236
  getargs.level, False, 0, 0, getargs.checksum, getargs.skipchecksum, [], fnamedict, False, False)
236
237
  else:
237
238
  tmpout = pycatfile.PackArchiveFileFromInFile(
238
- getargs.input, tempout, getargs.compression, getargs.wholefile, getargs.level, getargs.checksum, [], fnamedict, False, False)
239
- getargs.input = tempout
239
+ input_file, tempout, getargs.compression, getargs.wholefile, getargs.level, getargs.checksum, [], fnamedict, False, False)
240
+ input_file = tempout
240
241
  if(not tmpout):
241
242
  sys.exit(1)
242
243
  fvalid = pycatfile.ArchiveFileValidate(
243
- getargs.input, fnamedict, getargs.verbose, False)
244
+ input_file, fnamedict, getargs.verbose, False)
244
245
  if(not getargs.verbose):
245
246
  import sys
246
247
  import logging
247
248
  logging.basicConfig(format="%(message)s",
248
249
  stream=sys.stdout, level=logging.DEBUG)
249
250
  if(fvalid):
250
- pycatfile.VerbosePrintOut("File is valid: \n" + str(getargs.input))
251
+ pycatfile.VerbosePrintOut("File is valid: \n" + str(input_file))
251
252
  else:
252
253
  pycatfile.VerbosePrintOut(
253
- "File is invalid: \n" + str(getargs.input))
254
+ "File is invalid: \n" + str(input_file))
@@ -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: neocatfile.py - Last Update: 12/20/2024 Ver. 0.15.12 RC 1 - Author: cooldude2k $
17
+ $FileInfo: neocatfile.py - Last Update: 12/21/2024 Ver. 0.15.14 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
@@ -55,7 +55,7 @@ argparser = argparse.ArgumentParser(
55
55
  description="Manipulates concatenated files for various operations like creation, extraction, and validation.")
56
56
  argparser.add_argument("-V", "--version", action="version", version="{0} {1}".format(
57
57
  __program_name__, __version__), help="Displays the program's version.")
58
- argparser.add_argument("-i", "--input", required=True,
58
+ argparser.add_argument("-i", "--input", nargs="+", required=True,
59
59
  help="Specifies input file(s) for processing.")
60
60
  argparser.add_argument(
61
61
  "-o", "--output", help="Specifies the output file name.")
@@ -94,43 +94,43 @@ elif args.list:
94
94
  primary_action = 'list'
95
95
  elif args.validate:
96
96
  primary_action = 'validate'
97
-
97
+ input_file = args.input[0]
98
98
  # Functionality mappings
99
99
  if primary_action == 'create':
100
100
  if args.convert == 'tar':
101
- pycatfile.PackArchiveFileFromTarFile(args.input, args.output, args.compression, args.level, args.checksum, [
101
+ pycatfile.PackArchiveFileFromTarFile(input_file, args.output, args.compression, args.level, args.checksum, [
102
102
  ], pycatfile.__file_format_list__, args.verbose, False)
103
103
  elif args.convert == 'zip':
104
- pycatfile.PackArchiveFileFromZipFile(args.input, args.output, args.compression, args.level, args.checksum, [
104
+ pycatfile.PackArchiveFileFromZipFile(input_file, args.output, args.compression, args.level, args.checksum, [
105
105
  ], pycatfile.__file_format_list__, args.verbose, False)
106
106
  elif py7zr_support and args.convert == '7zip':
107
- pycatfile.PackArchiveFileFromSevenZipFile(args.input, args.output, args.compression, args.level, args.checksum, [
107
+ pycatfile.PackArchiveFileFromSevenZipFile(input_file, args.output, args.compression, args.level, args.checksum, [
108
108
  ], pycatfile.__file_format_list__, args.verbose, False)
109
109
  elif rarfile_support and args.convert == 'rar':
110
- pycatfile.PackArchiveFileFromRarFile(args.input, args.output, args.compression, args.level, args.checksum, [
110
+ pycatfile.PackArchiveFileFromRarFile(input_file, args.output, args.compression, args.level, args.checksum, [
111
111
  ], pycatfile.__file_format_list__, args.verbose, False)
112
112
  else:
113
113
  pycatfile.PackArchiveFile(args.input, args.output, args.verbose, args.compression, args.level,
114
114
  False, args.checksum, [], pycatfile.__file_format_list__, args.verbose, False)
115
115
  elif primary_action == 'repack':
116
116
  pycatfile.RePackArchiveFile(
117
- args.input, args.output, args.compression, args.level, args.checksum, args.verbose)
117
+ input_file, args.output, args.compression, args.level, args.checksum, args.verbose)
118
118
  elif primary_action == 'extract':
119
119
  pycatfile.UnPackArchiveFile(
120
- args.input, args.output, args.verbose, args.preserve)
120
+ input_file, args.output, args.verbose, args.preserve)
121
121
  elif primary_action == 'list':
122
122
  if args.convert == 'tar':
123
- pycatfile.TarFileListFiles(args.input, verbose=args.verbose)
123
+ pycatfile.TarFileListFiles(input_file, verbose=args.verbose)
124
124
  elif args.convert == 'zip':
125
- pycatfile.ZipFileListFiles(args.input, verbose=args.verbose)
125
+ pycatfile.ZipFileListFiles(input_file, verbose=args.verbose)
126
126
  elif args.convert == '7zip':
127
- pycatfile.SevenZipFileListFiles(args.input, verbose=args.verbose)
127
+ pycatfile.SevenZipFileListFiles(input_file, verbose=args.verbose)
128
128
  elif rarfile_support and args.convert == 'rar':
129
- pycatfile.RarFileListFiles(args.input, verbose=args.verbose)
129
+ pycatfile.RarFileListFiles(input_file, verbose=args.verbose)
130
130
  else:
131
- pycatfile.ArchiveFileListFiles(args.input, verbose=args.verbose)
131
+ pycatfile.ArchiveFileListFiles(input_file, verbose=args.verbose)
132
132
  elif primary_action == 'validate':
133
- is_valid = pycatfile.ArchiveFileValidate(args.input, args.verbose)
133
+ is_valid = pycatfile.ArchiveFileValidate(input_file, args.verbose)
134
134
  result_msg = "Validation result for {0}: {1}".format(
135
- args.input, 'Valid' if is_valid else 'Invalid')
135
+ input_file, 'Valid' if is_valid else 'Invalid')
136
136
  print(result_msg)