Update black formatting

This commit is contained in:
sezanzeb 2024-08-06 23:40:08 +02:00 committed by Tobi
parent f5151aab27
commit b49fc30713
11 changed files with 28 additions and 57 deletions

13
.github/FUNDING.yml vendored
View File

@ -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']

View File

@ -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
analog_threshold=(
analog_threshold
if analog_threshold is not None
else self.analog_threshold,
else self.analog_threshold
),
)
def __hash__(self):

View File

@ -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,

View File

@ -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:

View File

@ -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 (

View File

@ -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

View File

@ -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:

View File

@ -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)

View File

@ -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."""

View File

@ -1,4 +1,5 @@
"""Tests that require a linux desktop environment to be running."""
import tests.test
import gi

View File

@ -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"]
)