From 17e8901053ed9b1e95ba1b4d708fa31034db0d8b66bf3777cb98f36d5e13d834 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Mon, 2 Mar 2020 08:24:33 +0000 Subject: [PATCH] Accepting request 780590 from home:mookmoz:branches:devel:languages:python - Fix Menu.py using attributes that no longer exist Patch from https://gitlab.freedesktop.org/xdg/pyxdg/-/merge_requests/2 Upstream has had a merge request open since Nov 2018 for some obvious errors; this appears to have came from the Fedora package ( https://src.fedoraproject.org/rpms/pyxdg/blob/master/f/pyxdg-0.26-getType-fix.patch ): the author seems to be the Fedora maintainer. I'm still new-ish to the OBS process; please let me know if you'd like changes. Not entirely happy with the patch name, but I have not found a good way to get a patch URL out of a GitLab merge request either. Thanks! OBS-URL: https://build.opensuse.org/request/show/780590 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pyxdg?expand=0&rev=20 --- b8d3d7b337adeb2fc2ef8a36f3a500e147d7a41b.diff | 30 +++++++++++++++++++ python-pyxdg.changes | 6 ++++ python-pyxdg.spec | 4 ++- 3 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 b8d3d7b337adeb2fc2ef8a36f3a500e147d7a41b.diff diff --git a/b8d3d7b337adeb2fc2ef8a36f3a500e147d7a41b.diff b/b8d3d7b337adeb2fc2ef8a36f3a500e147d7a41b.diff new file mode 100644 index 0000000..95ebf33 --- /dev/null +++ b/b8d3d7b337adeb2fc2ef8a36f3a500e147d7a41b.diff @@ -0,0 +1,30 @@ +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 diff --git a/python-pyxdg.changes b/python-pyxdg.changes index a3b1fb1..913bafa 100644 --- a/python-pyxdg.changes +++ b/python-pyxdg.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Sun Mar 1 01:21:17 UTC 2020 - Mook + +- Fix Menu.py using attributes that no longer exist + Patch from https://gitlab.freedesktop.org/xdg/pyxdg/-/merge_requests/2 + ------------------------------------------------------------------- Sun Sep 15 06:48:50 UTC 2019 - John Vandenberg diff --git a/python-pyxdg.spec b/python-pyxdg.spec index d1d510d..4bc3fe6 100644 --- a/python-pyxdg.spec +++ b/python-pyxdg.spec @@ -1,7 +1,7 @@ # # spec file for package python-pyxdg # -# Copyright (c) 2019 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 @@ -27,6 +27,7 @@ Group: Development/Languages/Python URL: http://freedesktop.org/wiki/Software/pyxdg Source: https://files.pythonhosted.org/packages/source/p/pyxdg/pyxdg-%{version}.tar.gz Patch0: resource_leak.patch +Patch1: https://gitlab.freedesktop.org/tcallawa/pyxdg/-/commit/b8d3d7b337adeb2fc2ef8a36f3a500e147d7a41b.diff BuildRequires: %{python_module nose} BuildRequires: fdupes BuildRequires: hicolor-icon-theme @@ -55,6 +56,7 @@ PyXDG is a python library to access freedesktop.org standards. Currently support %prep %setup -q -n pyxdg-%{version} %patch0 -p1 +%patch1 -p1 %build %python_build