Hello community,

here is the log from the commit of package python-pyxdg for openSUSE:Leap:15.2 
checked in at 2020-03-23 09:33:44
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Leap:15.2/python-pyxdg (Old)
 and      /work/SRC/openSUSE:Leap:15.2/.python-pyxdg.new.3160 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-pyxdg"

Mon Mar 23 09:33:44 2020 rev:12 rq:787225 version:0.26

Changes:
--------
--- /work/SRC/openSUSE:Leap:15.2/python-pyxdg/python-pyxdg.changes      
2020-01-15 15:52:30.787565912 +0100
+++ /work/SRC/openSUSE:Leap:15.2/.python-pyxdg.new.3160/python-pyxdg.changes    
2020-03-23 09:33:49.096309059 +0100
@@ -1,0 +2,51 @@
+Mon Mar  2 08:27:33 UTC 2020 - Tomáš Chvátal <[email protected]>
+
+- Add setuptools dependency
+- Use pytest to run tests rather than nose that will break with
+  python 3.10
+
+-------------------------------------------------------------------
+Sun Mar  1 01:21:17 UTC 2020 - Mook <[email protected]>
+
+- Fix Menu.py using attributes that no longer exist
+  Patch from https://gitlab.freedesktop.org/xdg/pyxdg/-/merge_requests/2
+  * new-api.patch
+
+-------------------------------------------------------------------
+Sun Sep 15 06:48:50 UTC 2019 - John Vandenberg <[email protected]>
+
+- Fix test data to use sys.executable
+
+-------------------------------------------------------------------
+Wed Apr 24 13:12:09 UTC 2019 - Ondřej Súkup <[email protected]>
+
+- add resource_leak.patch - Fix several ResourceWarnings: unclosed file 
+
+-------------------------------------------------------------------
+Tue Dec  4 12:53:24 UTC 2018 - Matej Cepl <[email protected]>
+
+- Remove superfluous devel dependency for noarch package
+
+-------------------------------------------------------------------
+Tue May 22 19:10:38 UTC 2018 - [email protected]
+
+- Update to 0.26.0:
+  * IconTheme: Add support for Scale and ScaledDirectories keys.
+  * DesktopEntry: New method findTryExec()
+  * Menu: More efficient processing of filter rules by building a Python AST
+  * Mime: Prefer the first mimetype found for a file extension, instead of the 
last
+  * Mime: Allow unknown magic-matching rule formats
+  * Mime: GlobDB has new methods first_match and all_matches for matching paths
+  * Mime: New function get_extensions to get extensions for a given mime type
+  * Mime: Fix MagicDB.match_data crashing with an unknown 'possible' mimetype
+  * Mime: Correctly handle __NOMAGIC__ rule removing previous magic matches
+  * Menu: XML parsing reworked
+  * BaseDirectory: More secure creation of a fallback runtime directory with 
get_runtime_dir(strict=False)
+  * Various miscellaneous improvements to testing.
+
+-------------------------------------------------------------------
+Tue May 22 19:07:50 UTC 2018 - [email protected]
+
+- Fix provides/obsoletes to actually provide python2-xdg too
+
+-------------------------------------------------------------------

Old:
----
  python-pyxdg.keyring
  pyxdg-0.25.tar.gz
  pyxdg-0.25.tar.gz.asc

New:
----
  new-api.patch
  pyxdg-0.26.tar.gz
  resource_leak.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-pyxdg.spec ++++++
--- /var/tmp/diff_new_pack.AQ7UA0/_old  2020-03-23 09:33:49.472309329 +0100
+++ /var/tmp/diff_new_pack.AQ7UA0/_new  2020-03-23 09:33:49.476309332 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python-pyxdg
 #
-# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -12,45 +12,35 @@
 # license that conforms to the Open Source Definition (Version 1.9)
 # published by the Open Source Initiative.
 
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
 #
 
 
-%if 0%{?sle_version} > 120100 || 0%{?suse_version} > 1320
-%bcond_without tests
-%else
-%bcond_with tests
-%endif
-
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 %define oldpython python
 Name:           python-pyxdg
