22
33import os
44import fcntl
5-
6- from select import select
7- from collections import namedtuple
5+ import functools
6+ import select
7+ import collections
88
99from evdev import _input , _uinput , ecodes , util
1010from evdev .events import InputEvent
@@ -15,9 +15,14 @@ class EvdevError(Exception):
1515 pass
1616
1717#--------------------------------------------------------------------------
18- _AbsInfo = namedtuple ('AbsInfo' , ['value' , 'min' , 'max' , 'fuzz' , 'flat' , 'resolution' ])
19- _KbdInfo = namedtuple ('KbdInfo' , ['repeat' , 'delay' ])
20- _DeviceInfo = namedtuple ('DeviceInfo' , ['bustype' , 'vendor' , 'product' , 'version' ])
18+ _AbsInfo = collections .namedtuple (
19+ 'AbsInfo' , ['value' , 'min' , 'max' , 'fuzz' , 'flat' , 'resolution' ])
20+
21+ _KbdInfo = collections .namedtuple (
22+ 'KbdInfo' , ['repeat' , 'delay' ])
23+
24+ _DeviceInfo = collections .namedtuple (
25+ 'DeviceInfo' , ['bustype' , 'vendor' , 'product' , 'version' ])
2126
2227
2328class AbsInfo (_AbsInfo ):
@@ -219,6 +224,7 @@ def need_write(func):
219224 Decorator that raises :class:`EvdevError` if there is no write access to the
220225 input device.
221226 '''
227+ @functools .wraps (func )
222228 def wrapper (* args ):
223229 fd = args [0 ].fd
224230 if fcntl .fcntl (fd , fcntl .F_GETFL ) & os .O_RDWR :
0 commit comments