Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-icoextract for openSUSE:Factory checked in at 2025-02-04 18:14:18 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-icoextract (Old) and /work/SRC/openSUSE:Factory/.python-icoextract.new.2316 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-icoextract" Tue Feb 4 18:14:18 2025 rev:4 rq:1243139 version:0.1.5 Changes: -------- --- /work/SRC/openSUSE:Factory/python-icoextract/python-icoextract.changes 2022-09-29 18:14:58.303444747 +0200 +++ /work/SRC/openSUSE:Factory/.python-icoextract.new.2316/python-icoextract.changes 2025-02-04 18:15:20.414486936 +0100 @@ -1,0 +2,11 @@ +Tue Feb 4 11:57:22 UTC 2025 - John Paul Adrian Glaubitz <adrian.glaub...@suse.com> + +- Update to 0.1.5 + * Add `application/vnd.microsoft.portable-executable` to supported MIME types + * Bump minimum supported Python version to 3.8 + * Add pdoc3 config, for autogenerated API docs +- Switch package to modern Python Stack on SLE-15 + * Use Python 3.11 on SLE-15 by default + * Drop support for older Python versions + +------------------------------------------------------------------- Old: ---- icoextract-0.1.4.tar.gz New: ---- icoextract-0.1.5.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-icoextract.spec ++++++ --- /var/tmp/diff_new_pack.ULnoQ8/_old 2025-02-04 18:15:21.550533806 +0100 +++ /var/tmp/diff_new_pack.ULnoQ8/_new 2025-02-04 18:15:21.562534301 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-icoextract # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2025 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,10 +16,9 @@ # -%{?!python_module:%define python_module() python-%{**} python3-%{**}} -%define skip_python2 1 +%{?sle15_python_module_pythons} Name: python-icoextract -Version: 0.1.4 +Version: 0.1.5 Release: 0 Summary: Extract icons from Windows PE files (.exe/.dll) License: MIT @@ -43,7 +42,7 @@ BuildRequires: python-rpm-macros Requires: python-pefile Requires(post): update-alternatives -Requires(postun):update-alternatives +Requires(postun): update-alternatives Suggests: python-Pillow BuildArch: noarch %python_subpackages ++++++ icoextract-0.1.4.tar.gz -> icoextract-0.1.5.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/icoextract-0.1.4/.drone.jsonnet new/icoextract-0.1.5/.drone.jsonnet --- old/icoextract-0.1.4/.drone.jsonnet 2022-08-08 06:24:57.000000000 +0200 +++ new/icoextract-0.1.5/.drone.jsonnet 2024-04-28 21:56:52.000000000 +0200 @@ -16,7 +16,7 @@ std.prune([ { name: "install", - image: "python:" + version + "-bullseye", + image: "python:" + version + "-bookworm", commands: [ "pip install -r requirements.txt", "python setup.py install" @@ -25,7 +25,7 @@ }, { name: "test", - image: "python:" + version + "-bullseye", + image: "python:" + version + "-bookworm", commands: [ "apt-get update", "apt-get install -yy imagemagick gcc-mingw-w64 make", @@ -47,7 +47,33 @@ when: { event: ["tag"], } - } + }, + + if do_deploy then { + name: "doc", + image: "python:" + version + "-bookworm", + commands: [ + "pip install pdoc3", + "pdoc --html icoextract --template-dir pdoc/templates", + "ln html/icoextract/index.html icoextract.html" + ], + volumes: volumes(), + }, + + if do_deploy then { + name: "doc_upload", + image: "techknowlogick/drone-b2", + settings: { + bucket: "jlu5-ci-doc", + account: {from_secret: "b2_account"}, + key: {from_secret: "b2_key"}, + source: "icoextract.html", + target: "/", + }, + when: { + branch: ["master", "ci-*"], + }, + }, ]), volumes: [ { @@ -58,9 +84,9 @@ }; [ - test_with("3.6"), - test_with("3.7"), test_with("3.8"), test_with("3.9"), - test_with("3.10", do_deploy=true) + test_with("3.10"), + test_with("3.11"), + test_with("3.12", do_deploy=true), ] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/icoextract-0.1.4/.gitignore new/icoextract-0.1.5/.gitignore --- old/icoextract-0.1.4/.gitignore 2022-08-08 06:24:57.000000000 +0200 +++ new/icoextract-0.1.5/.gitignore 2024-04-28 21:56:52.000000000 +0200 @@ -123,3 +123,6 @@ # Pyre type checker .pyre/ + +# Autogenerated docs +html/ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/icoextract-0.1.4/CHANGELOG.md new/icoextract-0.1.5/CHANGELOG.md --- old/icoextract-0.1.4/CHANGELOG.md 2022-08-08 06:24:57.000000000 +0200 +++ new/icoextract-0.1.5/CHANGELOG.md 2024-04-28 21:56:52.000000000 +0200 @@ -1,5 +1,11 @@ # Changelog +## icoextract 0.1.5 (2024-04-28) + +- Add `application/vnd.microsoft.portable-executable` to supported MIME types +- Bump minimum supported Python version to 3.8 +- Add pdoc3 config, for autogenerated API docs + ## icoextract 0.1.4 (2022-08-08) - IconExtractor: support raw bytes as input, in addition to a filename diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/icoextract-0.1.4/LIB-USAGE.md new/icoextract-0.1.5/LIB-USAGE.md --- old/icoextract-0.1.4/LIB-USAGE.md 1970-01-01 01:00:00.000000000 +0100 +++ new/icoextract-0.1.5/LIB-USAGE.md 2024-04-28 21:56:52.000000000 +0200 @@ -0,0 +1,25 @@ +For help on icoextract's frontend scripts, see `icoextract --help` and `icolist --help`. + +## Using icoextract as a library + +```python +from icoextract import IconExtractor, IconExtractorError + +try: + extractor = IconExtractor('/path/to/your.exe') + + # Export the first group icon to a .ico file + extractor.export_icon('/path/to/your.ico', num=0) + + # Or save the .ico to a buffer, to pass it into another library + data = extractor.get_icon(num=0) + + from PIL import Image + im = Image.open(data) + # ... manipulate a copy of the icon directly + +except IconExtractorError: + # No icons available, or the resource is malformed + pass + +``` diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/icoextract-0.1.4/README.md new/icoextract-0.1.5/README.md --- old/icoextract-0.1.4/README.md 2022-08-08 06:24:57.000000000 +0200 +++ new/icoextract-0.1.5/README.md 2024-04-28 21:56:52.000000000 +0200 @@ -2,7 +2,7 @@ [](https://drone.overdrivenetworks.com/jlu5/icoextract) -**icoextract** is an icon extractor for Windows PE files (.exe/.dll), written in Python. It also includes a thumbnailer script (`exe-thumbnailer`) for Linux desktops. +**icoextract** is an icon extractor for Windows PE files (.exe/.dll/.mun), written in Python. It also includes a thumbnailer script (`exe-thumbnailer`) for Linux desktops. This project is inspired by [extract-icon-py](https://github.com/firodj/extract-icon-py), [icoutils](https://www.nongnu.org/icoutils/), and others. @@ -23,19 +23,21 @@ - `/usr/local/share/thumbnailers/` if you installed `icoextract` globally - `~/.local/share/thumbnailers` if you installed `icoextract` for your user only -The thumbnailer should work with any file manager that implements the [Freedesktop Thumbnails Standard](https://specifications.freedesktop.org/thumbnail-spec/thumbnail-spec-latest.html): this includes Nautilus, Caja, Nemo, Thunar (when Tumbler is installed), and PCManFM. KDE / Dolphin uses a different architecture and is not supported here. +The thumbnailer should work with any file manager that implements the [Freedesktop Thumbnails Standard](https://specifications.freedesktop.org/thumbnail-spec/thumbnail-spec-latest.html): this includes Nautilus, Caja, Nemo, Thunar (when Tumbler is installed), and PCManFM. KDE / Dolphin uses a different architecture and is *not* supported here. ### Distribution packages -icoextract is packaged in these repositories: +You can install icoextract from any of these distribution repositories: -- Arch Linux AUR: [icoextract](https://aur.archlinux.org/packages/icoextract) -- Debian (11+): [icoextract](https://packages.debian.org/icoextract) -- Ubuntu (21.10+): [icoextract](https://packages.ubuntu.com/icoextract) +[](https://repology.org/project/icoextract/versions) ## Usage -icoextract ships `icoextract` and `icolist` scripts to extract and list icon resources in an executable: +icoextract ships `icoextract` and `icolist` scripts to extract and list icon resources inside a file. + +**Note**: recent versions of Windows (Windows 10 1903+) have moved icons from system libraries (`shell32.dll`, etc.) into a new [`C:\Windows\SystemResources`](https://superuser.com/questions/1480268/) folder. icoextract can extract these `.mun` files natively, but the `.dll`s themselves no longer contain icons. + +For API docs, see https://projects.jlu5.com/icoextract.html ``` usage: icoextract [-h] [-V] [-n NUM] [-v] input output @@ -43,10 +45,10 @@ Windows PE EXE icon extractor. positional arguments: - input input filename - output output filename + input input filename (.exe/.dll/.mun) + output output filename (.ico) -optional arguments: +options: -h, --help show this help message and exit -V, --version show program's version number and exit -n NUM, --num NUM index of icon to extract @@ -61,7 +63,7 @@ positional arguments: input input filename -optional arguments: +options: -h, --help show this help message and exit -V, --version show program's version number and exit -v, --verbose enables debug logging diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/icoextract-0.1.4/exe-thumbnailer.thumbnailer new/icoextract-0.1.5/exe-thumbnailer.thumbnailer --- old/icoextract-0.1.4/exe-thumbnailer.thumbnailer 2022-08-08 06:24:57.000000000 +0200 +++ new/icoextract-0.1.5/exe-thumbnailer.thumbnailer 2024-04-28 21:56:52.000000000 +0200 @@ -1,4 +1,4 @@ [Thumbnailer Entry] Exec=exe-thumbnailer -v -s %s %i %o -MimeType=application/x-ms-dos-executable;application/x-dosexec;application/x-msdownload +MimeType=application/x-ms-dos-executable;application/x-dosexec;application/x-msdownload;application/vnd.microsoft.portable-executable diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/icoextract-0.1.4/icoextract/__init__.py new/icoextract-0.1.5/icoextract/__init__.py --- old/icoextract-0.1.4/icoextract/__init__.py 2022-08-08 06:24:57.000000000 +0200 +++ new/icoextract-0.1.5/icoextract/__init__.py 2024-04-28 21:56:52.000000000 +0200 @@ -1,6 +1,8 @@ #!/usr/bin/env python3 """ -Windows PE EXE icon extractor. +Windows Portable Executable (PE) icon extractor. + +.. include:: ../LIB-USAGE.md """ import io @@ -25,19 +27,21 @@ logger.info('icoextract: failed to read program version') class IconExtractorError(Exception): - pass + """Superclass for exceptions raised by IconExtractor.""" + class NoIconsAvailableError(IconExtractorError): - pass + """Exception raised when the input program has no icon resources.""" + class InvalidIconDefinitionError(IconExtractorError): - pass + """Exception raised when the input program has an invalid icon resource.""" class IconExtractor(): def __init__(self, filename=None, data=None): """ - Loads an executable from the given filename or data (raw bytes). - As with pefile, if both filename and data are given, filename takes precedence. + Loads an executable from the given `filename` or `data` (raw bytes). + As with pefile, if both `filename` and `data` are given, `filename` takes precedence. - If the executable has contains no icons, this will raise NoIconsAvailableError. + If the executable has contains no icons, this will raise `NoIconsAvailableError`. """ # Use fast loading and explicitly load the RESOURCE directory entry. This saves a LOT of time # on larger files @@ -140,19 +144,29 @@ group_icon, icon_data = datapair fd.write(icon_data) - def export_icon(self, fname, num=0): + def export_icon(self, filename, num=0): """ - Writes ICO data of the requested group icon ID to fname. + Exports ICO data for the requested group icon (`num`) to `filename`. """ - with open(fname, 'wb') as f: + with open(filename, 'wb') as f: self._write_ico(f, num=num) def get_icon(self, num=0): """ - Returns ICO data as a BytesIO() instance, containing the requested group icon ID. + Exports ICO data for the requested group icon (`num`) as a `io.BytesIO` instance. """ f = io.BytesIO() self._write_ico(f, num=num) return f -__all__ = ['IconExtractor'] +__all__ = [ + 'IconExtractor', + 'IconExtractorError', + 'NoIconsAvailableError', + 'InvalidIconDefinitionError' +] + +__pdoc__ = { + 'scripts': False, + 'version': False, +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/icoextract-0.1.4/icoextract/scripts/extract.py new/icoextract-0.1.5/icoextract/scripts/extract.py --- old/icoextract-0.1.4/icoextract/scripts/extract.py 2022-08-08 06:24:57.000000000 +0200 +++ new/icoextract-0.1.5/icoextract/scripts/extract.py 2024-04-28 21:56:52.000000000 +0200 @@ -12,8 +12,8 @@ parser.add_argument("-V", "--version", action='version', version=f'icoextract {__version__}') parser.add_argument("-n", "--num", type=int, help="index of icon to extract", default=0) parser.add_argument("-v", "--verbose", action="store_true", help="enables debug logging") - parser.add_argument("input", help="input filename") - parser.add_argument("output", help="output filename") + parser.add_argument("input", help="input filename (.exe/.dll/.mun)") + parser.add_argument("output", help="output filename (.ico)") args = parser.parse_args() if args.verbose: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/icoextract-0.1.4/icoextract/scripts/thumbnailer.py new/icoextract-0.1.5/icoextract/scripts/thumbnailer.py --- old/icoextract-0.1.4/icoextract/scripts/thumbnailer.py 2022-08-08 06:24:57.000000000 +0200 +++ new/icoextract-0.1.5/icoextract/scripts/thumbnailer.py 2024-04-28 21:56:52.000000000 +0200 @@ -52,8 +52,8 @@ parser.add_argument("-V", "--version", action='version', version=f'exe-thumbnailer, part of icoextract {__version__}') parser.add_argument("-s", "--size", type=int, help="size of desired thumbnail", default=256) parser.add_argument("-v", "--verbose", action="store_true", help="enables debug logging") - parser.add_argument("inputfile", help="input file name") - parser.add_argument("outfile", help="output file name", nargs='?') + parser.add_argument("inputfile", help="input file name (.exe/.dll/.mun)") + parser.add_argument("outfile", help="output file name (.png)", nargs='?') args = parser.parse_args() if args.verbose: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/icoextract-0.1.4/icoextract/version.py new/icoextract-0.1.5/icoextract/version.py --- old/icoextract-0.1.4/icoextract/version.py 2022-08-08 06:24:57.000000000 +0200 +++ new/icoextract-0.1.5/icoextract/version.py 2024-04-28 21:56:52.000000000 +0200 @@ -1 +1 @@ -__version__ = '0.1.4' +__version__ = '0.1.5' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/icoextract-0.1.4/pdoc/templates/config.mako new/icoextract-0.1.5/pdoc/templates/config.mako --- old/icoextract-0.1.4/pdoc/templates/config.mako 1970-01-01 01:00:00.000000000 +0100 +++ new/icoextract-0.1.5/pdoc/templates/config.mako 2024-04-28 21:56:52.000000000 +0200 @@ -0,0 +1,5 @@ +<%! + # Configuration overrides for pdoc + show_source_code = False + git_link_template = 'https://github.com/jlu5/icoextract/blob/{commit}/{path}#L{start_line}-L{end_line}' +%> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/icoextract-0.1.4/setup.cfg new/icoextract-0.1.5/setup.cfg --- old/icoextract-0.1.4/setup.cfg 2022-08-08 06:24:57.000000000 +0200 +++ new/icoextract-0.1.5/setup.cfg 2024-04-28 21:56:52.000000000 +0200 @@ -4,4 +4,4 @@ license_files = LICENSE [options] -python_requires = >=3.6 +python_requires = >=3.8