X Tutup
Skip to content

Commit 1cc547b

Browse files
committed
Rename get_absinfo() to absinfo() for consistency with the other poorly named methods
1 parent c115d5b commit 1cc547b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

docs/changelog.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Master
1414
The default and behavior so far has been to raise ``KeyError``. If set to
1515
``True``, the keycode will be set to the event code formatted as a hex number.
1616

17-
- Add ``InputDevice.set_absinfo()`` and ``InputDevice.get_absinfo()``.
17+
- Add ``InputDevice.set_absinfo()`` and ``InputDevice.absinfo()``.
1818

1919
- Instruct the asyncio event loop to stop monitoring the fd of the input device
2020
when the device is closed.

evdev/device.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ def fn(self):
400400
warnings.warn(msg, DeprecationWarning, stacklevel=2)
401401
return self.path
402402

403-
def get_absinfo(self, axis_num):
403+
def absinfo(self, axis_num):
404404
'''
405405
Return current :class:`AbsInfo` for input device axis
406406
@@ -411,7 +411,7 @@ def get_absinfo(self, axis_num):
411411
412412
Example
413413
-------
414-
>>> device.get_absinfo(ecodes.ABS_X)
414+
>>> device.absinfo(ecodes.ABS_X)
415415
AbsInfo(value=1501, min=-32768, max=32767, fuzz=0, flat=128, resolution=0)
416416
'''
417417
return AbsInfo(*_input.ioctl_EVIOCGABS(self.fd, axis_num))
@@ -434,7 +434,7 @@ def set_absinfo(self, axis_num, value=None, min=None, max=None, fuzz=None, flat=
434434
>>> device.set_absinfo(ecodes.ABS_Y, *AbsInfo(0, -2000, 2000, 0, 15, 0))
435435
'''
436436

437-
cur_absinfo = self.get_absinfo(axis_num)
437+
cur_absinfo = self.absinfo(axis_num)
438438
new_absinfo = AbsInfo(value if value else cur_absinfo.value,
439439
min if min else cur_absinfo.min,
440440
max if max else cur_absinfo.max,

0 commit comments

Comments
 (0)
X Tutup