Skip to content

Commit bd2a7d8

Browse files
committed
documentation fixes
1 parent 600d951 commit bd2a7d8

4 files changed

Lines changed: 22 additions & 19 deletions

File tree

‎bin/evtest.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020

2121
def select_device():
22-
'''Select a device from the list of accessible input devices.'''
22+
'''Select a device from the list of accessible input devices.'''
2323

2424
devices = [InputDevice(i) for i in reversed(list_devices(device_dir))]
2525
if not devices:

‎doc/apidoc.rst‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ API documentation
2424
.. autoclass:: evdev.uinput.UInput
2525
:members:
2626
:special-members:
27+
:member-order: groupwise
2728

2829
``util``
2930
==========

‎doc/install.rst‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ development version can be installed from github_:
2626
$ pip install evdev # latest stable version
2727
$ pip install git+git://github.com/gvalkov/python-evdev.git # latest development version
2828
29-
:mod:`evdev` can also be installed like any other `setuptools`
30-
:mod:package:
29+
:mod:`evdev` can also be installed like any other :mod:`setuptools`
30+
package.
3131

3232
.. code-block:: bash
3333

‎evdev/uinput.py‎

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ class UInputError(Exception):
1414

1515
class 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

Comments
 (0)