-Version:        0.25
+Version:        0.26
 Release:        0
 Summary:        Implementations of freedesktop.org standards in python
-License:        LGPL-2.1
-Group:          Development/Languages/Python
-Url:            http://freedesktop.org/wiki/Software/pyxdg
+License:        LGPL-2.1-only
+URL:            https://freedesktop.org/wiki/Software/pyxdg
 Source:         
https://files.pythonhosted.org/packages/source/p/pyxdg/pyxdg-%{version}.tar.gz
-Source1:        
http://people.freedesktop.org/~takluyver/pyxdg-%{version}.tar.gz.asc
-Source2:        %{name}.keyring
-BuildRequires:  %{python_module devel}
-%if %{with tests}
-BuildRequires:  %{python_module nose}
-%endif
+Patch0:         resource_leak.patch
+Patch1:         
https://gitlab.freedesktop.org/tcallawa/pyxdg/-/commit/b8d3d7b337adeb2fc2ef8a36f3a500e147d7a41b.diff#/new-api.patch
+BuildRequires:  %{python_module pytest}
+BuildRequires:  %{python_module setuptools}
+BuildRequires:  fdupes
+BuildRequires:  hicolor-icon-theme
 BuildRequires:  python-rpm-macros
 BuildRequires:  shared-mime-info
+Requires:       hicolor-icon-theme
 Requires:       shared-mime-info
-BuildRoot:      %{_tmppath}/%{name}-%{version}-build
+Provides:       python-xdg = %{version}
+Obsoletes:      python-xdg < %{version}
 BuildArch:      noarch
-# Change <= to < after version 0.25
 %ifpython2
 Obsoletes:      %{oldpython}-xdg < %{version}
-Provides:       %{oldpython}-xdg <= %{version}
-%endif
-%ifpython3
-Provides:       python3-xdg = %{version}
-Obsoletes:      python3-xdg <= %{version}
+Provides:       %{oldpython}-xdg = %{version}
 %endif
 %python_subpackages
 
@@ -65,24 +55,27 @@
 
 %prep
 %setup -q -n pyxdg-%{version}
+%patch0 -p1
+%patch1 -p1
 
 %build
 %python_build
 
 %install
 %python_install
+%python_expand %fdupes %{buildroot}%{$python_sitelib}
 
-%if %{with tests}
 %check
-# test-icon fails because it's testing against spec version 0.8
-# and our files moved to 0.9
-rm test/test-icon.py
-%python_expand nosetests-%{$python_bin_suffix}
-%endif
+# https://gitlab.freedesktop.org/xdg/pyxdg/issues/15
+# test_get_type{,2} both fail but come from s-m-i package for data
+# https://gitlab.freedesktop.org/xdg/pyxdg/merge_requests/4
+%{python_expand sed -i "s/Exec=python.*$/Exec=$python/" test/resources.py
+PYTHONPATH=%{buildroot}%{$python_sitelib} pytest-%{$python_bin_suffix} 
test/test-*.py -v -k 'not test_get_type'
+}
 
 %files %{python_files}
-%defattr(-,root,root,-)
-%doc README AUTHORS COPYING ChangeLog
+%license COPYING
+%doc README AUTHORS ChangeLog
 %{python_sitelib}/xdg
 %{python_sitelib}/pyxdg-%{version}-py*.egg-info
 

++++++ new-api.patch ++++++
diff --git a/xdg/Menu.py b/xdg/Menu.py
index 
1d03cad591668f8297882ad8ff3656fbc8062ff1..c27eee2b054f903ae66727dcaee5563f3bebf8ee
 100644
--- a/xdg/Menu.py
+++ b/xdg/Menu.py
@@ -298,11 +298,11 @@ class Menu:
                     entry.Show = NO_EXEC
                     self.Visible -= 1
                 elif xdg.Config.windowmanager:
