Stop declaring `object` as superclass

This syntax was only required on Python 2 and has no effect on Python 3.
This commit is contained in:
Hugo Osvaldo Barrera 2021-10-30 19:38:32 +02:00 committed by Peter F. Patel-Schneider
parent d6ba8e0b29
commit df83fd655c
8 changed files with 21 additions and 21 deletions

View File

@ -86,7 +86,7 @@ class NamedInt(int):
return 'NamedInt(%d, %r)' % (int(self), self.name) return 'NamedInt(%d, %r)' % (int(self), self.name)
class NamedInts(object): class NamedInts:
"""An ordered set of NamedInt values. """An ordered set of NamedInt values.
Indexing can be made by int or string, and will return the corresponding Indexing can be made by int or string, and will return the corresponding

View File

@ -28,7 +28,7 @@ KIND_MAP = {kind: _hidpp10.DEVICE_KIND[str(kind)] for kind in _hidpp20.DEVICE_KI
# #
class Device(object): class Device:
read_register = _hidpp10.read_register read_register = _hidpp10.read_register
write_register = _hidpp10.write_register write_register = _hidpp10.write_register

View File

@ -176,7 +176,7 @@ if x11:
displayt = Display() displayt = Display()
class RuleComponent(object): class RuleComponent:
def compile(self, c): def compile(self, c):
if isinstance(c, RuleComponent): if isinstance(c, RuleComponent):
return c return c

View File

@ -226,7 +226,7 @@ class FeatureCallError(_KwException):
# #
class FeaturesArray(object): class FeaturesArray:
"""A sequence of features supported by a HID++ 2.0 device.""" """A sequence of features supported by a HID++ 2.0 device."""
__slots__ = ('supported', 'device', 'features', 'non_features') __slots__ = ('supported', 'device', 'features', 'non_features')
assert FEATURE.ROOT == 0x0000 assert FEATURE.ROOT == 0x0000
@ -367,7 +367,7 @@ class FeaturesArray(object):
# #
class ReprogrammableKey(object): class ReprogrammableKey:
"""Information about a control present on a device with the `REPROG_CONTROLS` feature. """Information about a control present on a device with the `REPROG_CONTROLS` feature.
Ref: https://drive.google.com/file/d/0BxbRzx7vEV7eU3VfMnRuRXktZ3M/view Ref: https://drive.google.com/file/d/0BxbRzx7vEV7eU3VfMnRuRXktZ3M/view
Read-only properties: Read-only properties:
@ -578,7 +578,7 @@ class ReprogrammableKeyV4(ReprogrammableKey):
self._getCidReporting() self._getCidReporting()
class KeysArray(object): class KeysArray:
"""A sequence of key mappings supported by a HID++ 2.0 device.""" """A sequence of key mappings supported by a HID++ 2.0 device."""
__slots__ = ('device', 'keys', 'keyversion', 'cid_to_tid', 'group_cids') __slots__ = ('device', 'keys', 'keyversion', 'cid_to_tid', 'group_cids')
@ -813,7 +813,7 @@ ACTION_ID = _NamedInts(
ACTION_ID._fallback = lambda x: 'unknown:%04X' % x ACTION_ID._fallback = lambda x: 'unknown:%04X' % x
class Gesture(object): class Gesture:
gesture_index = {} gesture_index = {}
@ -869,7 +869,7 @@ class Gesture(object):
write = set write = set
class Param(object): class Param:
param_index = {} param_index = {}
def __init__(self, device, low, high): def __init__(self, device, low, high):
@ -947,7 +947,7 @@ class Spec:
return f'[{self.spec}={self.value}]' return f'[{self.spec}={self.value}]'
class Gestures(object): class Gestures:
"""Information about the gestures that a device supports. """Information about the gestures that a device supports.
Right now only some information fields are supported. Right now only some information fields are supported.
WARNING: Assumes that parameters are always global, which is not the case. WARNING: Assumes that parameters are always global, which is not the case.

View File

@ -40,7 +40,7 @@ del getLogger
# #
class _ThreadedHandle(object): class _ThreadedHandle:
"""A thread-local wrapper with different open handles for each thread. """A thread-local wrapper with different open handles for each thread.
Closing a ThreadedHandle will close all handles. Closing a ThreadedHandle will close all handles.

View File

@ -38,7 +38,7 @@ _IR = _hidpp10.INFO_SUBREGISTERS
# #
class Receiver(object): class Receiver:
"""A Unifying Receiver instance. """A Unifying Receiver instance.
The paired devices are available through the sequence interface. The paired devices are available through the sequence interface.

View File

@ -42,7 +42,7 @@ SENSITIVITY_IGNORE = 'ignore'
KIND = _NamedInts(toggle=0x01, choice=0x02, range=0x04, map_choice=0x0A, multiple_toggle=0x10, multiple_range=0x40) KIND = _NamedInts(toggle=0x01, choice=0x02, range=0x04, map_choice=0x0A, multiple_toggle=0x10, multiple_range=0x40)
class Setting(object): class Setting:
"""A setting descriptor. """A setting descriptor.
Needs to be instantiated for each specific device.""" Needs to be instantiated for each specific device."""
__slots__ = ( __slots__ = (
@ -514,7 +514,7 @@ class BitFieldWithOffsetAndMaskSetting(BitFieldSetting):
# #
class RegisterRW(object): class RegisterRW:
__slots__ = ('register', ) __slots__ = ('register', )
kind = _NamedInt(0x01, _('register')) kind = _NamedInt(0x01, _('register'))
@ -530,7 +530,7 @@ class RegisterRW(object):
return device.write_register(self.register, data_bytes) return device.write_register(self.register, data_bytes)
class FeatureRW(object): class FeatureRW:
__slots__ = ('feature', 'read_fnid', 'write_fnid', 'prefix', 'no_reply') __slots__ = ('feature', 'read_fnid', 'write_fnid', 'prefix', 'no_reply')
kind = _NamedInt(0x02, _('feature')) kind = _NamedInt(0x02, _('feature'))
@ -597,7 +597,7 @@ class FeatureRWMap(FeatureRW):
# #
class BooleanValidator(object): class BooleanValidator:
__slots__ = ('true_value', 'false_value', 'read_offset', 'mask', 'needs_current_value') __slots__ = ('true_value', 'false_value', 'read_offset', 'mask', 'needs_current_value')
kind = KIND.toggle kind = KIND.toggle
@ -710,7 +710,7 @@ class BooleanValidator(object):
return to_write return to_write
class BitFieldValidator(object): class BitFieldValidator:
__slots__ = ('byte_count', 'options') __slots__ = ('byte_count', 'options')
kind = KIND.multiple_toggle kind = KIND.multiple_toggle
@ -745,7 +745,7 @@ class BitFieldValidator(object):
return self.options return self.options
class BitFieldWithOffsetAndMaskValidator(object): class BitFieldWithOffsetAndMaskValidator:
__slots__ = ('byte_count', 'options', '_option_from_key', '_mask_from_offset', '_option_from_offset_mask') __slots__ = ('byte_count', 'options', '_option_from_key', '_mask_from_offset', '_option_from_offset_mask')
kind = KIND.multiple_toggle kind = KIND.multiple_toggle
@ -827,7 +827,7 @@ class BitFieldWithOffsetAndMaskValidator(object):
return [int(opt) if isinstance(opt, int) else opt.as_int() for opt in self.options] return [int(opt) if isinstance(opt, int) else opt.as_int() for opt in self.options]
class ChoicesValidator(object): class ChoicesValidator:
kind = KIND.choice kind = KIND.choice
"""Translates between NamedInts and a byte sequence. """Translates between NamedInts and a byte sequence.
:param choices: a list of NamedInts :param choices: a list of NamedInts
@ -939,7 +939,7 @@ class ChoicesMapValidator(ChoicesValidator):
return self._write_prefix_bytes + new_value.to_bytes(self._byte_count, 'big') return self._write_prefix_bytes + new_value.to_bytes(self._byte_count, 'big')
class RangeValidator(object): class RangeValidator:
__slots__ = ('min_value', 'max_value', 'flag', '_byte_count', 'needs_current_value') __slots__ = ('min_value', 'max_value', 'flag', '_byte_count', 'needs_current_value')
kind = KIND.range kind = KIND.range
@ -1042,7 +1042,7 @@ class MultipleRangeValidator:
return w + b'\xFF' return w + b'\xFF'
class ActionSettingRW(object): class ActionSettingRW:
"""Special RW class for settings that turn on and off special processing when a key or button is depressed""" """Special RW class for settings that turn on and off special processing when a key or button is depressed"""
def __init__(self, name, divert_setting_name): def __init__(self, name, divert_setting_name):
self.name = name self.name = name

View File

@ -672,7 +672,7 @@ def _feature_reprogrammable_keys():
return _Settings(_REPROGRAMMABLE_KEYS, rw, callback=_feature_reprogrammable_keys_callback, device_kind=(_DK.keyboard, )) return _Settings(_REPROGRAMMABLE_KEYS, rw, callback=_feature_reprogrammable_keys_callback, device_kind=(_DK.keyboard, ))
class DivertKeysRW(object): class DivertKeysRW:
def __init__(self): def __init__(self):
self.kind = _FeatureRW.kind self.kind = _FeatureRW.kind