PyCatFile 0.20.2__py3-none-any.whl → 0.20.6__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.
- {pycatfile-0.20.2.data → pycatfile-0.20.6.data}/scripts/catfile.py +8 -8
- {pycatfile-0.20.2.dist-info → pycatfile-0.20.6.dist-info}/METADATA +1 -1
- pycatfile-0.20.6.dist-info/RECORD +9 -0
- pycatfile.py +102 -40
- pycatfile-0.20.2.dist-info/RECORD +0 -9
- {pycatfile-0.20.2.data → pycatfile-0.20.6.data}/scripts/neocatfile.py +0 -0
- {pycatfile-0.20.2.dist-info → pycatfile-0.20.6.dist-info}/WHEEL +0 -0
- {pycatfile-0.20.2.dist-info → pycatfile-0.20.6.dist-info}/licenses/LICENSE +0 -0
- {pycatfile-0.20.2.dist-info → pycatfile-0.20.6.dist-info}/top_level.txt +0 -0
- {pycatfile-0.20.2.dist-info → pycatfile-0.20.6.dist-info}/zip-safe +0 -0
|
@@ -172,7 +172,7 @@ if active_action:
|
|
|
172
172
|
if getargs.convert:
|
|
173
173
|
checkcompressfile = pycatfile.CheckCompressionSubType(
|
|
174
174
|
input_file, fnamedict, True)
|
|
175
|
-
if((IsNestedDict(fnamedict) and
|
|
175
|
+
if((IsNestedDict(fnamedict) and checkcompressfile in fnamedict) or (IsSingleDict(fnamedict) and checkcompressfile==fnamedict['format_magic'])):
|
|
176
176
|
tmpout = pycatfile.RePackCatFile(input_file, getargs.output, getargs.compression, getargs.wholefile, getargs.level, pycatfile.compressionlistalt, False, 0, 0, [getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum], getargs.skipchecksum, [], {}, fnamedict, getargs.verbose, False)
|
|
177
177
|
else:
|
|
178
178
|
tmpout = pycatfile.PackCatFileFromInFile(
|
|
@@ -185,7 +185,7 @@ if active_action:
|
|
|
185
185
|
if getargs.convert:
|
|
186
186
|
checkcompressfile = pycatfile.CheckCompressionSubType(
|
|
187
187
|
input_file, fnamedict, True)
|
|
188
|
-
if((IsNestedDict(fnamedict) and
|
|
188
|
+
if((IsNestedDict(fnamedict) and checkcompressfile in fnamedict) or (IsSingleDict(fnamedict) and checkcompressfile==fnamedict['format_magic'])):
|
|
189
189
|
pycatfile.RePackCatFile(input_file, getargs.output, getargs.compression, getargs.wholefile, getargs.level, pycatfile.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 = pycatfile.CheckCompressionSubType(
|
|
201
201
|
input_file, fnamedict, True)
|
|
202
202
|
tempout = BytesIO()
|
|
203
|
-
if((IsNestedDict(fnamedict) and
|
|
203
|
+
if((IsNestedDict(fnamedict) and checkcompressfile in fnamedict) or (IsSingleDict(fnamedict) and checkcompressfile==fnamedict['format_magic'])):
|
|
204
204
|
tmpout = pycatfile.RePackCatFile(input_file, tempout, getargs.compression, getargs.wholefile, getargs.level, pycatfile.compressionlistalt, False, 0, 0, [getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum], getargs.skipchecksum, [], {}, fnamedict, False, False)
|
|
205
205
|
else:
|
|
206
206
|
tmpout = pycatfile.PackCatFileFromInFile(
|
|
@@ -214,20 +214,20 @@ if active_action:
|
|
|
214
214
|
if getargs.convert:
|
|
215
215
|
checkcompressfile = pycatfile.CheckCompressionSubType(
|
|
216
216
|
input_file, fnamedict, True)
|
|
217
|
-
if((IsNestedDict(fnamedict) and
|
|
218
|
-
tmpout = pycatfile.CatFileListFiles(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 = pycatfile.CatFileListFiles(input_file, "auto", 0, 0, getargs.skipchecksum, fnamedict, False, getargs.verbose, False, False)
|
|
219
219
|
else:
|
|
220
|
-
tmpout = pycatfile.InFileListFiles(input_file, getargs.verbose, fnamedict, False, False)
|
|
220
|
+
tmpout = pycatfile.InFileListFiles(input_file, getargs.verbose, fnamedict, False, False, False)
|
|
221
221
|
if(not tmpout):
|
|
222
222
|
sys.exit(1)
|
|
223
223
|
else:
|
|
224
|
-
pycatfile.CatFileListFiles(input_file, "auto", 0, 0, getargs.skipchecksum, fnamedict, False, getargs.verbose, False)
|
|
224
|
+
pycatfile.CatFileListFiles(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 = pycatfile.CheckCompressionSubType(
|
|
228
228
|
input_file, fnamedict, True)
|
|
229
229
|
tempout = BytesIO()
|
|
230
|
-
if((IsNestedDict(fnamedict) and
|
|
230
|
+
if((IsNestedDict(fnamedict) and checkcompressfile in fnamedict) or (IsSingleDict(fnamedict) and checkcompressfile==fnamedict['format_magic'])):
|
|
231
231
|
tmpout = pycatfile.RePackCatFile(input_file, tempout, getargs.compression, getargs.wholefile, getargs.level, pycatfile.compressionlistalt, False, 0, 0, [getargs.checksum, getargs.checksum, getargs.checksum, getargs.checksum], getargs.skipchecksum, [], {}, fnamedict, False, False, False)
|
|
232
232
|
else:
|
|
233
233
|
tmpout = pycatfile.PackCatFileFromInFile(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: PyCatFile
|
|
3
|
-
Version: 0.20.
|
|
3
|
+
Version: 0.20.6
|
|
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
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
pycatfile.py,sha256=BME9rCYJwAQ3wcJc524FyXzmyhI3vsZ5eOVCKFrRIAc,436155
|
|
2
|
+
pycatfile-0.20.6.data/scripts/catfile.py,sha256=eJYvkqx5F5V1CKnxQyLQUMvIBOUZYWF4MAlpvqsjBPc,14020
|
|
3
|
+
pycatfile-0.20.6.data/scripts/neocatfile.py,sha256=YIehBXLtZdFN6_3vrCM3qw1vfAiqJZJWdjOGFStg3D4,7148
|
|
4
|
+
pycatfile-0.20.6.dist-info/licenses/LICENSE,sha256=WM1VWxTUVrQbvEa-LC7cKTaBHXiqSTyYPoJvsZSbd7E,1513
|
|
5
|
+
pycatfile-0.20.6.dist-info/METADATA,sha256=ULS5ik2eIzbEGbkHXaT5Whjr9FuB7Mpx-kIVb1nBhxM,802
|
|
6
|
+
pycatfile-0.20.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
7
|
+
pycatfile-0.20.6.dist-info/top_level.txt,sha256=ZnSwEHU_60RLIvmFhsATaAaEYjErDQgUymWwoXZ724c,10
|
|
8
|
+
pycatfile-0.20.6.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
9
|
+
pycatfile-0.20.6.dist-info/RECORD,,
|
pycatfile.py
CHANGED
|
@@ -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: pycatfile.py - Last Update:
|
|
17
|
+
$FileInfo: pycatfile.py - Last Update: 9/15/2025 Ver. 0.20.6 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 ==
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
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
|
-
|
|
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__ = "CatFile"
|
|
292
330
|
__include_defaults__ = True
|
|
@@ -353,12 +391,12 @@ __file_format_extension__ = __file_format_multi_dict__[__file_format_default__][
|
|
|
353
391
|
__file_format_dict__ = __file_format_multi_dict__[__file_format_default__]
|
|
354
392
|
__project__ = __program_name__
|
|
355
393
|
__project_url__ = "https://github.com/GameMaker2k/PyCatFile"
|
|
356
|
-
__version_info__ = (0, 20,
|
|
357
|
-
__version_date_info__ = (2025,
|
|
394
|
+
__version_info__ = (0, 20, 6, "RC 1", 1)
|
|
395
|
+
__version_date_info__ = (2025, 9, 15, "RC 1", 1)
|
|
358
396
|
__version_date__ = str(__version_date_info__[0]) + "." + str(
|
|
359
397
|
__version_date_info__[1]).zfill(2) + "." + str(__version_date_info__[2]).zfill(2)
|
|
360
398
|
__revision__ = __version_info__[3]
|
|
361
|
-
__revision_id__ = "$Id:
|
|
399
|
+
__revision_id__ = "$Id: 1edd4c88c72412c509137eaccaddedf744e5f022 $"
|
|
362
400
|
if(__version_info__[4] is not None):
|
|
363
401
|
__version_date_plusrc__ = __version_date__ + \
|
|
364
402
|
"-" + str(__version_date_info__[4])
|
|
@@ -370,13 +408,15 @@ if(__version_info__[3] is not None):
|
|
|
370
408
|
if(__version_info__[3] is None):
|
|
371
409
|
__version__ = str(__version_info__[0]) + "." + str(__version_info__[1]) + "." + str(__version_info__[2])
|
|
372
410
|
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
PyBitness = "64"
|
|
378
|
-
|
|
379
|
-
|
|
411
|
+
# Robust bitness detection
|
|
412
|
+
# Works on Py2 & Py3, all platforms
|
|
413
|
+
try:
|
|
414
|
+
import struct
|
|
415
|
+
PyBitness = "64" if struct.calcsize("P") * 8 == 64 else "32"
|
|
416
|
+
except Exception:
|
|
417
|
+
# conservative fallback
|
|
418
|
+
m = platform.machine() or ""
|
|
419
|
+
PyBitness = "64" if m.endswith("64") else "32"
|
|
380
420
|
|
|
381
421
|
geturls_ua_pyfile_python = "Mozilla/5.0 (compatible; {proname}/{prover}; +{prourl})".format(
|
|
382
422
|
proname=__project__, prover=__version__, prourl=__project_url__)
|
|
@@ -389,9 +429,9 @@ geturls_ua_pyfile_python_alt = "Mozilla/5.0 ({osver}; {archtype}; +{prourl}) {py
|
|
|
389
429
|
geturls_ua_googlebot_google = "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
|
|
390
430
|
geturls_ua_googlebot_google_old = "Googlebot/2.1 (+http://www.google.com/bot.html)"
|
|
391
431
|
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",
|
|
392
|
-
'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)}
|
|
432
|
+
'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)}
|
|
393
433
|
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",
|
|
394
|
-
'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)}
|
|
434
|
+
'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)}
|
|
395
435
|
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",
|
|
396
436
|
'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"}
|
|
397
437
|
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",
|
|
@@ -548,16 +588,20 @@ def VerbosePrintOutReturn(dbgtxt, outtype="log", dbgenable=True, dgblevel=20):
|
|
|
548
588
|
|
|
549
589
|
def RemoveWindowsPath(dpath):
|
|
550
590
|
"""
|
|
551
|
-
|
|
591
|
+
Normalize a path by converting backslashes to forward slashes
|
|
592
|
+
and stripping a trailing slash.
|
|
552
593
|
"""
|
|
553
|
-
if dpath
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
594
|
+
if not dpath:
|
|
595
|
+
return ""
|
|
596
|
+
# Accept bytes and decode safely
|
|
597
|
+
if isinstance(dpath, (bytes, bytearray)):
|
|
598
|
+
dpath = dpath.decode("utf-8", "ignore")
|
|
599
|
+
dpath = dpath.replace("\\", "/")
|
|
600
|
+
# Collapse multiple slashes except for protocol prefixes like "s3://"
|
|
601
|
+
if "://" not in dpath:
|
|
602
|
+
while "//" in dpath:
|
|
603
|
+
dpath = dpath.replace("//", "/")
|
|
604
|
+
return dpath.rstrip("/")
|
|
561
605
|
|
|
562
606
|
|
|
563
607
|
def NormalizeRelativePath(inpath):
|
|
@@ -8564,8 +8608,22 @@ def UnPackCatFileString(instr, outdir=None, followlink=False, seekstart=0, seeke
|
|
|
8564
8608
|
listarchivefiles = UnPackCatFile(fp, outdir, followlink, seekstart, seekend, skipchecksum, formatspecs, seektoend, verbose, returnfp)
|
|
8565
8609
|
return listarchivefiles
|
|
8566
8610
|
|
|
8611
|
+
def ftype_to_str(ftype):
|
|
8612
|
+
mapping = {
|
|
8613
|
+
0: "file", # file
|
|
8614
|
+
1: "link", # link
|
|
8615
|
+
2: "sym", # symlink
|
|
8616
|
+
3: "cdev", # char device
|
|
8617
|
+
4: "bdev", # block device
|
|
8618
|
+
5: "dir", # directory
|
|
8619
|
+
6: "fifo", # fifo
|
|
8620
|
+
12: "spar", # sparse
|
|
8621
|
+
14: "dev", # generic device
|
|
8622
|
+
}
|
|
8623
|
+
# Default to "file" if unknown
|
|
8624
|
+
return mapping.get(ftype, "file")
|
|
8567
8625
|
|
|
8568
|
-
def CatFileListFiles(infile, fmttype="auto", seekstart=0, seekend=0, skipchecksum=False, formatspecs=__file_format_multi_dict__, seektoend=False, verbose=False, returnfp=False):
|
|
8626
|
+
def CatFileListFiles(infile, fmttype="auto", seekstart=0, seekend=0, skipchecksum=False, formatspecs=__file_format_multi_dict__, seektoend=False, verbose=False, newstyle=False, returnfp=False):
|
|
8569
8627
|
if(verbose):
|
|
8570
8628
|
logging.basicConfig(format="%(message)s", stream=sys.stdout, level=logging.DEBUG)
|
|
8571
8629
|
if(isinstance(infile, dict)):
|
|
@@ -8573,7 +8631,7 @@ def CatFileListFiles(infile, fmttype="auto", seekstart=0, seekend=0, skipchecksu
|
|
|
8573
8631
|
else:
|
|
8574
8632
|
if(infile != "-" and not hasattr(infile, "read") and not hasattr(infile, "write") and not (sys.version_info[0] >= 3 and isinstance(infile, bytes))):
|
|
8575
8633
|
infile = RemoveWindowsPath(infile)
|
|
8576
|
-
listarchivefiles =
|
|
8634
|
+
listarchivefiles = ArchiveFileToArray(infile, fmttype, seekstart, seekend, True, False, False, skipchecksum, formatspecs, seektoend, returnfp)
|
|
8577
8635
|
if(not listarchivefiles):
|
|
8578
8636
|
return False
|
|
8579
8637
|
lenlist = len(listarchivefiles['ffilelist'])
|
|
@@ -8605,7 +8663,11 @@ def CatFileListFiles(infile, fmttype="auto", seekstart=0, seekend=0, skipchecksu
|
|
|
8605
8663
|
fgprint = listarchivefiles['ffilelist'][lcfi]['fgname']
|
|
8606
8664
|
if(len(fgprint) <= 0):
|
|
8607
8665
|
fgprint = listarchivefiles['ffilelist'][lcfi]['fgid']
|
|
8608
|
-
|
|
8666
|
+
if(newstyle):
|
|
8667
|
+
VerbosePrintOut(ftype_to_str(listarchivefiles['ffilelist'][lcfi]['ftype']) + "\t" + listarchivefiles['ffilelist'][lcfi]['fcompression'] + "\t" + str(
|
|
8668
|
+
listarchivefiles['ffilelist'][lcfi]['fsize']).rjust(15) + "\t" + printfname)
|
|
8669
|
+
else:
|
|
8670
|
+
VerbosePrintOut(PrintPermissionString(listarchivefiles['ffilelist'][lcfi]['fmode'], listarchivefiles['ffilelist'][lcfi]['ftype']) + " " + str(fuprint) + "/" + str(fgprint) + " " + str(
|
|
8609
8671
|
listarchivefiles['ffilelist'][lcfi]['fsize']).rjust(15) + " " + datetime.datetime.utcfromtimestamp(listarchivefiles['ffilelist'][lcfi]['fmtime']).strftime('%Y-%m-%d %H:%M') + " " + printfname)
|
|
8610
8672
|
lcfi = lcfi + 1
|
|
8611
8673
|
if(returnfp):
|
|
@@ -8614,10 +8676,10 @@ def CatFileListFiles(infile, fmttype="auto", seekstart=0, seekend=0, skipchecksu
|
|
|
8614
8676
|
return True
|
|
8615
8677
|
|
|
8616
8678
|
|
|
8617
|
-
def CatFileStringListFiles(instr, seekstart=0, seekend=0, skipchecksum=False, formatspecs=__file_format_multi_dict__, seektoend=False, verbose=False, returnfp=False):
|
|
8679
|
+
def CatFileStringListFiles(instr, seekstart=0, seekend=0, skipchecksum=False, formatspecs=__file_format_multi_dict__, seektoend=False, verbose=False, newstyle=False, returnfp=False):
|
|
8618
8680
|
fp = BytesIO(instr)
|
|
8619
8681
|
listarchivefiles = CatFileListFiles(
|
|
8620
|
-
instr, seekstart, seekend, skipchecksum, formatspecs, seektoend, verbose, returnfp)
|
|
8682
|
+
instr, seekstart, seekend, skipchecksum, formatspecs, seektoend, verbose, newstyle, returnfp)
|
|
8621
8683
|
return listarchivefiles
|
|
8622
8684
|
|
|
8623
8685
|
|
|
@@ -9124,7 +9186,7 @@ if(py7zr_support):
|
|
|
9124
9186
|
return True
|
|
9125
9187
|
|
|
9126
9188
|
|
|
9127
|
-
def InFileListFiles(infile, verbose=False, formatspecs=__file_format_multi_dict__, seektoend=False, returnfp=False):
|
|
9189
|
+
def InFileListFiles(infile, verbose=False, formatspecs=__file_format_multi_dict__, seektoend=False, newstyle=False, returnfp=False):
|
|
9128
9190
|
if(verbose):
|
|
9129
9191
|
logging.basicConfig(format="%(message)s", stream=sys.stdout, level=logging.DEBUG)
|
|
9130
9192
|
checkcompressfile = CheckCompressionSubType(infile, formatspecs, True)
|
|
@@ -9139,7 +9201,7 @@ def InFileListFiles(infile, verbose=False, formatspecs=__file_format_multi_dict_
|
|
|
9139
9201
|
elif(py7zr_support and checkcompressfile == "7zipfile" and py7zr.is_7zfile(infile)):
|
|
9140
9202
|
return SevenZipFileListFiles(infile, verbose, returnfp)
|
|
9141
9203
|
elif(checkcompressfile == formatspecs['format_magic']):
|
|
9142
|
-
return CatFileListFiles(infile, 0, 0, False, formatspecs, seektoend, verbose, returnfp)
|
|
9204
|
+
return CatFileListFiles(infile, 0, 0, False, formatspecs, seektoend, verbose, newstyle, returnfp)
|
|
9143
9205
|
else:
|
|
9144
9206
|
return False
|
|
9145
9207
|
return False
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
pycatfile.py,sha256=RFbV-AFSIBDh45YoNxzIAqEVFddpGrVYiHrrIVqx1AY,433890
|
|
2
|
-
pycatfile-0.20.2.data/scripts/catfile.py,sha256=R0P_IjRY-d9-Aa1wq8anLBofPD3GPMfrOM3808EimQg,13959
|
|
3
|
-
pycatfile-0.20.2.data/scripts/neocatfile.py,sha256=YIehBXLtZdFN6_3vrCM3qw1vfAiqJZJWdjOGFStg3D4,7148
|
|
4
|
-
pycatfile-0.20.2.dist-info/licenses/LICENSE,sha256=WM1VWxTUVrQbvEa-LC7cKTaBHXiqSTyYPoJvsZSbd7E,1513
|
|
5
|
-
pycatfile-0.20.2.dist-info/METADATA,sha256=UiIAw23L604iJK5JK2McOCT_Co0_4Juq1WxWAkRTsR0,802
|
|
6
|
-
pycatfile-0.20.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
7
|
-
pycatfile-0.20.2.dist-info/top_level.txt,sha256=ZnSwEHU_60RLIvmFhsATaAaEYjErDQgUymWwoXZ724c,10
|
|
8
|
-
pycatfile-0.20.2.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
9
|
-
pycatfile-0.20.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|