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 2022-09-29 18:13:59
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-icoextract (Old)
and /work/SRC/openSUSE:Factory/.python-icoextract.new.2275 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-icoextract"
Thu Sep 29 18:13:59 2022 rev:3 rq:1006883 version:0.1.4
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-icoextract/python-icoextract.changes
2022-08-30 14:51:27.448423170 +0200
+++
/work/SRC/openSUSE:Factory/.python-icoextract.new.2275/python-icoextract.changes
2022-09-29 18:14:58.303444747 +0200
@@ -1,0 +2,7 @@
+Thu Sep 29 02:27:52 UTC 2022 - Yogalakshmi Arunachalam <[email protected]>
+
+- Update to icoextract 0.1.4 (2022-08-08)
+ IconExtractor: support raw bytes as input, in addition to a filename
+ Refresh function descriptions
+
+-------------------------------------------------------------------
Old:
----
icoextract-0.1.3.tar.gz
New:
----
icoextract-0.1.4.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-icoextract.spec ++++++
--- /var/tmp/diff_new_pack.OqKKRh/_old 2022-09-29 18:14:58.739445602 +0200
+++ /var/tmp/diff_new_pack.OqKKRh/_new 2022-09-29 18:14:58.743445610 +0200
@@ -19,7 +19,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define skip_python2 1
Name: python-icoextract
-Version: 0.1.3
+Version: 0.1.4
Release: 0
Summary: Extract icons from Windows PE files (.exe/.dll)
License: MIT
++++++ icoextract-0.1.3.tar.gz -> icoextract-0.1.4.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/icoextract-0.1.3/CHANGELOG.md
new/icoextract-0.1.4/CHANGELOG.md
--- old/icoextract-0.1.3/CHANGELOG.md 2022-06-13 01:07:25.000000000 +0200
+++ new/icoextract-0.1.4/CHANGELOG.md 2022-08-08 06:24:57.000000000 +0200
@@ -1,5 +1,10 @@
# Changelog
+## icoextract 0.1.4 (2022-08-08)
+
+- IconExtractor: support raw bytes as input, in addition to a filename
+- Refresh function descriptions
+
## icoextract 0.1.3 (2022-06-12)
- Fix thumbnail resizing; use native 128x128 icons when available (GH-7)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/icoextract-0.1.3/README.md
new/icoextract-0.1.4/README.md
--- old/icoextract-0.1.3/README.md 2022-06-13 01:07:25.000000000 +0200
+++ new/icoextract-0.1.4/README.md 2022-08-08 06:24:57.000000000 +0200
@@ -1,5 +1,7 @@
# icoextract
+[](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.
This project is inspired by
[extract-icon-py](https://github.com/firodj/extract-icon-py),
[icoutils](https://www.nongnu.org/icoutils/), and others.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/icoextract-0.1.3/icoextract/__init__.py
new/icoextract-0.1.4/icoextract/__init__.py
--- old/icoextract-0.1.3/icoextract/__init__.py 2022-06-13 01:07:25.000000000
+0200
+++ new/icoextract-0.1.4/icoextract/__init__.py 2022-08-08 06:24:57.000000000
+0200
@@ -32,15 +32,20 @@
pass
class IconExtractor():
- def __init__(self, filename):
- self.filename = filename
+ 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.
+
+ 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
- self._pe = pefile.PE(filename, fast_load=True)
+ self._pe = pefile.PE(name=filename, data=data, fast_load=True)
self._pe.parse_data_directories(pefile.DIRECTORY_ENTRY['IMAGE_DIRECTORY_ENTRY_RESOURCE'])
if not hasattr(self._pe, 'DIRECTORY_ENTRY_RESOURCE'):
- raise NoIconsAvailableError(f"{filename} has no resources")
+ raise NoIconsAvailableError("File has no resources")
# Reverse the list of entries before making the mapping so that
earlier values take precedence
# When an executable includes multiple icon resources, we should use
only the first one.
@@ -48,12 +53,12 @@
self.groupiconres =
resources.get(pefile.RESOURCE_TYPE["RT_GROUP_ICON"])
if not self.groupiconres:
- raise NoIconsAvailableError(f"{filename} has no group icon
resources")
+ raise NoIconsAvailableError("File has no group icon resources")
self.rticonres = resources.get(pefile.RESOURCE_TYPE["RT_ICON"])
def list_group_icons(self):
"""
- Returns a list of group icon entries.
+ Returns all group icon entries as a list of (name, offset) tuples.
"""
return [(e.struct.Name, e.struct.OffsetToData)
for e in self.groupiconres.directory.entries]
@@ -137,14 +142,14 @@
def export_icon(self, fname, num=0):
"""
- Writes ICO data containing the program icon of the input executable.
+ Writes ICO data of the requested group icon ID to fname.
"""
with open(fname, 'wb') as f:
self._write_ico(f, num=num)
def get_icon(self, num=0):
"""
- Returns ICO data as a BytesIO() instance, containing the program icon
of the input executable.
+ Returns ICO data as a BytesIO() instance, containing the requested
group icon ID.
"""
f = io.BytesIO()
self._write_ico(f, num=num)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/icoextract-0.1.3/icoextract/version.py
new/icoextract-0.1.4/icoextract/version.py
--- old/icoextract-0.1.3/icoextract/version.py 2022-06-13 01:07:25.000000000
+0200
+++ new/icoextract-0.1.4/icoextract/version.py 2022-08-08 06:24:57.000000000
+0200
@@ -1 +1 @@
-__version__ = '0.1.3'
+__version__ = '0.1.4'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/icoextract-0.1.3/tests/test_extract.py
new/icoextract-0.1.4/tests/test_extract.py
--- old/icoextract-0.1.3/tests/test_extract.py 2022-06-13 01:07:25.000000000
+0200
+++ new/icoextract-0.1.4/tests/test_extract.py 2022-08-08 06:24:57.000000000
+0200
@@ -50,5 +50,11 @@
with self.assertRaises(icoextract.NoIconsAvailableError):
self._test_extract("testapp32-nores.exe", "testapp-nores.ico")
+ def test_fd_as_input(self):
+ tests_dir = os.path.dirname(__file__)
+ with open(os.path.join(tests_dir, "testapp64.exe"), 'rb') as f:
+ ie = icoextract.IconExtractor(data=f.read())
+ self.assertEqual(len(ie.list_group_icons()), 1)
+
if __name__ == '__main__':
unittest.main()