Releases: dgelessus/python-rsrcfork
v1.8.0
- Removed the old (non-subcommand-based) CLI syntax.
- Added filtering support to the
listsubcommand. - Added a
resource-infosubcommand to display technical information about resources (more detailed than what is displayed bylistandread). - Added a
raw-compress-infosubcommand to display technical header information about standalone compressed resource data. - Made the library PEP 561-compliant by adding a py.typed file.
- Fixed an incorrect
AssertionErrorwhen using the--no-decompresscommand-line options.
v1.7.0
- Added a
raw-decompresssubcommand to decompress compressed resource data stored in a standalone file rather than as a resource. - Optimized lazy loading of
Resourceobjects. Previously, resource data would be read from disk whenever aResourceobject was looked up, even if the data itself is never used. Now the resource data is only loaded once thedata(ordata_raw) attribute is accessed.- The same optimization applies to the
nameattribute, although this is unlikely to make a difference in practice. - As a result, it is no longer possible to construct
Resourceobjects without a resource file. This was previously possible, but had no practical use.
- The same optimization applies to the
- Fixed a small error in the
'dcmp' (0)decompression implementation.
v1.6.0
-
Added a new subcommand-based command-line syntax to the
rsrcforktool, similar to other CLI tools such asgitordiskutil.- This subcommand-based syntax is meant to replace the old CLI options, as the subcommand structure is easier to understand and more extensible in the future.
- Currently there are three subcommands:
listto list resources in a file,readto read/display resource data, andread-headerto read a resource file's header data. These subcommands can be used to perform all operations that were also available with the old CLI syntax. - The old CLI syntax is still supported for now, but it will be removed soon.
- The new syntax no longer supports reading CLI arguments from a file (using
@args_file.txt), abbreviating long options (e. g.--no-dinstead of--no-decompress), or the short option-finstead of--fork. If you have a need for any of these features, please open an issue.
v1.5.0
-
Added stream-based decompression methods to the
rsrcfork.compressmodule.- The internal decompressor implementations have been refactored to use streams.
- This allows for incremental decompression of compressed resource data. In practice this has no noticeable effect yet, because the main
rsrcforkAPI doesn't support incremental reading of resource data.
-
Fixed the command line tool always displaying an incorrect error "Cannot specify an explicit fork when reading from stdin" when using
-(stdin) as the input file.
v1.4.0
-
Added
lengthandlength_rawattributes toResource. These attributes are equivalent to thelenofdata`` anddata_raw` respectively, but may be faster to access.- Currently, the only optimized case is
lengthfor compressed resources, but more optimizations may be added in the future.
- Currently, the only optimized case is
-
Added a
compressed_infoattribute toResourcethat provides access to the header information of compressed resources. -
Improved handling of compressed resources when listing resource files with the command line tool.
- Metadata of compressed resources is now displayed even if no decompressor implementation is available (as long as the compressed data header can be parsed).
- Performance has been improved - the data no longer needs to be fully decompressed to get its length, this information is now read from the header.
- The
'dcmp'ID used to decompress each resource is displayed.
-
Fixed an incorrect
options.packagesinsetup.cfg, which made the library unusable except when installing from source using--editable. -
Fixed
ResourceFile.__enter__returningNone, which made it impossible to useResourceFileproperly in awithstatement. -
Fixed various minor errors reported by type checking with
mypy.
v1.3.0.post1
- Fixed an incorrect
options.packagesinsetup.cfg, which made the library unusable except when installing from source using--editable.
v1.2.0.post1
- Fixed an incorrect
options.packagesinsetup.cfg, which made the library unusable except when installing from source using--editable.
v1.3.0
- Added a
--groupcommand line option to group resources in list format by type (the default), ID, or with no grouping. - Added a
dump-textoutput format to the command line tool. This format is identical todump, but instead of a hex dump, it outputs the resource data as text. The data is decoded as MacRoman and classic Mac newlines (\r) are translated. This is useful for examining resources that contain mostly plain text. - Changed the command line tool to sort resources by type and ID, and added a
--no-sortoption to disable sorting and output resources in file order (which was the previous behavior). - Renamed the
rsrcfork.Resourceattributesresource_typeandresource_idtotypeandid, respectively. The old names have been deprecated and will be removed in the future, but are still supported for now. - Changed
--format=dumpoutput to matchhexdump -C's format - spacing has been adjusted, and multiple subsequent identical lines are collapsed into a single*.
v1.2.0
-
Added support for compressed resources.
- Compressed resource data is automatically decompressed, both in the Python API and on the command line.
- This is technically a breaking change, since in previous versions the compressed resource data was returned directly. However, this change will not affect end users negatively, unless one has already implemented custom handling for compressed resources.
- Currently, only the three standard System 7.0 compression formats (
'dcmp'IDs 0, 1, 2) are supported. Attempting to access a resource compressed in an unsupported format results in aDecompressError. - To access the raw resource data as stored in the file, without automatic decompression, use the
res.data_rawattribute (for the Python API), or the--no-decompressoption (for the command-line interface). This can be used to read the resource data in its compressed form, even if the compression format is not supported.
-
Improved automatic data/resource fork selection for files whose resource fork contains invalid data.
- This fixes reading certain system files with resource data in their data fork (such as HIToolbox.rsrc in HIToolbox.framework, or .dfont fonts) on recent macOS versions (at least macOS 10.14, possibly earlier). Although these files have no resource fork, recent macOS versions will successfully open the resource fork and return garbage data for it. This behavior is now detected and handled by using the data fork instead.
-
Replaced the
rsrcforkparameter ofrsrcfork.open/ResourceFork.openwith a newforkparameter.forkaccepts string values (like the command line--forkoption) rather thanrsrcfork's hard to understandNone/True/False.- The old
rsrcforkparameter has been deprecated and will be removed in the future, but for now it still works as before.
- The old
-
Added an explanatory message when a resource filter on the command line doesn't match any resources in the resource file. Previously there would either be no output or a confusing error, depending on the selected
--format. -
Changed resource type codes and names to be displayed in MacRoman instead of escaping all non-ASCII characters.
-
Cleaned up the resource descriptions in listings and dumps to improve readability. Previously they included some redundant or unnecessary information - for example, each resource with no attributes set would be explicitly marked as "no attributes".
-
Unified the formats of resource descriptions in listings and dumps, which were previously slightly different from each other.
-
Improved error messages when attempting to read multiple resources using
--format=hexor--format=raw. -
Fixed reading from non-seekable streams not working for some resource files.
-
Removed the
allow_seekparameter ofResourceFork.__init__and the--read-modecommand line option. They are no longer necessary, and were already practically useless before due to non-seekable stream reading being broken.
v1.1.3.post1
- Fixed a formatting error in the README.rst to allow upload to PyPI.