[PATCH evemu 11/16] python: hardcode the encoding in the two places we need it
Benjamin Tissoires
benjamin.tissoires at gmail.com
Tue Aug 12 10:48:36 PDT 2014
On Mon, Aug 11, 2014 at 9:34 PM, Peter Hutterer
<peter.hutterer at who-t.net> wrote:
> Prep work for being able to deprecate evemu.const.
I don't like it that much, but I'll still apply it...
Cheers,
Benjamin
>
> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
> ---
> python/evemu/__init__.py | 3 +--
> python/evemu/base.py | 2 +-
> 2 files changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/python/evemu/__init__.py b/python/evemu/__init__.py
> index 0a639c3..f53aa25 100644
> --- a/python/evemu/__init__.py
> +++ b/python/evemu/__init__.py
> @@ -26,7 +26,6 @@ import stat
> import tempfile
>
> import evemu.base
> -import evemu.const
> import evemu.event_names
>
> __all__ = ["Device",
> @@ -281,7 +280,7 @@ class Device(object):
> Gets the name of the input device (as reported by the device).
> """
> result = self._libevemu.evemu_get_name(self._evemu_device)
> - return result.decode(evemu.const.ENCODING)
> + return result.decode("iso8859-1")
>
> @property
> def id_bustype(self):
> diff --git a/python/evemu/base.py b/python/evemu/base.py
> index fc66869..5cca150 100644
> --- a/python/evemu/base.py
> +++ b/python/evemu/base.py
> @@ -26,7 +26,7 @@ def raise_error_if(raise_error, result, func, args):
> for (num, arg) in enumerate(func.argtypes):
> # convert args to str for readable output
> if arg == c_char_p:
> - strargs.append('"%s"' % args[num].decode(evemu.const.ENCODING))
> + strargs.append('"%s"' % args[num].decode("iso8859-1"))
> elif arg == c_void_p:
> strargs.append(hex(int(args[num])))
> else:
> --
> 1.9.3
>
> _______________________________________________
> Input-tools mailing list
> Input-tools at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/input-tools
More information about the Input-tools
mailing list