diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index ec0185fd..00000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1,13 +0,0 @@ -# These are supported funding model platforms - -github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] -patreon: # Replace with a single Patreon username -open_collective: # Replace with a single Open Collective username -ko_fi: jonasbosse -tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel -community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry -liberapay: # Replace with a single Liberapay username -issuehunt: # Replace with a single IssueHunt username -otechie: # Replace with a single Otechie username -lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry -custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/inputremapper/configs/input_config.py b/inputremapper/configs/input_config.py index 8d0e8384..1424962b 100644 --- a/inputremapper/configs/input_config.py +++ b/inputremapper/configs/input_config.py @@ -238,9 +238,11 @@ class InputConfig(BaseModel): type=type_ if type_ is not None else self.type, code=code if code is not None else self.code, origin_hash=origin_hash if origin_hash is not None else self.origin_hash, - analog_threshold=analog_threshold - if analog_threshold is not None - else self.analog_threshold, + analog_threshold=( + analog_threshold + if analog_threshold is not None + else self.analog_threshold + ), ) def __hash__(self): diff --git a/inputremapper/configs/preset.py b/inputremapper/configs/preset.py index dbf73ded..c1cce2f4 100644 --- a/inputremapper/configs/preset.py +++ b/inputremapper/configs/preset.py @@ -54,16 +54,14 @@ class Preset(Generic[MappingModel]): # workaround for typing: https://github.com/python/mypy/issues/4236 @overload - def __init__(self: Preset[Mapping], path: Optional[os.PathLike] = None): - ... + def __init__(self: Preset[Mapping], path: Optional[os.PathLike] = None): ... @overload def __init__( self, path: Optional[os.PathLike] = None, mapping_factory: Type[MappingModel] = ..., - ): - ... + ): ... def __init__( self, diff --git a/inputremapper/daemon.py b/inputremapper/daemon.py index 554165b7..8d9167c5 100644 --- a/inputremapper/daemon.py +++ b/inputremapper/daemon.py @@ -121,29 +121,21 @@ def remove_timeout(func): class DaemonProxy(Protocol): # pragma: no cover """The interface provided over the dbus.""" - def stop_injecting(self, group_key: str) -> None: - ... + def stop_injecting(self, group_key: str) -> None: ... - def get_state(self, group_key: str) -> InjectorState: - ... + def get_state(self, group_key: str) -> InjectorState: ... - def start_injecting(self, group_key: str, preset: str) -> bool: - ... + def start_injecting(self, group_key: str, preset: str) -> bool: ... - def stop_all(self) -> None: - ... + def stop_all(self) -> None: ... - def set_config_dir(self, config_dir: str) -> None: - ... + def set_config_dir(self, config_dir: str) -> None: ... - def autoload(self) -> None: - ... + def autoload(self) -> None: ... - def autoload_single(self, group_key: str) -> None: - ... + def autoload_single(self, group_key: str) -> None: ... - def hello(self, out: str) -> str: - ... + def hello(self, out: str) -> str: ... class Daemon: diff --git a/inputremapper/gui/controller.py b/inputremapper/gui/controller.py index f30fde5b..fd854be8 100644 --- a/inputremapper/gui/controller.py +++ b/inputremapper/gui/controller.py @@ -373,9 +373,9 @@ class Controller: or len(self.data_manager.active_mapping.input_combination) == 1 ): return - combination: Sequence[ - InputConfig - ] = self.data_manager.active_mapping.input_combination + combination: Sequence[InputConfig] = ( + self.data_manager.active_mapping.input_combination + ) i = combination.index(input_config) if ( diff --git a/inputremapper/gui/messages/message_broker.py b/inputremapper/gui/messages/message_broker.py index 18a002d1..88b425c6 100644 --- a/inputremapper/gui/messages/message_broker.py +++ b/inputremapper/gui/messages/message_broker.py @@ -43,8 +43,7 @@ class Message(Protocol): """The protocol any message must follow to be sent with the MessageBroker.""" @property - def message_type(self) -> MessageType: - ... + def message_type(self) -> MessageType: ... # useful type aliases diff --git a/inputremapper/injection/event_reader.py b/inputremapper/injection/event_reader.py index c568bb60..67e16bc0 100644 --- a/inputremapper/injection/event_reader.py +++ b/inputremapper/injection/event_reader.py @@ -39,14 +39,11 @@ from inputremapper.logger import logger class Context(Protocol): listeners: Set[EventListener] - def reset(self): - ... + def reset(self): ... - def get_notify_callbacks(self, input_event: InputEvent) -> List[NotifyCallback]: - ... + def get_notify_callbacks(self, input_event: InputEvent) -> List[NotifyCallback]: ... - def get_forward_uinput(self, origin_hash: DeviceHash) -> evdev.UInput: - ... + def get_forward_uinput(self, origin_hash: DeviceHash) -> evdev.UInput: ... class EventReader: diff --git a/inputremapper/injection/mapping_handlers/axis_transform.py b/inputremapper/injection/mapping_handlers/axis_transform.py index ce0fbf1b..0460fc36 100644 --- a/inputremapper/injection/mapping_handlers/axis_transform.py +++ b/inputremapper/injection/mapping_handlers/axis_transform.py @@ -130,9 +130,7 @@ class Transformation: d = 1 + k a = 1 - d b = d - c = (math.sqrt(27 * x**2 + (4 * b**3) / a) + 3 ** (3 / 2) * x) ** ( - 1 / 3 - ) + c = (math.sqrt(27 * x**2 + (4 * b**3) / a) + 3 ** (3 / 2) * x) ** (1 / 3) y = c / (2 ** (1 / 3) * math.sqrt(3) * a ** (1 / 3)) - ( 2 ** (1 / 3) * b ) / (math.sqrt(3) * a ** (2 / 3) * c) diff --git a/inputremapper/injection/mapping_handlers/mapping_handler.py b/inputremapper/injection/mapping_handlers/mapping_handler.py index 2d2ad16a..e610f7c0 100644 --- a/inputremapper/injection/mapping_handlers/mapping_handler.py +++ b/inputremapper/injection/mapping_handlers/mapping_handler.py @@ -73,8 +73,7 @@ from inputremapper.logger import logger class EventListener(Protocol): - async def __call__(self, event: evdev.InputEvent) -> None: - ... + async def __call__(self, event: evdev.InputEvent) -> None: ... class ContextProtocol(Protocol): @@ -97,8 +96,7 @@ class NotifyCallback(Protocol): event: InputEvent, source: evdev.InputDevice, suppress: bool = False, - ) -> bool: - ... + ) -> bool: ... class InputEventHandler(Protocol): @@ -109,8 +107,7 @@ class InputEventHandler(Protocol): event: InputEvent, source: evdev.InputDevice, suppress: bool = False, - ) -> bool: - ... + ) -> bool: ... def reset(self) -> None: """Reset the state of the handler e.g. release any buttons.""" diff --git a/tests/integration/__init__.py b/tests/integration/__init__.py index b94ff3a7..66d541b1 100644 --- a/tests/integration/__init__.py +++ b/tests/integration/__init__.py @@ -1,4 +1,5 @@ """Tests that require a linux desktop environment to be running.""" + import tests.test import gi diff --git a/tests/integration/test_gui.py b/tests/integration/test_gui.py index 318364f1..8224f58c 100644 --- a/tests/integration/test_gui.py +++ b/tests/integration/test_gui.py @@ -1914,7 +1914,7 @@ class TestGui(GuiTestBase): unknown_key = "key-1234" self.device_selection.insert( DeviceGroupEntry(self.message_broker, self.controller, None, unknown_key), - 0 + 0, # 0, [unknown_key, None, "foo"] )