Skip to content

Commit

Permalink
Minor changes to docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
gvalkov committed Jan 11, 2020
1 parent 05e36c2 commit 2fa3d24
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
2 changes: 2 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ Master
The default and behavior so far has been to raise ``KeyError``. If set to
``True``, the keycode will be set to the event code formatted as a hex number.

- Add ``InputDevice.set_absinfo()`` and ``InputDevice.get_absinfo()``.


1.2.0 (Apr 7, 2019)
====================
Expand Down
17 changes: 5 additions & 12 deletions evdev/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ def fn(self):
return self.path

def get_absinfo(self, axis_num):
"""
'''
Return current :class:`AbsInfo` for input device axis
Arguments
Expand All @@ -410,20 +410,14 @@ def get_absinfo(self, axis_num):
Example
-------
>>> device.get_absinfo(ecodes.ABS_X)
AbsInfo(value=1501, min=-32768, max=32767, fuzz=0, flat=128, resolution=0)
"""
'''
return AbsInfo(*_input.ioctl_EVIOCGABS(self.fd, axis_num))

def set_absinfo(self, axis_num, value=None, min=None, max=None, fuzz=None, flat=None, resolution=None):
"""
Set AbsInfo values for input device.
Only values set will be overwritten.
See :class:`AbsInfo` for more info about the arguments
'''
Update :class:`AbsInfo` values. Only specified values will be overwritten.
Arguments
---------
Expand All @@ -437,9 +431,8 @@ def set_absinfo(self, axis_num, value=None, min=None, max=None, fuzz=None, flat=
You can also unpack AbsInfo tuple that will overwrite all values
>>> device.set_absinfo(ecodes.ABS_Y, *AbsInfo(0, -2000, 2000, 0, 15, 0))
'''

"""
cur_absinfo = self.get_absinfo(axis_num)
new_absinfo = AbsInfo(value if value else cur_absinfo.value,
min if min else cur_absinfo.min,
Expand Down

0 comments on commit 2fa3d24

Please sign in to comment.