PyNeoFile 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.
- {pyneofile-0.20.2.dist-info → pyneofile-0.20.6.dist-info}/METADATA +1 -1
- pyneofile-0.20.6.dist-info/RECORD +8 -0
- pyneofile.py +26 -5
- pyneofile-0.20.2.dist-info/RECORD +0 -8
- {pyneofile-0.20.2.data → pyneofile-0.20.6.data}/scripts/neofile.py +0 -0
- {pyneofile-0.20.2.dist-info → pyneofile-0.20.6.dist-info}/WHEEL +0 -0
- {pyneofile-0.20.2.dist-info → pyneofile-0.20.6.dist-info}/licenses/LICENSE +0 -0
- {pyneofile-0.20.2.dist-info → pyneofile-0.20.6.dist-info}/top_level.txt +0 -0
- {pyneofile-0.20.2.dist-info → pyneofile-0.20.6.dist-info}/zip-safe +0 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
pyneofile.py,sha256=t3WIwoiBVK31AGfQgbuXfDwkgDKifVt1n-S6ZmE1O2o,59523
|
|
2
|
+
pyneofile-0.20.6.data/scripts/neofile.py,sha256=X0kZrcKJsjo4K5Rp_IEpFMjQ-lu6OAhX2wDSJJPbvT4,5481
|
|
3
|
+
pyneofile-0.20.6.dist-info/licenses/LICENSE,sha256=G22gXt50FuCPBLneMraT2Q6-G5pAjFEqS4q9xP-DKWs,1500
|
|
4
|
+
pyneofile-0.20.6.dist-info/METADATA,sha256=Uwt_R8uuvCOEY6dZXEeKFlmJhpRG0dED16uDejPK3nI,723
|
|
5
|
+
pyneofile-0.20.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
6
|
+
pyneofile-0.20.6.dist-info/top_level.txt,sha256=_-bBDCun16INq_ibkGkMIpnjvoBZ3KbKcgR6meoPsb8,10
|
|
7
|
+
pyneofile-0.20.6.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
8
|
+
pyneofile-0.20.6.dist-info/RECORD,,
|
pyneofile.py
CHANGED
|
@@ -60,12 +60,12 @@ __use_ini_name__ = "neofile.ini"
|
|
|
60
60
|
__program_name__ = "PyNeoFile"
|
|
61
61
|
__project__ = __program_name__
|
|
62
62
|
__project_url__ = "https://github.com/GameMaker2k/PyNeoFile"
|
|
63
|
-
__version_info__ = (0, 20,
|
|
64
|
-
__version_date_info__ = (2025,
|
|
63
|
+
__version_info__ = (0, 20, 6, "RC 1", 1)
|
|
64
|
+
__version_date_info__ = (2025, 9, 15, "RC 1", 1)
|
|
65
65
|
__version_date__ = str(__version_date_info__[0]) + "." + str(
|
|
66
66
|
__version_date_info__[1]).zfill(2) + "." + str(__version_date_info__[2]).zfill(2)
|
|
67
67
|
__revision__ = __version_info__[3]
|
|
68
|
-
__revision_id__ = "$Id:
|
|
68
|
+
__revision_id__ = "$Id: b79242bccfb046b0c29352e99b75e161278b26e1 $"
|
|
69
69
|
if(__version_info__[4] is not None):
|
|
70
70
|
__version_date_plusrc__ = __version_date__ + \
|
|
71
71
|
"-" + str(__version_date_info__[4])
|
|
@@ -93,6 +93,19 @@ def _normalize_algo(algo):
|
|
|
93
93
|
return 'auto'
|
|
94
94
|
return a
|
|
95
95
|
|
|
96
|
+
def _normalize_ver_digits(ver_text):
|
|
97
|
+
"""
|
|
98
|
+
Make the on-disk version match Archive's strict header check:
|
|
99
|
+
- remove dots
|
|
100
|
+
- strip leading zeros by int() cast when numeric
|
|
101
|
+
Falls back to the raw digits if not purely numeric.
|
|
102
|
+
"""
|
|
103
|
+
raw = ver_text.replace(".", "")
|
|
104
|
+
try:
|
|
105
|
+
return str(int(raw)) # "001" -> "1"
|
|
106
|
+
except ValueError:
|
|
107
|
+
return raw # keep as-is if not numeric
|
|
108
|
+
|
|
96
109
|
def _compress_bytes(data, algo='none', level=None):
|
|
97
110
|
"""Return (stored_bytes, used_algo)."""
|
|
98
111
|
algo = _normalize_algo(algo)
|
|
@@ -440,7 +453,7 @@ def _load_formatspecs_from_ini(paths=None, prefer_section=None):
|
|
|
440
453
|
ext = _get('extension', '.neo')
|
|
441
454
|
|
|
442
455
|
delim_real = _decode_delim_escape(delim)
|
|
443
|
-
ver_digits = _ver_digits(ver)
|
|
456
|
+
ver_digits = _normalize_ver_digits(_ver_digits(ver))
|
|
444
457
|
|
|
445
458
|
spec = {
|
|
446
459
|
'format_magic': magic,
|
|
@@ -511,7 +524,7 @@ def _checksum(data, cstype, text=False):
|
|
|
511
524
|
def _write_global_header(fp, numfiles, encoding, checksumtype, extradata, formatspecs):
|
|
512
525
|
delim = formatspecs['format_delimiter']
|
|
513
526
|
magic = formatspecs['format_magic']
|
|
514
|
-
ver_digits = _ver_digits(formatspecs.get('format_ver','001'))
|
|
527
|
+
ver_digits = _normalize_ver_digits(_ver_digits(formatspecs.get('format_ver','001')))
|
|
515
528
|
|
|
516
529
|
# extras blob: count + items
|
|
517
530
|
if isinstance(extradata, dict) and extradata:
|
|
@@ -682,6 +695,14 @@ def _parse_global_header(fp, formatspecs, skipchecksum=False):
|
|
|
682
695
|
extras.append(_read_cstring(fp, delim).decode('UTF-8'))
|
|
683
696
|
checksumtype = _read_cstring(fp, delim).decode('UTF-8')
|
|
684
697
|
_header_cs = _read_cstring(fp, delim).decode('UTF-8')
|
|
698
|
+
# --- Strict check for magic+version against formatspecs ---
|
|
699
|
+
exp_magic = formatspecs.get('format_magic', '')
|
|
700
|
+
exp_ver = _normalize_ver_digits(_ver_digits(formatspecs.get('format_ver', '001')))
|
|
701
|
+
expected_magicver = exp_magic + exp_ver
|
|
702
|
+
if str(magicver) != str(expected_magicver):
|
|
703
|
+
raise ValueError(
|
|
704
|
+
"Bad archive header: magic/version mismatch (got {!r}, expected {!r})".format(magicver, expected_magicver)
|
|
705
|
+
)
|
|
685
706
|
return {'fencoding': fencoding, 'fnumfiles': fnumfiles, 'fostype': fostype,
|
|
686
707
|
'fextradata': extras, 'fchecksumtype': checksumtype,
|
|
687
708
|
'ffilelist': [], 'fformatspecs': formatspecs}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
pyneofile.py,sha256=ZBbAKGOGvbsIEWphO6FAk5Rb9JGwrmD7u7mlt3EalXw,58608
|
|
2
|
-
pyneofile-0.20.2.data/scripts/neofile.py,sha256=X0kZrcKJsjo4K5Rp_IEpFMjQ-lu6OAhX2wDSJJPbvT4,5481
|
|
3
|
-
pyneofile-0.20.2.dist-info/licenses/LICENSE,sha256=G22gXt50FuCPBLneMraT2Q6-G5pAjFEqS4q9xP-DKWs,1500
|
|
4
|
-
pyneofile-0.20.2.dist-info/METADATA,sha256=H8v-NOqzMM-9Fp_CND24mzQhm5nsPJY8g3gvdBFsZD4,723
|
|
5
|
-
pyneofile-0.20.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
6
|
-
pyneofile-0.20.2.dist-info/top_level.txt,sha256=_-bBDCun16INq_ibkGkMIpnjvoBZ3KbKcgR6meoPsb8,10
|
|
7
|
-
pyneofile-0.20.2.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
8
|
-
pyneofile-0.20.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|