PyFoxFile 0.20.2__tar.gz → 0.20.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: PyFoxFile
3
- Version: 0.20.2
3
+ Version: 0.20.4
4
4
  Summary: A tar like file format name foxfile.
5
5
  Home-page: https://github.com/GameMaker2k/PyFoxFile
6
6
  Download-URL: https://github.com/GameMaker2k/PyFoxFile/archive/master.tar.gz
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PyFoxFile
3
- Version: 0.20.2
3
+ Version: 0.20.4
4
4
  Summary: A tar like file format name foxfile.
5
5
  Home-page: https://github.com/GameMaker2k/PyFoxFile
6
6
  Download-URL: https://github.com/GameMaker2k/PyFoxFile/archive/master.tar.gz
@@ -172,7 +172,7 @@ if active_action:
172
172
  if getargs.convert:
173
173
  checkcompressfile = pyfoxfile.CheckCompressionSubType(
174
174
  input_file, fnamedict, True)
175
- if((IsNestedDict(fnamedict) and compresscheck in fnamedict) or (IsSingleDict(fnamedict) and compresscheck==fnamedict['format_magic'])):
175
+ if((IsNestedDict(fnamedict) and checkcompressfile in fnamedict) or (IsSingleDict(fnamedict) and checkcompressfile==fnamedict['format_magic'])):
176
176
  tmpout = pyfoxfile.RePackFoxFile(input_file, getargs.output, getargs.compression, getargs.wholefile, getargs.level, pyfoxfile.compressionlistalt, False, 0, 0, [getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum], getargs.skipchecksum, [], {}, fnamedict, getargs.verbose, False)
177
177
  else:
