@@ -14,8 +14,8 @@ class UInputError(Exception):
1414
1515class UInput (object ):
1616 '''
17- A userland input (an `uinput`) device and that can inject input
18- events directly into the linux input subsystem.
17+ A userland input device and that can inject input events into the
18+ linux input subsystem.
1919 '''
2020
2121 __slots__ = (
@@ -29,7 +29,6 @@ def __init__(self,
2929 vendor = 0x1 , product = 0x1 , version = 0x1 , bustype = 0x3 ,
3030 devnode = '/dev/uinput' ):
3131 '''
32-
3332 :param events: the event types and codes that the uinput
3433 device will be able to inject - defaults to all
3534 key codes.
@@ -44,16 +43,16 @@ def __init__(self,
4443 :param bustype: bustype identifier.
4544
4645 .. note:: If you do not specify any events, the uinput device
47- will by default be able to inject only ``KEY_*`` and
48- ``BTN_*`` event codes.
46+ will be able to inject only ``KEY_*`` and ``BTN_*``
47+ event codes.
4948 '''
5049
51- self .name = name #: uinput device name
52- self .vendor = vendor #: device vendor identifier
53- self .product = product #: device product identifier
54- self .version = version #: device version identifier
55- self .bustype = bustype #: device bustype - eg. ``BUS_USB``
56- self .devnode = devnode #: uinput device node - eg. ``/dev/uinput/``
50+ self .name = name #: Uinput device name.
51+ self .vendor = vendor #: Device vendor identifier.
52+ self .product = product #: Device product identifier.
53+ self .version = version #: Device version identifier.
54+ self .bustype = bustype #: Device bustype - eg. ``BUS_USB``.
55+ self .devnode = devnode #: Uinput device node - eg. ``/dev/uinput/``.
5756
5857 if not events :
5958 events = {ecodes .EV_KEY : ecodes .keys .keys ()}
@@ -64,7 +63,7 @@ def __init__(self,
6463
6564 self ._verify ()
6665
67- #: open write -only, nonblocking file descriptor to the uinput devnode
66+ #: Write -only, non-blocking file descriptor to the uinput device node.
6867 self .fd = _uinput .open (devnode )
6968
7069 # set device capabilities
@@ -83,7 +82,7 @@ def __init__(self,
8382 # create uinput device
8483 _uinput .create (self .fd , name , vendor , product , version , bustype , absinfo )
8584
86- #: an :class:`InputDevice <evdev.device.InputDevice>` instance
85+ #: An :class:`InputDevice <evdev.device.InputDevice>` instance
8786 # to the fake input device
8887 self .device = self ._find_device ()
8988
@@ -104,7 +103,8 @@ def __str__(self):
104103 'event types: {}' )
105104
106105 evtypes = [i [0 ] for i in self .capabilities (True ).keys ()]
107- msg = msg .format (self .name , ecodes .BUS [self .bustype ], self .vendor , self .product ,
106+ msg = msg .format (self .name , ecodes .BUS [self .bustype ],
107+ self .vendor , self .product ,
108108 self .version , ' ' .join (evtypes ))
109109
110110 return msg
@@ -168,8 +168,10 @@ def capabilities(self, verbose=False, absinfo=True):
168168 return self .device .capabilities (verbose , absinfo )
169169
170170 def _verify (self ):
171- '''Verify that an uinput device exists and is readable and writable
172- by the current process.'''
171+ '''
172+ Verify that an uinput device exists and is readable and writable
173+ by the current process.
174+ '''
173175
174176 try :
175177 m = os .stat (self .devnode )[stat .ST_MODE ]
0 commit comments