minor cleanup

xkb
sezanzeb 3 years ago committed by sezanzeb
parent ebf1eeccb7
commit 58e3526a6e

@ -3,3 +3,7 @@
disable=
# that is the standard way to import GTK afaik
wrong-import-position
# using """ for comments highlights them in green for me and makes it
# a great way to separate stuff into multiple sections
pointless-string-statement

@ -98,7 +98,7 @@ class Injector(multiprocessing.Process):
super().__init__()
# Functions to interact with the running process:
"""Functions to interact with the running process"""
def get_state(self):
"""Get the state of the injection.
@ -141,7 +141,7 @@ class Injector(multiprocessing.Process):
self._msg_pipe[1].send(CLOSE)
self._state = STOPPED
# Process internal stuff:
"""Process internal stuff"""
def _grab_device(self, path):
"""Try to grab the device, return None if not needed/possible."""
@ -206,7 +206,10 @@ class Injector(multiprocessing.Process):
----------
input_device : evdev.InputDevice
gamepad : bool
if ABS capabilities should be removed in favor of REL
If ABS capabilities should be removed in favor of REL.
This parameter is somewhat redundant and could be derived
from input_device, but it is very useful to control this in
tests.
Returns
-------
@ -383,12 +386,6 @@ class Injector(multiprocessing.Process):
# reached otherwise.
logger.debug('asyncio coroutines ended')
def _macro_write(self, code, value, uinput):
"""Handler for macros."""
logger.spam('macro writes %s', (EV_KEY, code, value))
uinput.write(EV_KEY, code, value)
uinput.syn()
async def _event_consumer(self, source, uinput):
"""Reads input events to inject keycodes or talk to the event_producer.
@ -440,7 +437,4 @@ class Injector(multiprocessing.Process):
uinput.write(event.type, event.code, event.value)
# this already includes SYN events, so need to syn here again
logger.error(
'The consumer for "%s" stopped early',
source.path
)
logger.error('The consumer for "%s" stopped early', source.path)

@ -76,7 +76,7 @@ class Key:
flattened = ()
for key in keys:
if isinstance(key, Key):
flattened += key.keys
flattened += key.keys # pylint: disable=no-member
else:
flattened += (key,)
keys = flattened

@ -174,6 +174,9 @@ def update_verbosity(debug):
Also enable rich tracebacks in debug mode.
"""
# pylint really doesn't like what I'm doing with rich.traceback here
# pylint: disable=broad-except,import-error,import-outside-toplevel
if debug:
logger.setLevel(SPAM)

@ -17,7 +17,7 @@
<text x="22.0" y="14">pylint</text>
</g>
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
<text x="63.0" y="15" fill="#010101" fill-opacity=".3">9.76</text>
<text x="62.0" y="14">9.76</text>
<text x="63.0" y="15" fill="#010101" fill-opacity=".3">9.81</text>
<text x="62.0" y="14">9.81</text>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Loading…
Cancel
Save