fixed names for NamedInts numerical values
This commit is contained in:
parent
2bfba2e399
commit
79a9048db5
|
@ -66,8 +66,6 @@ class NamedInts(object):
|
|||
def _readable_name(n):
|
||||
if not isinstance(n, str) and not isinstance(n, unicode):
|
||||
raise TypeError("expected string, got " + type(n))
|
||||
if n == n.upper():
|
||||
n = n.lstrip('_')
|
||||
return n.replace('__', '/').replace('_', ' ')
|
||||
|
||||
values = {k: NamedInt(v, _readable_name(k)) for (k, v) in kwargs.items()}
|
||||
|
@ -77,7 +75,7 @@ class NamedInts(object):
|
|||
self._fallback = None
|
||||
|
||||
@classmethod
|
||||
def range(cls, from_value, to_value, name_generator=lambda x: '_' + str(x), step=1):
|
||||
def range(cls, from_value, to_value, name_generator=lambda x: str(x), step=1):
|
||||
values = {name_generator(x): x for x in range(from_value, to_value + 1, step)}
|
||||
return NamedInts(**values)
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ _D('Touch Mouse M600')
|
|||
_D('Marathon Mouse M705',
|
||||
settings=[
|
||||
_register_smooth_scroll(0x01, true_value=0x40, mask=0x40),
|
||||
# _register_dpi(0x63, _NamedInts.range(9, 11, lambda x: '_' + str(x * 100))),
|
||||
# _register_dpi(0x63, _NamedInts.range(9, 11, lambda x: str(x * 100))),
|
||||
],
|
||||
)
|
||||
_D('Wireless Keyboard K230')
|
||||
|
@ -96,7 +96,7 @@ _D('Anywhere Mouse MX', codename='Anywhere MX',
|
|||
)
|
||||
_D('Performance Mouse MX', codename='Performance MX',
|
||||
settings=[
|
||||
_register_dpi(0x63, _NamedInts.range(0x81, 0x8F, lambda x: '_' + str((x - 0x80) * 100))),
|
||||
_register_dpi(0x63, _NamedInts.range(0x81, 0x8F, lambda x: str((x - 0x80) * 100))),
|
||||
],
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue