Hello community, here is the log from the commit of package python-evdev for openSUSE:Factory checked in at 2019-03-01 16:50:01 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-evdev (Old) and /work/SRC/openSUSE:Factory/.python-evdev.new.28833 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-evdev" Fri Mar 1 16:50:01 2019 rev:4 rq:680458 version:1.1.2 Changes: -------- --- /work/SRC/openSUSE:Factory/python-evdev/python-evdev.changes 2018-08-29 12:26:25.275556810 +0200 +++ /work/SRC/openSUSE:Factory/.python-evdev.new.28833/python-evdev.changes 2019-03-01 16:50:05.909738567 +0100 @@ -1,0 +2,8 @@ +Fri Mar 1 11:01:57 UTC 2019 - Tomáš Chvátal <[email protected]> + +- Update to 1.1.2: + * Fix handling of absinfo capabilities + * Fix invalid example + * Check if FF_MAX_EFFECTS is defined + +------------------------------------------------------------------- Old: ---- _service v1.1.0.tar.gz New: ---- v1.1.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-evdev.spec ++++++ --- /var/tmp/diff_new_pack.THR8Gi/_old 2019-03-01 16:50:06.929738182 +0100 +++ /var/tmp/diff_new_pack.THR8Gi/_new 2019-03-01 16:50:06.929738182 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-evdev # -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -12,26 +12,25 @@ # 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/ # %define modname evdev %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-evdev -Version: 1.1.0 +Version: 1.1.2 Release: 0 Summary: Python bindings to the Linux input handling subsystem License: BSD-3-Clause Group: Development/Languages/Python -Url: https://github.com/gvalkov/python-evdev +URL: https://github.com/gvalkov/python-evdev Source: https://github.com/gvalkov/%{name}/archive/v%{version}.tar.gz BuildRequires: %{python_module devel} BuildRequires: %{python_module pytest} BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros - %python_subpackages %description @@ -53,13 +52,13 @@ %install %python_install -%python_expand %fdupes %buildroot/%$python_sitearch +%python_expand %fdupes %{buildroot}/%{$python_sitearch} %check %python_expand PYTHONPATH=%{buildroot}%{$python_sitearch} py.test-%{$python_version} tests -k 'not test_uinput' -%files %python_files -%python_sitearch/evdev* +%files %{python_files} +%{python_sitearch}/evdev* %license LICENSE %changelog ++++++ v1.1.0.tar.gz -> v1.1.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-evdev-1.1.0/docs/changelog.rst new/python-evdev-1.1.2/docs/changelog.rst --- old/python-evdev-1.1.0/docs/changelog.rst 2018-08-27 21:11:25.000000000 +0200 +++ new/python-evdev-1.1.2/docs/changelog.rst 2018-09-01 19:45:42.000000000 +0200 @@ -1,6 +1,14 @@ Changelog --------- +1.1.2 (Sep 1, 2018) +==================== + +- Fix installation on kernels <= 4.4. + +- Fix uinput creation ignoring absinfo settings. + + 1.1.0 (Aug 27, 2018) ==================== diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-evdev-1.1.0/docs/conf.py new/python-evdev-1.1.2/docs/conf.py --- old/python-evdev-1.1.0/docs/conf.py 2018-08-27 21:11:25.000000000 +0200 +++ new/python-evdev-1.1.2/docs/conf.py 2018-09-01 19:45:42.000000000 +0200 @@ -60,7 +60,7 @@ # built documents. # # The full version, including alpha/beta/rc tags. -release = '1.1.0' +release = '1.1.2' # The short X.Y version. version = release diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-evdev-1.1.0/docs/tutorial.rst new/python-evdev-1.1.2/docs/tutorial.rst --- old/python-evdev-1.1.0/docs/tutorial.rst 2018-08-27 21:11:25.000000000 +0200 +++ new/python-evdev-1.1.2/docs/tutorial.rst 2018-09-01 19:45:42.000000000 +0200 @@ -325,7 +325,7 @@ ... (e.ABS_X, AbsInfo(value=0, min=0, max=255, ... fuzz=0, flat=0, resolution=0)), ... (e.ABS_Y, AbsInfo(0, 0, 255, 0, 0, 0)), - ... (e.ABS_MT_POSITION_X, (0, 255, 128, 0)) ] + ... (e.ABS_MT_POSITION_X, (0, 128, 255, 0)) ] ... } >>> ui = UInput(cap, name='example-device', version=0x3) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-evdev-1.1.0/evdev/uinput.c new/python-evdev-1.1.2/evdev/uinput.c --- old/python-evdev-1.1.0/evdev/uinput.c 2018-08-27 21:11:25.000000000 +0200 +++ new/python-evdev-1.1.2/evdev/uinput.c 2018-09-01 19:45:42.000000000 +0200 @@ -16,6 +16,12 @@ #include <linux/uinput.h> #endif + +// Workaround for installing on kernels newer than 4.4. +#ifndef FF_MAX_EFFECTS +#define FF_MAX_EFFECTS FF_GAIN; +#endif + int _uinput_close(int fd) { if (ioctl(fd, UI_DEV_DESTROY) < 0) { @@ -88,7 +94,6 @@ uidev.id.product = product; uidev.id.version = version; uidev.id.bustype = bustype; - uidev.ff_effects_max = FF_MAX_EFFECTS; len = PyList_Size(absinfo); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-evdev-1.1.0/evdev/uinput.py new/python-evdev-1.1.2/evdev/uinput.py --- old/python-evdev-1.1.0/evdev/uinput.py 2018-08-27 21:11:25.000000000 +0200 +++ new/python-evdev-1.1.2/evdev/uinput.py 2018-09-01 19:45:42.000000000 +0200 @@ -121,21 +121,37 @@ if not events: events = {ecodes.EV_KEY: ecodes.keys.keys()} - # The min, max, fuzz and flat values for the absolute axis for - # a given code. - absinfo = [] - self._verify() #: Write-only, non-blocking file descriptor to the uinput device node. self.fd = _uinput.open(devnode) + # Prepare the list of events for passing to _uinput.enable and _uinput.setup. + absinfo, prepared_events = self._prepare_events(events) + # Set phys name _uinput.set_phys(self.fd, phys) + for etype, code in prepared_events: + _uinput.enable(self.fd, etype, code) + _uinput.setup(self.fd, name, vendor, product, version, bustype, absinfo) - # Set device capabilities. + # Create the uinput device. + _uinput.create(self.fd) + + self.dll = ctypes.CDLL(_uinput.__file__) + self.dll._uinput_begin_upload.restype = ctypes.c_int + self.dll._uinput_end_upload.restype = ctypes.c_int + + #: An :class:`InputDevice <evdev.device.InputDevice>` instance + #: for the fake input device. ``None`` if the device cannot be + #: opened for reading and writing. + self.device = self._find_device() + + def _prepare_events(self, events): + '''Prepare events for passing to _uinput.enable and _uinput.setup''' + absinfo, prepared_events = [], [] for etype, codes in events.items(): for code in codes: # Handle max, min, fuzz, flat. @@ -148,21 +164,8 @@ f.extend([0] * (6 - len(code[1]))) absinfo.append(f) code = code[0] - - # TODO: remove a lot of unnecessary packing/unpacking - _uinput.enable(self.fd, etype, code) - - # Create the uinput device. - _uinput.create(self.fd) - - self.dll = ctypes.CDLL(_uinput.__file__) - self.dll._uinput_begin_upload.restype = ctypes.c_int - self.dll._uinput_end_upload.restype = ctypes.c_int - - #: An :class:`InputDevice <evdev.device.InputDevice>` instance - #: for the fake input device. ``None`` if the device cannot be - #: opened for reading and writing. - self.device = self._find_device() + prepared_events.append((etype, code)) + return absinfo, prepared_events def __enter__(self): return self @@ -219,29 +222,25 @@ upload.effect_id = effect_id if self.dll._uinput_begin_upload(self.fd, ctypes.byref(upload)): - raise UInputError('Failed to begin uinput upload: ' + - os.strerror()) + raise UInputError('Failed to begin uinput upload: ' + os.strerror()) return upload def end_upload(self, upload): if self.dll._uinput_end_upload(self.fd, ctypes.byref(upload)): - raise UInputError('Failed to end uinput upload: ' + - os.strerror()) + raise UInputError('Failed to end uinput upload: ' + os.strerror()) def begin_erase(self, effect_id): erase = ff.UInputErase() erase.effect_id = effect_id if self.dll._uinput_begin_erase(self.fd, ctypes.byref(erase)): - raise UInputError('Failed to begin uinput erase: ' + - os.strerror()) + raise UInputError('Failed to begin uinput erase: ' + os.strerror()) return erase def end_erase(self, erase): if self.dll._uinput_end_erase(self.fd, ctypes.byref(erase)): - raise UInputError('Failed to end uinput erase: ' + - os.strerror()) + raise UInputError('Failed to end uinput erase: ' + os.strerror()) def _verify(self): ''' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-evdev-1.1.0/setup.cfg new/python-evdev-1.1.2/setup.cfg --- old/python-evdev-1.1.0/setup.cfg 2018-08-27 21:11:25.000000000 +0200 +++ new/python-evdev-1.1.2/setup.cfg 2018-09-01 19:45:42.000000000 +0200 @@ -1,5 +1,5 @@ [bumpversion] -current_version = 1.1.0 +current_version = 1.1.2 message = Bump version: {current_version} -> {new_version} commit = True tag = True diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-evdev-1.1.0/setup.py new/python-evdev-1.1.2/setup.py --- old/python-evdev-1.1.0/setup.py 2018-08-27 21:11:25.000000000 +0200 +++ new/python-evdev-1.1.2/setup.py 2018-09-01 19:45:42.000000000 +0200 @@ -44,7 +44,7 @@ #----------------------------------------------------------------------------- kw = { 'name': 'evdev', - 'version': '1.1.0', + 'version': '1.1.2', 'description': 'Bindings to the Linux input handling subsystem', 'long_description': open(pjoin(here, 'README.rst')).read(),