-                    if (entry.DesktopEntry.OnlyShowIn != [] and (
-                            xdg.Config.windowmanager not in 
entry.DesktopEntry.OnlyShowIn
+                    if (entry.DesktopEntry.getOnlyShowIn() != [] and (
+                            xdg.Config.windowmanager not in 
entry.DesktopEntry.getOnlyShowIn()
                         )
                     ) or (
-                        xdg.Config.windowmanager in 
entry.DesktopEntry.NotShowIn
+                        xdg.Config.windowmanager in 
entry.DesktopEntry.getNotShowIn()
                     ):
                         entry.Show = NOT_SHOW_IN
                         self.Visible -= 1
@@ -994,8 +994,8 @@ class XMLMenuBuilder(object):
                     menuentry = MenuEntry(directory, dir)
                     if not menu.Directory:
                         menu.Directory = menuentry
-                    elif menuentry.Type == MenuEntry.TYPE_SYSTEM:
-                        if menu.Directory.Type == MenuEntry.TYPE_USER:
+                    elif menuentry.getType() == MenuEntry.TYPE_SYSTEM:
+                        if menu.Directory.getType() == MenuEntry.TYPE_USER:
                             menu.Directory.Original = menuentry
             if menu.Directory:
                 break
++++++ pyxdg-0.25.tar.gz -> pyxdg-0.26.tar.gz ++++++
++++ 4383 lines of diff (skipped)

++++++ resource_leak.patch ++++++
>From 73476af1eecb8e29f2a461e003a2d8a735d22306 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micka=C3=ABl=20Schoentgen?= <[email protected]>
Date: Sun, 9 Dec 2018 17:31:24 +0100
Subject: Fix several ResourceWarnings: unclosed file

---
 xdg/IniFile.py     | 61 +++++++++++++++++++++++++++---------------------------
 xdg/Mime.py        |  9 +++++---
 xdg/RecentFiles.py | 43 +++++++++++++++++++-------------------
 3 files changed, 57 insertions(+), 56 deletions(-)

diff --git a/xdg/IniFile.py b/xdg/IniFile.py
index 718589f..84be614 100644
--- a/xdg/IniFile.py
+++ b/xdg/IniFile.py
@@ -56,38 +56,37 @@ class IniFile:
                 return
 
         # parse file
-        for line in fd:
-            line = line.strip()
-            # empty line
-            if not line:
-                continue
-            # comment
-            elif line[0] == '#':
-                continue
-            # new group
-            elif line[0] == '[':
-                currentGroup = line.lstrip("[").rstrip("]")
-                if debug and self.hasGroup(currentGroup):
-                    raise DuplicateGroupError(currentGroup, filename)
-                else:
-                    content[currentGroup] = {}
-            # key
-            else:
-                try:
-                    key, value = line.split("=", 1)
-                except ValueError:
-                    raise ParsingError("Invalid line: " + line, filename)
-                
-                key = key.strip() # Spaces before/after '=' should be ignored
-                try:
-                    if debug and self.hasKey(key, currentGroup):
-                        raise DuplicateKeyError(key, currentGroup, filename)
+        with fd:
+            for line in fd:
+                line = line.strip()
+                # empty line
+                if not line:
+                    continue
+                # comment
+                elif line[0] == '#':
+                    continue
+                # new group
+                elif line[0] == '[':
+                    currentGroup = line.lstrip("[").rstrip("]")
+                    if debug and self.hasGroup(currentGroup):
+                        raise DuplicateGroupError(currentGroup, filename)
                     else:
-                        content[currentGroup][key] = value.strip()
-                except (IndexError, UnboundLocalError):
-                    raise ParsingError("Parsing error on key, group missing", 
filename)
-
-        fd.close()
+                        content[currentGroup] = {}
+                # key
+                else:
+                    try:
+                        key, value = line.split("=", 1)
+                    except ValueError:
+                        raise ParsingError("Invalid line: " + line, filename)
+
+                    key = key.strip() # Spaces before/after '=' should be 
ignored
+                    try:
+                        if debug and self.hasKey(key, currentGroup):
+                            raise DuplicateKeyError(key, currentGroup, 
filename)
+                        else:
+                            content[currentGroup][key] = value.strip()
+                    except (IndexError, UnboundLocalError):
+                        raise ParsingError("Parsing error on key, group 
missing", filename)
 
         self.filename = filename
         self.tainted = False
diff --git a/xdg/Mime.py b/xdg/Mime.py
index 3bff8b2..886cb42 100644
--- a/xdg/Mime.py
+++ b/xdg/Mime.py
@@ -749,14 +749,16 @@ def install_mime_info(application, package_file):
     file with the same name (if the contents are different)"""
     application += '.xml'
 
-    new_data = open(package_file).read()
+    with open(package_file) as f:
+        new_data = f.read()
 
     # See if the file is already installed
     package_dir = os.path.join('mime', 'packages')
     resource = os.path.join(package_dir, application)
     for x in BaseDirectory.load_data_paths(resource):
         try:
-            old_data = open(x).read()
+            with open(x) as f:
+                old_data = f.read()
         except:
             continue
         if old_data == new_data:
@@ -770,7 +772,8 @@ def install_mime_info(application, package_file):
     new_file = os.path.join(BaseDirectory.save_data_path(package_dir), 
application)
 
     # Write the file...
-    open(new_file, 'w').write(new_data)
+    with open(new_file, 'w') as f:
+        f.write(new_data)
 
     # Update the database...
     command = 'update-mime-database'
diff --git a/xdg/RecentFiles.py b/xdg/RecentFiles.py
index 3038b57..7ee7ee5 100644
--- a/xdg/RecentFiles.py
+++ b/xdg/RecentFiles.py
@@ -71,28 +71,27 @@ class RecentFiles:
         elif not filename:
             filename = self.filename
 
-        f = open(filename, "w")
-        fcntl.lockf(f, fcntl.LOCK_EX)
-        f.write('<?xml version="1.0"?>\n')
-        f.write("<RecentFiles>\n")
-
-        for r in self.RecentFiles:
-            f.write("  <RecentItem>\n")
-            f.write("    <URI>%s</URI>\n" % xml.sax.saxutils.escape(r.URI))
-            f.write("    <Mime-Type>%s</Mime-Type>\n" % r.MimeType)
-            f.write("    <Timestamp>%s</Timestamp>\n" % r.Timestamp)
-            if r.Private == True:
-                f.write("    <Private/>\n")
-            if len(r.Groups) > 0:
-                f.write("    <Groups>\n")
-                for group in r.Groups:
-                    f.write("      <Group>%s</Group>\n" % group)
-                f.write("    </Groups>\n")
-            f.write("  </RecentItem>\n")
-
-        f.write("</RecentFiles>\n")
-        fcntl.lockf(f, fcntl.LOCK_UN)
-        f.close()
+        with open(filename, "w") as f:
+            fcntl.lockf(f, fcntl.LOCK_EX)
+            f.write('<?xml version="1.0"?>\n')
+            f.write("<RecentFiles>\n")
+
+            for r in self.RecentFiles:
+                f.write("  <RecentItem>\n")
+                f.write("    <URI>%s</URI>\n" % xml.sax.saxutils.escape(r.URI))
+                f.write("    <Mime-Type>%s</Mime-Type>\n" % r.MimeType)
+                f.write("    <Timestamp>%s</Timestamp>\n" % r.Timestamp)
+                if r.Private == True:
+                    f.write("    <Private/>\n")
+                if len(r.Groups) > 0:
+                    f.write("    <Groups>\n")
+                    for group in r.Groups:
+                        f.write("      <Group>%s</Group>\n" % group)
+                    f.write("    </Groups>\n")
+                f.write("  </RecentItem>\n")
+
+            f.write("</RecentFiles>\n")
+            fcntl.lockf(f, fcntl.LOCK_UN)
 
     def getFiles(self, mimetypes=None, groups=None, limit=0):
         """Get a list of recently used files.
-- 
cgit v1.1


Reply via email to