python-evdev: Upgrade to 0.6.0
BUG=chrome-os-partner:51632
CQ-DEPEND=CL:345374
TEST=`emerge-oak python-evdev && \
cros deploy --root=/usr/local <device> python-evdev`
TEST=Manually run some uinput python test scripts with the 0.6.0
python-evdev module.
Change-Id: I36b90a469882450acdae70c8123bab0212beff47
Signed-off-by: Ricky Liang <jcliang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/344498
Tested-by: Horng-Shyang Liao <hs.liao@mediatek.com>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
diff --git a/dev-python/python-evdev/Manifest b/dev-python/python-evdev/Manifest
index 018b0d2..65c7819 100644
--- a/dev-python/python-evdev/Manifest
+++ b/dev-python/python-evdev/Manifest
@@ -1 +1 @@
-DIST python-evdev-0.3.1.tar.gz 25322 RMD160 632a40f480163254f48e4785b53843db07c8304d SHA1 f19f60730acb626dd82731e84b1a67ba8f590acf SHA256 f71c6306bfff90f474daca10784aab32a19db6a8a1ae9cff7ef2bc5f713c4dd1
+DIST python-evdev-0.6.0.tar.gz 77930 SHA256 2a65a1c2657a7d9b989bb4557ddd27fd4be85c46e26f74362fe5c46939d4c857 SHA512 772ab1d9b323158820bbcb9fbc5dff212fb5585ff17277c93bcc33fb737d84ce562ae2aff3e68c4c86b6894f96b579a08b1cf5419a6f827cd443d99f14b3a83f WHIRLPOOL 04837ad7138ed91cf7621c9495a3475f8856fe97707921663b99441c9c481dae2d8a7556b95addffd8d4e97190efce7754617328875b1de326813ce9e6bcace8
diff --git a/dev-python/python-evdev/files/format.patch b/dev-python/python-evdev/files/format.patch
deleted file mode 100644
index 69a443d..0000000
--- a/dev-python/python-evdev/files/format.patch
+++ /dev/null
@@ -1,254 +0,0 @@
-# Patch the 'format' syntax for Python 2.6 compatability
-diff --git a/bin/evtest.py b/bin/evtest.py
-index b99ad54..9b91e52 100755
---- a/bin/evtest.py
-+++ b/bin/evtest.py
-@@ -12,7 +12,7 @@ from evdev import ecodes, InputDevice, list_devices, AbsInfo
-
-
- usage = 'usage: evtest <device> [<type> <value>]'
--evfmt = 'time {:<16} type {} ({}), code {:<4} ({}), value {}'
-+evfmt = 'time {0:<16} type {1} ({2}), code {3:<4} ({4}), value {5}'
- device_dir = '/dev/input/'
- query_type = None
- query_value = None
-@@ -26,21 +26,21 @@ def select_device():
- dev_fmt = '{0:<3} {1.fn:<20} {1.name:<35} {1.phys}'
- dev_lns = [dev_fmt.format(n, d) for n, d in enumerate(devices)]
-
-- print('ID {:<20} {:<35} {}'.format('Device', 'Name', 'Phys'))
-+ print('ID {0:<20} {1:<35} {2}'.format('Device', 'Name', 'Phys'))
- print('-' * len(max(dev_lns, key=len)))
- print('\n'.join(dev_lns))
- print('')
-
-- choice = input('Select device [0-{}]:'.format(len(dev_lns)-1))
-+ choice = input('Select device [0-{0}]:'.format(len(dev_lns)-1))
- return devices[int(choice)]
-
-
- def print_event(e):
- if e.type == ecodes.EV_SYN:
- if e.code == ecodes.SYN_MT_REPORT:
-- print('time {:<16} +++++++++ {} ++++++++'.format(e.timestamp(), ecodes.SYN[e.code]))
-+ print('time {0:<16} +++++++++ {1} ++++++++'.format(e.timestamp(), ecodes.SYN[e.code]))
- else:
-- print('time {:<16} --------- {} --------'.format(e.timestamp(), ecodes.SYN[e.code]))
-+ print('time {0:<16} --------- {1} --------'.format(e.timestamp(), ecodes.SYN[e.code]))
- else:
- if e.type in ecodes.bytype:
- codename = ecodes.bytype[e.type][e.code]
-@@ -64,19 +64,19 @@ else:
- print(usage) ; exit(1)
-
-
--print('Device name: {.name}'.format(device))
--print('Device info: {.info}'.format(device))
--print('Repeat settings: {}'.format(device.repeat))
-+print('Device name: {0.name}'.format(device))
-+print('Device info: {0.info}'.format(device))
-+print('Repeat settings: {0}'.format(device.repeat))
-
- print('Device capabilities:')
- for type, codes in device.capabilities(verbose=True).items():
-- print(' Type {} {}:'.format(*type))
-+ print(' Type {0} {1}:'.format(*type))
- for i in codes:
- if isinstance(i[1], AbsInfo):
-- print(' Code {:<4} {}:'.format(*i[0]))
-- print(' {}'.format(i[1]))
-+ print(' Code {0:<4} {1}:'.format(*i[0]))
-+ print(' {0}'.format(i[1]))
- else:
-- print(' Code {:<4} {}'.format(*i))
-+ print(' Code {0:<4} {1}'.format(*i))
- print('')
-
-
-diff --git a/evdev/device.py b/evdev/device.py
-index 9424140..b979a0a 100644
---- a/evdev/device.py
-+++ b/evdev/device.py
-@@ -48,7 +48,7 @@ class AbsInfo(_AbsInfo):
- pass
-
- def __str__(self):
-- return 'val {}, min {}, max {}, fuzz {}, flat {}, res {}'.format(*self)
-+ return 'val {0}, min {1}, max {2}, fuzz {3}, flat {4}, res {5}'.format(*self)
-
-
- class KbdInfo(_KbdInfo):
-@@ -64,12 +64,12 @@ class KbdInfo(_KbdInfo):
- '''
-
- def __str__(self):
-- return 'repeat {}, delay {}'.format(*self)
-+ return 'repeat {0}, delay {1}'.format(*self)
-
-
- class DeviceInfo(_DeviceInfo):
- def __str__(self):
-- msg = 'bus: {:04x}, product {:04x}, vendor {:04x}, version {:04x}'
-+ msg = 'bus: {0:04x}, product {1:04x}, vendor {2:04x}, version {3:04x}'
- return msg.format(*self)
-
-
-@@ -185,12 +185,12 @@ class InputDevice(object):
- return self.info == o.info
-
- def __str__(self):
-- msg = 'device {}, name "{}", phys "{}"'
-+ msg = 'device {0}, name "{1}", phys "{2}"'
- return msg.format(self.fn, self.name, self.phys)
-
- def __repr__(self):
- msg = (self.__class__.__name__, self.fn)
-- return '{}({!r})'.format(*msg)
-+ return '{0}({1!r})'.format(*msg)
-
- def close(self):
- os.close(self.fd)
-diff --git a/evdev/events.py b/evdev/events.py
-index ed7aaa4..c75764e 100644
---- a/evdev/events.py
-+++ b/evdev/events.py
-@@ -68,11 +68,11 @@ class InputEvent(object):
- return self.sec + (self.usec / 1000000.0)
-
- def __str__(s):
-- msg = 'event at {:f}, code {:02d}, type {:02d}, val {:02d}'
-+ msg = 'event at {0:f}, code {1:02d}, type {2:02d}, val {3:02d}'
- return msg.format(s.timestamp(), s.code, s.type, s.value)
-
- def __repr__(s):
-- msg = '{}({!r}, {!r}, {!r}, {!r}, {!r})'
-+ msg = '{0}({1!r}, {2!r}, {3!r}, {4!r}, {5!r})'
- return msg.format(s.__class__.__name__,
- s.sec, s.usec, s.type, s.code, s.value)
-
-@@ -107,12 +107,12 @@ class KeyEvent(object):
- try: ks = ('up', 'down', 'hold')[self.keystate]
- except: ks = 'unknown'
-
-- msg = 'key event at {:f}, {} ({}), {}'
-+ msg = 'key event at {0:f}, {1} ({2}), {3}'
- return msg.format(self.event.timestamp(),
- self.scancode, self.keycode, ks)
-
- def __repr__(s):
-- return '{}({!r})'.format(s.__class__.__name__, s.event)
-+ return '{0}({1!r})'.format(s.__class__.__name__, s.event)
-
-
- class RelEvent(object):
-@@ -128,11 +128,11 @@ class RelEvent(object):
- self.event = event
-
- def __str__(self):
-- msg = 'relative axis event at {:f}, {} '
-+ msg = 'relative axis event at {0:f}, {1} '
- return msg.format(self.event.timestamp(), REL[self.event.code])
-
- def __repr__(s):
-- return '{}({!r})'.format(s.__class__.__name__, s.event)
-+ return '{0}({1!r})'.format(s.__class__.__name__, s.event)
-
-
- class AbsEvent(object):
-@@ -148,11 +148,11 @@ class AbsEvent(object):
- self.event = event
-
- def __str__(self):
-- msg = 'absolute axis event at {:f}, {} '
-+ msg = 'absolute axis event at {0:f}, {1} '
- return msg.format(self.event.timestamp(), ABS[self.event.code])
-
- def __repr__(s):
-- return '{}({!r})'.format(s.__class__.__name__, s.event)
-+ return '{0}({1!r})'.format(s.__class__.__name__, s.event)
-
-
- class SynEvent(object):
-@@ -168,11 +168,11 @@ class SynEvent(object):
- self.event = event
-
- def __str__(self):
-- msg = 'synchronization event at {:f}, {} '
-+ msg = 'synchronization event at {0:f}, {1} '
- return msg.format(self.event.timestamp(), SYN[self.event.code])
-
- def __repr__(s):
-- return '{}({!r})'.format(s.__class__.__name__, s.event)
-+ return '{0}({1!r})'.format(s.__class__.__name__, s.event)
-
-
- #: Used by :func:`evdev.util.categorize()`
-diff --git a/evdev/uinput.py b/evdev/uinput.py
-index 2e14a54..4a485ce 100644
---- a/evdev/uinput.py
-+++ b/evdev/uinput.py
-@@ -98,11 +98,11 @@ class UInput(object):
- # :todo:
- v = (repr(getattr(self, i)) for i in
- ('name', 'bustype', 'vendor', 'product', 'version'))
-- return '{}({})'.format(self.__class__.__name__, ', '.join(v))
-+ return '{0}({1})'.format(self.__class__.__name__, ', '.join(v))
-
- def __str__(self):
-- msg = ('name "{}", bus "{}", vendor "{:04x}", product "{:04x}", version "{:04x}"\n'
-- 'event types: {}')
-+ msg = ('name "{0}", bus "{1}", vendor "{2:04x}", product "{3:04x}", version "{4:04x}"\n'
-+ 'event types: {5}')
-
- evtypes = [i[0] for i in self.capabilities(True).keys()]
- msg = msg.format(self.name, ecodes.BUS[self.bustype], self.vendor, self.product,
-@@ -177,16 +177,16 @@ class UInput(object):
- if not stat.S_ISCHR(m):
- raise
- except:
-- msg = '"{}" does not exist or is not a character device file '\
-+ msg = '"{0}" does not exist or is not a character device file '\
- '- verify that the uinput module is loaded'
- raise UInputError(msg.format(self.devnode))
-
- if not os.access(self.devnode, os.W_OK):
-- msg = '"{}" cannot be opened for writing'
-+ msg = '"{0}" cannot be opened for writing'
- raise UInputError(msg.format(self.devnode))
-
- if len(self.name) > _uinput.maxnamelen:
-- msg = 'uinput device name must not be longer than {} characters'
-+ msg = 'uinput device name must not be longer than {0} characters'
- raise UInputError(msg.format(_uinput.maxnamelen))
-
- def _find_device(self):
-diff --git a/evdev/util.py b/evdev/util.py
-index 9d332be..52f2386 100644
---- a/evdev/util.py
-+++ b/evdev/util.py
-@@ -11,7 +11,7 @@ from evdev.events import event_factory
- def list_devices(input_device_dir='/dev/input'):
- '''List readable character devices.'''
-
-- fns = glob.glob('{}/event*'.format(input_device_dir))
-+ fns = glob.glob('{0}/event*'.format(input_device_dir))
- fns = list(filter(is_device, fns))
-
- return fns
-diff --git a/setup.py b/setup.py
-index 74fb0da..cda377e 100755
---- a/setup.py
-+++ b/setup.py
-@@ -83,9 +83,9 @@ def create_ecodes():
-
- from subprocess import check_call
-
-- print('writing ecodes.c (using {})'.format(header))
-- check_call('bash ./ecodes.sh {} > ecodes.c'.format(header),
-- cwd='{}/evdev'.format(here),
-+ print('writing ecodes.c (using {0})'.format(header))
-+ check_call('bash ./ecodes.sh {0} > ecodes.c'.format(header),
-+ cwd='{0}/evdev'.format(here),
- shell=True)
-
-
diff --git a/dev-python/python-evdev/metadata.xml b/dev-python/python-evdev/metadata.xml
new file mode 100644
index 0000000..01a9e68
--- /dev/null
+++ b/dev-python/python-evdev/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>vapier@gentoo.org</email>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">gvalkov/python-evdev</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-python/python-evdev/python-evdev-0.3.1-r2.ebuild b/dev-python/python-evdev/python-evdev-0.3.1-r2.ebuild
deleted file mode 120000
index e81e301..0000000
--- a/dev-python/python-evdev/python-evdev-0.3.1-r2.ebuild
+++ /dev/null
@@ -1 +0,0 @@
-python-evdev-0.3.1.ebuild
\ No newline at end of file
diff --git a/dev-python/python-evdev/python-evdev-0.3.1.ebuild b/dev-python/python-evdev/python-evdev-0.3.1.ebuild
deleted file mode 100644
index 2d869b9..0000000
--- a/dev-python/python-evdev/python-evdev-0.3.1.ebuild
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright 1999-2013 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: $
-
-EAPI="4"
-PYTHON_DEPEND="2"
-
-inherit distutils eutils
-
-DESCRIPTION="Python library for evdev bindings"
-HOMEPAGE="http://gvalkov.github.com/python-evdev/"
-SRC_URI="https://github.com/gvalkov/python-evdev/archive/v${PV}.tar.gz -> ${P}.tar.gz"
-
-LICENSE="BSD"
-SLOT="0"
-KEYWORDS="*"
-IUSE=""
-
-DEPEND="dev-python/setuptools"
-RDEPEND=""
-
-src_prepare() {
- epatch "${FILESDIR}/format.patch"
- distutils_src_prepare
-}
diff --git a/dev-python/python-evdev/python-evdev-0.6.0-r1.ebuild b/dev-python/python-evdev/python-evdev-0.6.0-r1.ebuild
new file mode 120000
index 0000000..af189f4
--- /dev/null
+++ b/dev-python/python-evdev/python-evdev-0.6.0-r1.ebuild
@@ -0,0 +1 @@
+python-evdev-0.6.0.ebuild
\ No newline at end of file
diff --git a/dev-python/python-evdev/python-evdev-0.6.0.ebuild b/dev-python/python-evdev/python-evdev-0.6.0.ebuild
new file mode 100644
index 0000000..ad0b683
--- /dev/null
+++ b/dev-python/python-evdev/python-evdev-0.6.0.ebuild
@@ -0,0 +1,21 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+PYTHON_COMPAT=( python{2_7,3_3,3_4} )
+
+inherit distutils-r1
+
+DESCRIPTION="Python library for evdev bindings"
+HOMEPAGE="http://python-evdev.readthedocs.org/"
+SRC_URI="https://github.com/gvalkov/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="*"
+IUSE=""
+
+DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
+
+RESTRICT="mirror"