2 Commits

Author SHA1 Message Date
bc4bad678a Bump version to 1.1.2 2018-02-01 11:06:22 +01:00
ee796d0eb1 Support additional resource file attributes
Added the attributes "Resources Locked" and "Printer Driver MultiFinder
Compatible" from ResEdit, as well as more dummy constants (512-16384)
for attributes with no known meaning.
2018-02-01 11:05:25 +01:00
3 changed files with 16 additions and 2 deletions

View File

@ -139,6 +139,12 @@ __ https://archive.fo/
Changelog
---------
Version 1.1.2
`````````````
* Added support for the resource file attributes "Resources Locked" and "Printer Driver MultiFinder Compatible" from ResEdit.
* Added more dummy constants for resource attributes with unknown meaning, so that resource files containing such attributes can be loaded without errors.
Version 1.1.1
`````````````

View File

@ -22,7 +22,7 @@ __all__ = [
"open",
]
__version__ = "1.1.1"
__version__ = "1.1.2"
# Translation table to replace ASCII non-printable characters with periods.
_TRANSLATE_NONPRINTABLES = {k: "." for k in [*range(0x20), 0x7f]}
@ -79,6 +79,14 @@ STRUCT_RESOURCE_NAME_HEADER = struct.Struct(">B")
class ResourceFileAttrs(enum.Flag):
"""Resource file attribute flags. The descriptions for these flags are taken from comments on the map*Bit and map* enum constants in <CarbonCore/Resources.h>."""
mapResourcesLocked = 32768 # "Resources Locked" (undocumented, but available as a checkbox in ResEdit)
_UNKNOWN_16384 = 16384
_UNKNOWN_8192 = 8192
_UNKNOWN_4096 = 4096
_UNKNOWN_2048 = 2048
_UNKNOWN_1024 = 1024
_UNKNOWN_512 = 512
mapPrinterDriverMultiFinderCompatible = 256 # "Printer Driver MultiFinder Compatible" (undocumented, but available as a checkbox in ResEdit)
mapReadOnly = 128 # "is this file read-only?", "Resource file read-only"
mapCompact = 64 # "Is a compact necessary?", "Compact resource file"
mapChanged = 32 # "Is it necessary to write map?", "Write map out at update"

View File

@ -7,7 +7,7 @@ with open("README.rst", "r", encoding="utf-8") as f:
setuptools.setup(
name="rsrcfork",
version="1.1.1",
version="1.1.2",
description="A pure Python library for reading old Macintosh resource manager data",
long_description=long_description,
url="https://github.com/dgelessus/python-rsrcfork",