fix incorrect use of Type attribute (bz 1654857)

This commit is contained in:
Tom Callaway 2018-11-30 11:52:03 -05:00
parent 2f091f47ae
commit 69b572c919
2 changed files with 21 additions and 1 deletions

View File

@ -0,0 +1,14 @@
diff -up pyxdg-0.26/xdg/Menu.py.getTypefix pyxdg-0.26/xdg/Menu.py
--- pyxdg-0.26/xdg/Menu.py.getTypefix 2018-11-01 11:37:50.561645188 -0400
+++ pyxdg-0.26/xdg/Menu.py 2018-11-30 11:33:10.728729275 -0500
@@ -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

View File

@ -2,13 +2,15 @@
Name: pyxdg Name: pyxdg
Version: 0.26 Version: 0.26
Release: 2%{?dist} Release: 3%{?dist}
Summary: Python library to access freedesktop.org standards Summary: Python library to access freedesktop.org standards
Group: Development/Libraries Group: Development/Libraries
License: LGPLv2 License: LGPLv2
URL: http://freedesktop.org/Software/pyxdg URL: http://freedesktop.org/Software/pyxdg
Source0: https://pypi.python.org/packages/source/r/PyXDG/%{name}-%{version}.tar.gz Source0: https://pypi.python.org/packages/source/r/PyXDG/%{name}-%{version}.tar.gz
# https://gitlab.freedesktop.org/xdg/pyxdg/merge_requests/2
Patch0: pyxdg-0.26-fix-OnlyShowIn.patch Patch0: pyxdg-0.26-fix-OnlyShowIn.patch
Patch1: pyxdg-0.26-getType-fix.patch
BuildArch: noarch BuildArch: noarch
# These are needed for the nose tests. # These are needed for the nose tests.
BuildRequires: hicolor-icon-theme BuildRequires: hicolor-icon-theme
@ -48,6 +50,7 @@ package contains a Python 3 version of PyXDG.
%prep %prep
%setup -q %setup -q
%patch0 -p1 -b .fixOnlyShowIn %patch0 -p1 -b .fixOnlyShowIn
%patch1 -p1 -b .getType
%build %build
%py2_build %py2_build
@ -87,6 +90,9 @@ nosetests-%{python3_version} || :
%endif #with_python3 %endif #with_python3
%changelog %changelog
* Fri Nov 30 2018 Tom Callaway <spot@fedoraproject.org> - 0.26-3
- fix incorrect use of Type attribute (bz 1654857)
* Thu Nov 1 2018 Tom Callaway <spot@fedoraproject.org> - 0.26-2 * Thu Nov 1 2018 Tom Callaway <spot@fedoraproject.org> - 0.26-2
- fix OnlyShowIn (bz 1624651) - fix OnlyShowIn (bz 1624651)