178
178
  tmpout = pyfoxfile.PackFoxFileFromInFile(
@@ -185,7 +185,7 @@ if active_action:
185
185
  if getargs.convert:
186
186
  checkcompressfile = pyfoxfile.CheckCompressionSubType(
187
187
  input_file, fnamedict, True)
188
- if((IsNestedDict(fnamedict) and compresscheck in fnamedict) or (IsSingleDict(fnamedict) and compresscheck==fnamedict['format_magic'])):
188
+ if((IsNestedDict(fnamedict) and checkcompressfile in fnamedict) or (IsSingleDict(fnamedict) and checkcompressfile==fnamedict['format_magic'])):
189
189
  pyfoxfile.RePackFoxFile(input_file, getargs.output, getargs.compression, getargs.wholefile, getargs.level, pyfoxfile.compressionlistalt,
190
190
  False, 0, 0, [getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum], getargs.skipchecksum, [], {}, fnamedict, getargs.verbose, False)
191
191
  else:
@@ -200,7 +200,7 @@ if active_action:
200
200
  checkcompressfile = pyfoxfile.CheckCompressionSubType(
201
201
  input_file, fnamedict, True)
202
202
  tempout = BytesIO()
203
- if((IsNestedDict(fnamedict) and compresscheck in fnamedict) or (IsSingleDict(fnamedict) and compresscheck==fnamedict['format_magic'])):
203
+ if((IsNestedDict(fnamedict) and checkcompressfile in fnamedict) or (IsSingleDict(fnamedict) and checkcompressfile==fnamedict['format_magic'])):
204
204
  tmpout = pyfoxfile.RePackFoxFile(input_file, tempout, getargs.compression, getargs.wholefile, getargs.level, pyfoxfile.compressionlistalt, False, 0, 0, [getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum], getargs.skipchecksum, [], {}, fnamedict, False, False)
205
205
  else:
206
206
  tmpout = pyfoxfile.PackFoxFileFromInFile(
@@ -214,20 +214,20 @@ if active_action:
214
214
  if getargs.convert:
215
215
  checkcompressfile = pyfoxfile.CheckCompressionSubType(
216
216
  input_file, fnamedict, True)
217
- if((IsNestedDict(fnamedict) and compresscheck in fnamedict) or (IsSingleDict(fnamedict) and compresscheck==fnamedict['format_magic'])):
218
- tmpout = pyfoxfile.FoxFileListFiles(input_file, "auto", 0, 0, getargs.skipchecksum, fnamedict, False, getargs.verbose, False)
217
+ if((IsNestedDict(fnamedict) and checkcompressfile in fnamedict) or (IsSingleDict(fnamedict) and checkcompressfile==fnamedict['format_magic'])):
218
+ tmpout = pyfoxfile.FoxFileListFiles(input_file, "auto", 0, 0, getargs.skipchecksum, fnamedict, False, getargs.verbose, False, False)
219
219
  else:
220
- tmpout = pyfoxfile.InFileListFiles(input_file, getargs.verbose, fnamedict, False, False)
220
+ tmpout = pyfoxfile.InFileListFiles(input_file, getargs.verbose, fnamedict, False, False, False)
221
221
  if(not tmpout):
222
222
  sys.exit(1)
223
223
  else:
224
- pyfoxfile.FoxFileListFiles(input_file, "auto", 0, 0, getargs.skipchecksum, fnamedict, False, getargs.verbose, False)
224
+ pyfoxfile.FoxFileListFiles(input_file, "auto", 0, 0, getargs.skipchecksum, fnamedict, False, getargs.verbose, False, False)
225
225
  elif active_action == 'validate':
226
226
  if getargs.convert:
227
227
  checkcompressfile = pyfoxfile.CheckCompressionSubType(
228
228
  input_file, fnamedict, True)
229
229
  tempout = BytesIO()
230
- if((IsNestedDict(fnamedict) and compresscheck in fnamedict) or (IsSingleDict(fnamedict) and compresscheck==fnamedict['format_magic'])):
230
+ if((IsNestedDict(fnamedict) and checkcompressfile in fnamedict) or (IsSingleDict(fnamedict) and checkcompressfile==fnamedict['format_magic'])):
231
231
  tmpout = pyfoxfile.RePackFoxFile(input_file, tempout, getargs.compression, getargs.wholefile, getargs.level, pyfoxfile.compressionlistalt, False, 0, 0, [getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum], getargs.skipchecksum, [], {}, fnamedict, False, False, False)
232
232
  else:
233
233
  tmpout = pyfoxfile.PackFoxFileFromInFile(
@@ -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: pyfoxfile.py - Last Update: 8/20/2025 Ver. 0.20.2 RC 1 - Author: cooldude2k $
17
+ $FileInfo: pyfoxfile.py - Last Update: 9/12/2025 Ver. 0.20.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
@@ -76,6 +76,20 @@ try:
76
76
  except NameError:
77
77
  basestring = str
78
78
 
79
+ try:
80
+ unicode # Py2
81
+ except NameError: # Py3
82
+ unicode = str
83
+
84
+ def to_text(s, encoding="utf-8", errors="ignore"):
85
+ if s is None:
86
+ return u""
87
+ if isinstance(s, unicode):
88
+ return s
89
+ if isinstance(s, (bytes, bytearray)):
90
+ return s.decode(encoding, errors)
91
+ return unicode(s)
92
+
79
93
  baseint = []
80
94
  try:
81
95
  baseint.append(long)
@@ -91,16 +105,19 @@ except ImportError:
91
105
  from urlparse import urlparse, urlunparse
92
106
 
93
107
  # Windows-specific setup
94
- if os.name == 'nt':
95
- if sys.version_info[0] == 2:
96
- import codecs
97
- sys.stdout = codecs.getwriter('UTF-8')(sys.stdout)
98
- sys.stderr = codecs.getwriter('UTF-8')(sys.stderr)
99
- else:
100
- sys.stdout = io.TextIOWrapper(
101
- sys.stdout.buffer, encoding='UTF-8', errors='replace', line_buffering=True)
102
- sys.stderr = io.TextIOWrapper(
103
- sys.stderr.buffer, encoding='UTF-8', errors='replace', line_buffering=True)
108
+ if os.name == "nt":
109
+ import io
110
+ def _wrap(stream):
111
+ buf = getattr(stream, "buffer", None)
112
+ is_tty = getattr(stream, "isatty", lambda: False)()
113
+ if buf is not None and is_tty:
114
+ try:
115
+ return io.TextIOWrapper(buf, encoding="UTF-8", errors="replace", line_buffering=True)
116
+ except Exception:
117
+ return stream
118
+ return stream
119
+ sys.stdout = _wrap(sys.stdout)
120
+ sys.stderr = _wrap(sys.stderr)
104
121
 
105
122
  hashlib_guaranteed = False
106
123
  # Environment setup
@@ -286,7 +303,28 @@ if((__use_http_lib__ == "httpx" or __use_http_lib__ == "requests") and not haveh
286
303
  # Define a function to check if var contains only non-printable chars
287
304
  all_np_chars = [chr(i) for i in range(128)]
288
305
  def is_only_nonprintable(var):
289
- return all(not c.isprintable() for c in var)
306
+ """True if every character is non-printable (Py2/3-safe, handles bytes)."""
307
+ if var is None:
308
+ return True
309
+ s = to_text(var)
310
+ # In Py2, some unicode categories behave differently; isprintable is Py3-only.
311
+ # We'll implement a portable check: letters, numbers, punctuation, and common whitespace are printable.
312
+ try:
313
+ # Py3 fast path
314
+ return all(not ch.isprintable() for ch in s)
315
+ except AttributeError:
316
+ # Py2 path
317
+ import unicodedata
318
+ def _is_printable(ch):
319
+ cat = unicodedata.category(ch)
320
+ # Categories starting with 'C' are control/non-assigned/surrogates
321
+ if cat.startswith('C'):
322
+ return False
323
+ # treat space and common whitespace as printable
324
+ if ch in u"\t\n\r\x0b\x0c ":
325
+ return True
326
+ return True
327
+ return all(not _is_printable(ch) for ch in s)
290
328
  __file_format_multi_dict__ = {}
291
329
  __file_format_default__ = "FoxFile"
292
330
  __include_defaults__ = True
@@ -343,12 +381,12 @@ __file_format_extension__ = __file_format_multi_dict__[__file_format_default__][
343
381
  __file_format_dict__ = __file_format_multi_dict__[__file_format_default__]
344
382
  __project__ = __program_name__
345
383
  __project_url__ = "https://github.com/GameMaker2k/PyFoxFile"
346
- __version_info__ = (0, 20, 2, "RC 1", 1)
347
- __version_date_info__ = (2025, 8, 20, "RC 1", 1)
384
+ __version_info__ = (0, 20, 4, "RC 1", 1)
385
+ __version_date_info__ = (2025, 9, 12, "RC 1", 1)
348
386
  __version_date__ = str(__version_date_info__[0]) + "." + str(
349
387
  __version_date_info__[1]).zfill(2) + "." + str(__version_date_info__[2]).zfill(2)
350
388
  __revision__ = __version_info__[3]
351
- __revision_id__ = "$Id: f39faffa7677854e017207fb17bd5d24fc61bcd4 $"
389
+ __revision_id__ = "$Id: be7ce175b0158341dc4ec24590e146762f619240 $"
352
390
  if(__version_info__[4] is not None):
353
391
  __version_date_plusrc__ = __version_date__ + \
354
392
  "-" + str(__version_date_info__[4])
@@ -360,13 +398,15 @@ if(__version_info__[3] is not None):
360
398
  if(__version_info__[3] is None):
361
399
  __version__ = str(__version_info__[0]) + "." + str(__version_info__[1]) + "." + str(__version_info__[2])
362
400
 
363
- PyBitness = platform.architecture()
364
- if(PyBitness == "32bit" or PyBitness == "32"):
365
- PyBitness = "32"
366
- elif(PyBitness == "64bit" or PyBitness == "64"):
367
- PyBitness = "64"
368
- else:
369
- PyBitness = "32"
401
+ # Robust bitness detection
402
+ # Works on Py2 & Py3, all platforms
403
+ try:
404
+ import struct
405
+ PyBitness = "64" if struct.calcsize("P") * 8 == 64 else "32"
406
+ except Exception:
407
+ # conservative fallback
408
+ m = platform.machine() or ""
409
+ PyBitness = "64" if m.endswith("64") else "32"
370
410
 
371
411
  geturls_ua_pyfile_python = "Mozilla/5.0 (compatible; {proname}/{prover}; +{prourl})".format(
372
412
  proname=__project__, prover=__version__, prourl=__project_url__)
@@ -379,9 +419,9 @@ geturls_ua_pyfile_python_alt = "Mozilla/5.0 ({osver}; {archtype}; +{prourl}) {py
379
419
  geturls_ua_googlebot_google = "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
380
420
  geturls_ua_googlebot_google_old = "Googlebot/2.1 (+http://www.google.com/bot.html)"
381
421
  geturls_headers_pyfile_python = {'Referer': "http://google.com/", 'User-Agent': geturls_ua_pyfile_python, 'Accept-Encoding': "none", 'Accept-Language': "en-US,en;q=0.8,en-CA,en-GB;q=0.6", 'Accept-Charset': "ISO-8859-1,ISO-8859-15,UTF-8;q=0.7,*;q=0.7", 'Accept': "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", 'Connection': "close",
382
- 'SEC-CH-UA': "\""+__project__+"\";v=\""+str(__version__)+"\", \"Not;A=Brand\";v=\"8\", \""+py_implementation+"\";v=\""+str(platform.release())+"\"", 'SEC-CH-UA-FULL-VERSION': str(__version__), 'SEC-CH-UA-PLATFORM': ""+py_implementation+"", 'SEC-CH-UA-ARCH': ""+platform.machine()+"", 'SEC-CH-UA-PLATFORM': str(__version__), 'SEC-CH-UA-BITNESS': str(PyBitness)}
422
+ 'SEC-CH-UA': "\""+__project__+"\";v=\""+str(__version__)+"\", \"Not;A=Brand\";v=\"8\", \""+py_implementation+"\";v=\""+str(platform.release())+"\"", 'SEC-CH-UA-FULL-VERSION': str(__version__), 'SEC-CH-UA-PLATFORM': ""+py_implementation+"", 'SEC-CH-UA-ARCH': ""+platform.machine()+"", 'SEC-CH-UA-PLATFORM-VERSION': str(__version__), 'SEC-CH-UA-BITNESS': str(PyBitness)}
383
423
  geturls_headers_pyfile_python_alt = {'Referer': "http://google.com/", 'User-Agent': geturls_ua_pyfile_python_alt, 'Accept-Encoding': "none", 'Accept-Language': "en-US,en;q=0.8,en-CA,en-GB;q=0.6", 'Accept-Charset': "ISO-8859-1,ISO-8859-15,UTF-8;q=0.7,*;q=0.7", 'Accept': "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", 'Connection': "close",
384
- 'SEC-CH-UA': "\""+__project__+"\";v=\""+str(__version__)+"\", \"Not;A=Brand\";v=\"8\", \""+py_implementation+"\";v=\""+str(platform.release())+"\"", 'SEC-CH-UA-FULL-VERSION': str(__version__), 'SEC-CH-UA-PLATFORM': ""+py_implementation+"", 'SEC-CH-UA-ARCH': ""+platform.machine()+"", 'SEC-CH-UA-PLATFORM': str(__version__), 'SEC-CH-UA-BITNESS': str(PyBitness)}
424
+ 'SEC-CH-UA': "\""+__project__+"\";v=\""+str(__version__)+"\", \"Not;A=Brand\";v=\"8\", \""+py_implementation+"\";v=\""+str(platform.release())+"\"", 'SEC-CH-UA-FULL-VERSION': str(__version__), 'SEC-CH-UA-PLATFORM': ""+py_implementation+"", 'SEC-CH-UA-ARCH': ""+platform.machine()+"", 'SEC-CH-UA-PLATFORM-VERSION': str(__version__), 'SEC-CH-UA-BITNESS': str(PyBitness)}
385
425
  geturls_headers_googlebot_google = {'Referer': "http://google.com/", 'User-Agent': geturls_ua_googlebot_google, 'Accept-Encoding': "none", 'Accept-Language': "en-US,en;q=0.8,en-CA,en-GB;q=0.6",
386
426
  'Accept-Charset': "ISO-8859-1,ISO-8859-15,UTF-8;q=0.7,*;q=0.7", 'Accept': "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", 'Connection': "close"}
387
427
  geturls_headers_googlebot_google_old = {'Referer': "http://google.com/", 'User-Agent': geturls_ua_googlebot_google_old, 'Accept-Encoding': "none", 'Accept-Language': "en-US,en;q=0.8,en-CA,en-GB;q=0.6",
@@ -538,16 +578,20 @@ def VerbosePrintOutReturn(dbgtxt, outtype="log", dbgenable=True, dgblevel=20):
538
578
 
539
579
  def RemoveWindowsPath(dpath):
540
580
  """
541
- Normalizes a path by converting Windows-style separators to Unix-style and stripping trailing slashes.
581
+ Normalize a path by converting backslashes to forward slashes
582
+ and stripping a trailing slash.
542
583
  """
543
- if dpath is None:
544
- dpath = ""
545
- if os.sep != "/":
546
- dpath = dpath.replace(os.path.sep, "/")
547
- dpath = dpath.rstrip("/")
548
- if dpath in [".", ".."]:
549
- dpath = dpath + "/"
550
- return dpath
584
+ if not dpath:
585
+ return ""
586
+ # Accept bytes and decode safely
587
+ if isinstance(dpath, (bytes, bytearray)):
588
+ dpath = dpath.decode("utf-8", "ignore")
589
+ dpath = dpath.replace("\\", "/")
590
+ # Collapse multiple slashes except for protocol prefixes like "s3://"
591
+ if "://" not in dpath:
592
+ while "//" in dpath:
593
+ dpath = dpath.replace("//", "/")
594
+ return dpath.rstrip("/")
551
595
 
552
596
 
553
597
  def NormalizeRelativePath(inpath):
@@ -8554,60 +8598,78 @@ def UnPackFoxFileString(instr, outdir=None, followlink=False, seekstart=0, seeke
8554
8598
  listfoxfiles = UnPackFoxFile(fp, outdir, followlink, seekstart, seekend, skipchecksum, formatspecs, seektoend, verbose, returnfp)
8555
8599
  return listfoxfiles
8556
8600
 
8601
+ def ftype_to_str(ftype):
8602
+ mapping = {
8603
+ 0: "file",
8604
+ 1: "link",
8605
+ 2: "symlink",
8606
+ 3: "char device",
8607
+ 4: "block device",
8608
+ 5: "directory",
8609
+ 6: "fifo",
8610
+ 12: "sparse",
8611
+ 14: "device",
8612
+ }
8613
+ # Default to "file" if unknown
8614
+ return mapping.get(ftype, "file")
8557
8615
 
8558
- def FoxFileListFiles(infile, fmttype="auto", seekstart=0, seekend=0, skipchecksum=False, formatspecs=__file_format_multi_dict__, seektoend=False, verbose=False, returnfp=False):
8616
+ def FoxFileListFiles(infile, fmttype="auto", seekstart=0, seekend=0, skipchecksum=False, formatspecs=__file_format_multi_dict__, seektoend=False, verbose=False, newstyle=False, returnfp=False):
8559
8617
  if(verbose):
8560
8618
  logging.basicConfig(format="%(message)s", stream=sys.stdout, level=logging.DEBUG)
8561
8619
  if(isinstance(infile, dict)):
8562
- listfoxfiles = infile
8620
+ listarchivefiles = infile
8563
8621
  else:
8564
8622
  if(infile != "-" and not hasattr(infile, "read") and not hasattr(infile, "write") and not (sys.version_info[0] >= 3 and isinstance(infile, bytes))):
8565
8623
  infile = RemoveWindowsPath(infile)
8566
- listfoxfiles = FoxFileToArray(infile, fmttype, seekstart, seekend, True, False, False, skipchecksum, formatspecs, seektoend, returnfp)
8567
- if(not listfoxfiles):
8624
+ listarchivefiles = ArchiveFileToArray(infile, fmttype, seekstart, seekend, True, False, False, skipchecksum, formatspecs, seektoend, returnfp)
8625
+ if(not listarchivefiles):
8568
8626
  return False
8569
- lenlist = len(listfoxfiles['ffilelist'])
8570
- fnumfiles = int(listfoxfiles['fnumfiles'])
8627
+ lenlist = len(listarchivefiles['ffilelist'])
8628
+ fnumfiles = int(listarchivefiles['fnumfiles'])
8571
8629
  lcfi = 0
8572
- lcfx = int(listfoxfiles['fnumfiles'])
8573
- if(lenlist > listfoxfiles['fnumfiles'] or lenlist < listfoxfiles['fnumfiles']):
8630
+ lcfx = int(listarchivefiles['fnumfiles'])
8631
+ if(lenlist > listarchivefiles['fnumfiles'] or lenlist < listarchivefiles['fnumfiles']):
8574
8632
  lcfx = int(lenlist)
8575
8633
  else:
8576
- lcfx = int(listfoxfiles['fnumfiles'])
8634
+ lcfx = int(listarchivefiles['fnumfiles'])
8577
8635
  returnval = {}
8578
8636
  while(lcfi < lcfx):
8579
- returnval.update({lcfi: listfoxfiles['ffilelist'][lcfi]['fname']})
8637
+ returnval.update({lcfi: listarchivefiles['ffilelist'][lcfi]['fname']})
8580
8638
  if(not verbose):
8581
- VerbosePrintOut(listfoxfiles['ffilelist'][lcfi]['fname'])
8639
+ VerbosePrintOut(listarchivefiles['ffilelist'][lcfi]['fname'])
8582
8640
  if(verbose):
8583
8641
  permissions = {'access': {'0': ('---'), '1': ('--x'), '2': ('-w-'), '3': ('-wx'), '4': (
8584
8642
  'r--'), '5': ('r-x'), '6': ('rw-'), '7': ('rwx')}, 'roles': {0: 'owner', 1: 'group', 2: 'other'}}
8585
- printfname = listfoxfiles['ffilelist'][lcfi]['fname']
8586
- if(listfoxfiles['ffilelist'][lcfi]['ftype'] == 1):
8587
- printfname = listfoxfiles['ffilelist'][lcfi]['fname'] + \
8588
- " link to " + listfoxfiles['ffilelist'][lcfi]['flinkname']
8589
- if(listfoxfiles['ffilelist'][lcfi]['ftype'] == 2):
8590
- printfname = listfoxfiles['ffilelist'][lcfi]['fname'] + \
8591
- " -> " + listfoxfiles['ffilelist'][lcfi]['flinkname']
8592
- fuprint = listfoxfiles['ffilelist'][lcfi]['funame']
8643
+ printfname = listarchivefiles['ffilelist'][lcfi]['fname']
8644
+ if(listarchivefiles['ffilelist'][lcfi]['ftype'] == 1):
8645
+ printfname = listarchivefiles['ffilelist'][lcfi]['fname'] + \
8646
+ " link to " + listarchivefiles['ffilelist'][lcfi]['flinkname']
8647
+ if(listarchivefiles['ffilelist'][lcfi]['ftype'] == 2):
8648
+ printfname = listarchivefiles['ffilelist'][lcfi]['fname'] + \
8649
+ " -> " + listarchivefiles['ffilelist'][lcfi]['flinkname']
8650
+ fuprint = listarchivefiles['ffilelist'][lcfi]['funame']
8593
8651
  if(len(fuprint) <= 0):
8594
- fuprint = listfoxfiles['ffilelist'][lcfi]['fuid']
8595
- fgprint = listfoxfiles['ffilelist'][lcfi]['fgname']
8652
+ fuprint = listarchivefiles['ffilelist'][lcfi]['fuid']
8653
+ fgprint = listarchivefiles['ffilelist'][lcfi]['fgname']
8596
8654
  if(len(fgprint) <= 0):
8597
- fgprint = listfoxfiles['ffilelist'][lcfi]['fgid']
8598
- VerbosePrintOut(PrintPermissionString(listfoxfiles['ffilelist'][lcfi]['fmode'], listfoxfiles['ffilelist'][lcfi]['ftype']) + " " + str(fuprint) + "/" + str(fgprint) + " " + str(
8599
- listfoxfiles['ffilelist'][lcfi]['fsize']).rjust(15) + " " + datetime.datetime.utcfromtimestamp(listfoxfiles['ffilelist'][lcfi]['fmtime']).strftime('%Y-%m-%d %H:%M') + " " + printfname)
8655
+ fgprint = listarchivefiles['ffilelist'][lcfi]['fgid']
8656
+ if(newstyle):
8657
+ VerbosePrintOut(ftype_to_str(listarchivefiles['ffilelist'][lcfi]['ftype']) + "\t" + listarchivefiles['ffilelist'][lcfi]['fcompression'] + "\t" + str(
8658
+ listarchivefiles['ffilelist'][lcfi]['fsize']).rjust(15) + "\t" + printfname)
8659
+ else:
8660
+ VerbosePrintOut(PrintPermissionString(listarchivefiles['ffilelist'][lcfi]['fmode'], listarchivefiles['ffilelist'][lcfi]['ftype']) + " " + str(fuprint) + "/" + str(fgprint) + " " + str(
8661
+ listarchivefiles['ffilelist'][lcfi]['fsize']).rjust(15) + " " + datetime.datetime.utcfromtimestamp(listarchivefiles['ffilelist'][lcfi]['fmtime']).strftime('%Y-%m-%d %H:%M') + " " + printfname)
8600
8662
  lcfi = lcfi + 1
8601
8663
  if(returnfp):
8602
- return listfoxfiles['fp']
8664
+ return listarchivefiles['fp']
8603
8665
  else:
8604
8666
  return True
8605
8667
 
8606
8668
 
8607
- def FoxFileStringListFiles(instr, seekstart=0, seekend=0, skipchecksum=False, formatspecs=__file_format_multi_dict__, seektoend=False, verbose=False, returnfp=False):
8669
+ def FoxFileStringListFiles(instr, seekstart=0, seekend=0, skipchecksum=False, formatspecs=__file_format_multi_dict__, seektoend=False, verbose=False, newstyle=False, returnfp=False):
8608
8670
  fp = BytesIO(instr)
8609
8671
  listfoxfiles = FoxFileListFiles(
8610
- instr, seekstart, seekend, skipchecksum, formatspecs, seektoend, verbose, returnfp)
8672
+ instr, seekstart, seekend, skipchecksum, formatspecs, seektoend, verbose, newstyle, returnfp)
8611
8673
  return listfoxfiles
8612
8674
 
8613
8675
 
@@ -9114,7 +9176,7 @@ if(py7zr_support):
9114
9176
  return True
9115
9177
 
9116
9178
 
9117
- def InFileListFiles(infile, verbose=False, formatspecs=__file_format_multi_dict__, seektoend=False, returnfp=False):
9179
+ def InFileListFiles(infile, verbose=False, formatspecs=__file_format_multi_dict__, seektoend=False, newstyle=False, returnfp=False):
9118
9180
  if(verbose):
9119
9181
  logging.basicConfig(format="%(message)s", stream=sys.stdout, level=logging.DEBUG)
9120
9182
  checkcompressfile = CheckCompressionSubType(infile, formatspecs, True)
@@ -9129,7 +9191,7 @@ def InFileListFiles(infile, verbose=False, formatspecs=__file_format_multi_dict_
9129
9191
  elif(py7zr_support and checkcompressfile == "7zipfile" and py7zr.is_7zfile(infile)):
9130
9192
  return SevenZipFileListFiles(infile, verbose, returnfp)
9131
9193
  elif(checkcompressfile == formatspecs['format_magic']):
9132
- return FoxFileListFiles(infile, 0, 0, False, formatspecs, seektoend, verbose, returnfp)
9194
+ return FoxFileListFiles(infile, 0, 0, False, formatspecs, seektoend, verbose, newstyle, returnfp)
9133
9195
  else:
9134
9196
  return False
9135
9197
  return False
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "PyFoxFile"
3
- version = "0.20.2"
3
+ version = "0.20.4"
4
4
  readme = "README.md"
5
5
  license = { text = "BSD-3-Clause" }
6
6
  keywords = []
File without changes
File without changes
File without changes
File without changes
File without changes