Hello community,
here is the log from the commit of package python3-pyudev for openSUSE:Factory checked in at 2015-12-23 08:50:41
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python3-pyudev (Old)
and /work/SRC/openSUSE:Factory/.python3-pyudev.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python3-pyudev"
Changes:
--------
--- /work/SRC/openSUSE:Factory/python3-pyudev/python3-pyudev.changes 2015-12-03 13:32:47.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.python3-pyudev.new/python3-pyudev.changes 2015-12-23 08:50:42.000000000 +0100
@@ -1,0 +2,11 @@
+Tue Dec 22 01:56:17 UTC 2015 - arun@gmx.de
+
+- specfile:
+ * require six
+
+- update to version 0.18.1:
+ * Restore raising KeyError by Attributes.as* methods when attribute
+ not found.
+ * Explicitly require six module.
+
+-------------------------------------------------------------------
Old:
----
pyudev-0.18.tar.gz
New:
----
pyudev-0.18.1.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python3-pyudev.spec ++++++
--- /var/tmp/diff_new_pack.bAjkBN/_old 2015-12-23 08:50:42.000000000 +0100
+++ /var/tmp/diff_new_pack.bAjkBN/_new 2015-12-23 08:50:42.000000000 +0100
@@ -17,7 +17,7 @@
Name: python3-pyudev
-Version: 0.18
+Version: 0.18.1
Release: 0
Summary: Udev bindings for Python
License: LGPL-2.1+
@@ -28,6 +28,8 @@
BuildRequires: python3-Sphinx
BuildRequires: python3-devel
BuildRequires: python3-setuptools
+BuildRequires: python3-six
+Requires: python3-six
BuildArch: noarch
%description
++++++ pyudev-0.18.tar.gz -> pyudev-0.18.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyudev-0.18/CHANGES.rst new/pyudev-0.18.1/CHANGES.rst
--- old/pyudev-0.18/CHANGES.rst 2015-12-01 15:11:37.000000000 +0100
+++ new/pyudev-0.18.1/CHANGES.rst 2015-12-18 18:27:19.000000000 +0100
@@ -1,3 +1,9 @@
+0.18.1 (Dec 18, 2015)
+=====================
+
+- Restore raising KeyError by Attributes.as* methods when attribute not found.
+- Explicitly require six module.
+
0.18 (Dec 1, 2015)
===================
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyudev-0.18/PKG-INFO new/pyudev-0.18.1/PKG-INFO
--- old/pyudev-0.18/PKG-INFO 2015-12-01 15:21:36.000000000 +0100
+++ new/pyudev-0.18.1/PKG-INFO 2015-12-18 18:28:21.000000000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: pyudev
-Version: 0.18
+Version: 0.18.1
Summary: A libudev binding
Home-page: http://pyudev.readthedocs.org/
Author: Sebastian Wiesner
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyudev-0.18/setup.py new/pyudev-0.18.1/setup.py
--- old/pyudev-0.18/setup.py 2015-12-01 15:11:37.000000000 +0100
+++ new/pyudev-0.18.1/setup.py 2015-12-18 18:27:19.000000000 +0100
@@ -54,7 +54,10 @@
'Topic :: Software Development :: Libraries',
'Topic :: System :: Hardware',
'Topic :: System :: Operating System Kernels :: Linux',
- ],
+ ],
+ install_requires = [
+ 'six'
+ ],
package_dir={"": "src"},
packages=setuptools.find_packages("src"),
)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyudev-0.18/src/pyudev/device/_device.py new/pyudev-0.18.1/src/pyudev/device/_device.py
--- old/pyudev-0.18/src/pyudev/device/_device.py 2015-12-01 15:11:37.000000000 +0100
+++ new/pyudev-0.18.1/src/pyudev/device/_device.py 2015-12-18 18:27:19.000000000 +0100
@@ -979,76 +979,86 @@
for attribute, _ in udev_list_iterate(self._libudev, attrs):
yield ensure_unicode_string(attribute)
- def get(self, attribute, default=None):
+ def _get(self, attribute):
"""
Get the given system ``attribute`` for the device.
- ``attribute`` is a unicode or byte string containing the name of the
- system attribute.
-
- :param str attribute: the attribute to lookup
- :param object default: the default value to return
- :returns: the attribute value or None if no value
- :rtype: byte string or NoneType
-
- Returns ``default`` if lookup gets None.
+ :param attribute: the key for an attribute value
+ :type attribute: unicode or byte string
+ :returns: the value corresponding to ``attribute``
+ :rtype: an arbitrary sequence of bytes
+ :raises KeyError: if no value found
"""
value = self._libudev.udev_device_get_sysattr_value(
- self.device,
- ensure_byte_string(attribute)
+ self.device,
+ ensure_byte_string(attribute)
)
- return value if value is not None else default
+ if value is None:
+ raise KeyError(attribute)
+ return value
- def asstring(self, attribute):
+ def get(self, attribute, default=None):
"""
- Get the given ``atribute`` for the device as unicode string.
+ Get the given system ``attribute`` for the device.
- Depending on the content of the attribute, this may or may not work.
- Be prepared to catch :exc:`~exceptions.UnicodeDecodeError`.
+ :param attribute: the key for an attribute value
+ :type attribute: unicode or byte string
+ :param default: a default if no corresponding value found
+ :type default: a sequence of bytes
+ :returns: the value corresponding to ``attribute`` or ``default``
+ :rtype: object
+ """
+ try:
+ return self._get(attribute)
+ except KeyError:
+ return default
- ``attribute`` is a unicode or byte string containing the name of the
- attribute.
+ def asstring(self, attribute):
+ """
+ Get the given ``attribute`` for the device as unicode string.
- Return the attribute value as byte string. Raise a
- :exc:`~exceptions.KeyError`, if the given attribute is not defined
- for this device, or :exc:`~exceptions.UnicodeDecodeError`, if the
- content of the attribute cannot be decoded into a unicode string.
+ :param attribute: the key for an attribute value
+ :type attribute: unicode or byte string
+ :returns: the value corresponding to ``attribute``, as unicode
+ :rtype: unicode
+ :raises KeyError: if no value found for ``attribute``
+ :raises UnicodeDecodeError: if value is not convertible
"""
- value = self.get(attribute)
- return ensure_unicode_string(value if value is not None else str(None))
+ return ensure_unicode_string(self._get(attribute))
def asint(self, attribute):
"""
- Get the given ``attribute`` as integer.
-
- ``attribute`` is a unicode or byte string containing the name of the
- attribute.
+ Get the given ``attribute`` as an int.
- Return the attribute value as integer. Raise a
- :exc:`~exceptions.KeyError`, if the given attribute is not defined
- for this device, or a :exc:`~exceptions.ValueError`, if the
- attribute value cannot be converted to an integer.
+ :param attribute: the key for an attribute value
+ :type attribute: unicode or byte string
+ :returns: the value corresponding to ``attribute``, as an int
+ :rtype: int
+ :raises KeyError: if no value found for ``attribute``
+ :raises UnicodeDecodeError: if value is not convertible to unicode
+ :raises ValueError: if unicode value can not be converted to an int
"""
return int(self.asstring(attribute))
def asbool(self, attribute):
"""
- Get the given ``attribute`` from this device as boolean.
+ Get the given ``attribute`` from this device as a bool.
+
+ :param attribute: the key for an attribute value
+ :type attribute: unicode or byte string
+ :returns: the value corresponding to ``attribute``, as bool
+ :rtype: bool
+ :raises KeyError: if no value found for ``attribute``
+ :raises UnicodeDecodeError: if value is not convertible to unicode
+ :raises ValueError: if unicode value can not be converted to a bool
A boolean attribute has either a value of ``'1'`` or of ``'0'``,
where ``'1'`` stands for ``True``, and ``'0'`` for ``False``. Any
other value causes a :exc:`~exceptions.ValueError` to be raised.
-
- ``attribute`` is a unicode or byte string containing the name of the
- attribute.
-
- Return ``True``, if the attribute value is ``'1'`` and ``False``, if
- the attribute value is ``'0'``. Any other value raises a
- :exc:`~exceptions.ValueError`. Raise a :exc:`~exceptions.KeyError`,
- if the given attribute is not defined for this device.
"""
return string_to_bool(self.asstring(attribute))
+
class Tags(Iterable, Container):
"""
A iterable over :class:`Device` tags.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyudev-0.18/src/pyudev/version.py new/pyudev-0.18.1/src/pyudev/version.py
--- old/pyudev-0.18/src/pyudev/version.py 2015-12-01 15:11:37.000000000 +0100
+++ new/pyudev-0.18.1/src/pyudev/version.py 2015-12-18 18:27:19.000000000 +0100
@@ -25,5 +25,5 @@
.. moduleauthor:: mulhern