Python 3 awareness, cleanups, _call replacements

Daniel Martin consume.noise at gmail.com
Mon Jan 6 09:38:00 PST 2014


Hi folks,

this is the second version of a series to make the Python stuff version
3 aware. In this version I don't bump the Python requirement to 2.7.
Instead, I've made sure that a `make test` runs fine with Python
2.6(.8), 2.7(.6) and 3.3(.3).

The first 11 patches are already known. I've incorporated the comments
from Peter and adjusted the patches if necessary for max. Python
compatibility.

Patch 12 to 19 are new. First there're some cleanups, then 15 to 17 drop
the _call() functions (and friends) and replace the whole functionallity
with new wrappers for libc and libevemu API calls.
Ctypes already knew a way to add a callback for return value checking.
Using it might be the most important change to make calls into the
shared libraries look better.

While adding the wrappers, I've stumbled across evemu_play_one(). Unlike
the other comparable evemu_... functions it didn't return a negative
value on error, but a positive one. I don't know if you like this API
change.

As always: Comments are welcome.


Cheers,
    Daniel

[PATCH evemu 01/19] Make it possible to overwrite python binary via
[PATCH evemu 02/19] py: Replace print statement with function call
[PATCH evemu 03/19] py: Don't use find_library for libevemu.so
[PATCH evemu 04/19] tests: Replace tab with spaces
[PATCH evemu 05/19] py: Raise statement takes one argument
[PATCH evemu 06/19] py: Fix file opening
[PATCH evemu 07/19] py: Fix file object detection
[PATCH evemu 08/19] py: Add _callstr() - returns str object
[PATCH evemu 09/19] tests: Open temporary device file in text mode
[PATCH evemu 10/19] tests: Fix tests with fixed lists
[PATCH evemu 11/19] py: Change has_prop() and has_event() to return
[PATCH evemu 12/19] py: Remove unused constants from const.py
[PATCH evemu 13/19] py: Generate complete dicts in event_names.py
[PATCH evemu 14/19] py: Cleanup imports, make attr usage more obvious
[PATCH evemu 15/19] py: Add base class LibraryWrapper
[PATCH evemu 16/19] py: Add and use wrapper for libc calls
[PATCH evemu 17/19] py: Add and use wrapper for libevemu calls
[PATCH evemu 18/19] tests: Compare vendor id with int not str
[PATCH evemu 19/19] Make evemu_play_one() return negative value on


More information about the Input-tools mailing list