minor cleanup

This commit is contained in:
sezanzeb 2021-02-14 12:34:56 +01:00 committed by sezanzeb
parent ebf1eeccb7
commit 58e3526a6e
5 changed files with 17 additions and 16 deletions

View File

@ -3,3 +3,7 @@
disable= disable=
# that is the standard way to import GTK afaik # that is the standard way to import GTK afaik
wrong-import-position 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

View File

@ -98,7 +98,7 @@ class Injector(multiprocessing.Process):
super().__init__() super().__init__()
# Functions to interact with the running process: """Functions to interact with the running process"""
def get_state(self): def get_state(self):
"""Get the state of the injection. """Get the state of the injection.
@ -141,7 +141,7 @@ class Injector(multiprocessing.Process):
self._msg_pipe[1].send(CLOSE) self._msg_pipe[1].send(CLOSE)
self._state = STOPPED self._state = STOPPED
# Process internal stuff: """Process internal stuff"""
def _grab_device(self, path): def _grab_device(self, path):
"""Try to grab the device, return None if not needed/possible.""" """Try to grab the device, return None if not needed/possible."""
@ -206,7 +206,10 @@ class Injector(multiprocessing.Process):
---------- ----------
input_device : evdev.InputDevice input_device : evdev.InputDevice
gamepad : bool 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 Returns
------- -------
@ -383,12 +386,6 @@ class Injector(multiprocessing.Process):
# reached otherwise. # reached otherwise.
logger.debug('asyncio coroutines ended') 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): async def _event_consumer(self, source, uinput):
"""Reads input events to inject keycodes or talk to the event_producer. """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) uinput.write(event.type, event.code, event.value)
# this already includes SYN events, so need to syn here again # this already includes SYN events, so need to syn here again
logger.error( logger.error('The consumer for "%s" stopped early', source.path)
'The consumer for "%s" stopped early',
source.path
)

View File

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

View File

@ -174,6 +174,9 @@ def update_verbosity(debug):
Also enable rich tracebacks in debug mode. 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: if debug:
logger.setLevel(SPAM) logger.setLevel(SPAM)

View File

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

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB