Update black formatting

pull/931/head
sezanzeb 2 months ago committed by Tobi
parent f5151aab27
commit b49fc30713

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

@ -238,9 +238,11 @@ class InputConfig(BaseModel):
type=type_ if type_ is not None else self.type, type=type_ if type_ is not None else self.type,
code=code if code is not None else self.code, code=code if code is not None else self.code,
origin_hash=origin_hash if origin_hash is not None else self.origin_hash, origin_hash=origin_hash if origin_hash is not None else self.origin_hash,
analog_threshold=analog_threshold analog_threshold=(
if analog_threshold is not None analog_threshold
else self.analog_threshold, if analog_threshold is not None
else self.analog_threshold
),
) )
def __hash__(self): def __hash__(self):

@ -54,16 +54,14 @@ class Preset(Generic[MappingModel]):
# workaround for typing: https://github.com/python/mypy/issues/4236 # workaround for typing: https://github.com/python/mypy/issues/4236
@overload @overload
def __init__(self: Preset[Mapping], path: Optional[os.PathLike] = None): def __init__(self: Preset[Mapping], path: Optional[os.PathLike] = None): ...
...
@overload @overload
def __init__( def __init__(
self, self,
path: Optional[os.PathLike] = None, path: Optional[os.PathLike] = None,
mapping_factory: Type[MappingModel] = ..., mapping_factory: Type[MappingModel] = ...,
): ): ...
...
def __init__( def __init__(
self, self,

@ -121,29 +121,21 @@ def remove_timeout(func):
class DaemonProxy(Protocol): # pragma: no cover class DaemonProxy(Protocol): # pragma: no cover
"""The interface provided over the dbus.""" """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: class Daemon:

@ -373,9 +373,9 @@ class Controller:
or len(self.data_manager.active_mapping.input_combination) == 1 or len(self.data_manager.active_mapping.input_combination) == 1
): ):
return return
combination: Sequence[ combination: Sequence[InputConfig] = (
InputConfig self.data_manager.active_mapping.input_combination
] = self.data_manager.active_mapping.input_combination )
i = combination.index(input_config) i = combination.index(input_config)
if ( if (

@ -43,8 +43,7 @@ class Message(Protocol):
"""The protocol any message must follow to be sent with the MessageBroker.""" """The protocol any message must follow to be sent with the MessageBroker."""
@property @property
def message_type(self) -> MessageType: def message_type(self) -> MessageType: ...
...
# useful type aliases # useful type aliases

@ -39,14 +39,11 @@ from inputremapper.logger import logger
class Context(Protocol): class Context(Protocol):
listeners: Set[EventListener] 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: class EventReader:

@ -130,9 +130,7 @@ class Transformation:
d = 1 + k d = 1 + k
a = 1 - d a = 1 - d
b = d b = d
c = (math.sqrt(27 * x**2 + (4 * b**3) / a) + 3 ** (3 / 2) * x) ** ( c = (math.sqrt(27 * x**2 + (4 * b**3) / a) + 3 ** (3 / 2) * x) ** (1 / 3)
1 / 3
)
y = c / (2 ** (1 / 3) * math.sqrt(3) * a ** (1 / 3)) - ( y = c / (2 ** (1 / 3) * math.sqrt(3) * a ** (1 / 3)) - (
2 ** (1 / 3) * b 2 ** (1 / 3) * b
) / (math.sqrt(3) * a ** (2 / 3) * c) ) / (math.sqrt(3) * a ** (2 / 3) * c)

@ -73,8 +73,7 @@ from inputremapper.logger import logger
class EventListener(Protocol): class EventListener(Protocol):
async def __call__(self, event: evdev.InputEvent) -> None: async def __call__(self, event: evdev.InputEvent) -> None: ...
...
class ContextProtocol(Protocol): class ContextProtocol(Protocol):
@ -97,8 +96,7 @@ class NotifyCallback(Protocol):
event: InputEvent, event: InputEvent,
source: evdev.InputDevice, source: evdev.InputDevice,
suppress: bool = False, suppress: bool = False,
) -> bool: ) -> bool: ...
...
class InputEventHandler(Protocol): class InputEventHandler(Protocol):
@ -109,8 +107,7 @@ class InputEventHandler(Protocol):
event: InputEvent, event: InputEvent,
source: evdev.InputDevice, source: evdev.InputDevice,
suppress: bool = False, suppress: bool = False,
) -> bool: ) -> bool: ...
...
def reset(self) -> None: def reset(self) -> None:
"""Reset the state of the handler e.g. release any buttons.""" """Reset the state of the handler e.g. release any buttons."""

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

@ -1914,7 +1914,7 @@ class TestGui(GuiTestBase):
unknown_key = "key-1234" unknown_key = "key-1234"
self.device_selection.insert( self.device_selection.insert(
DeviceGroupEntry(self.message_broker, self.controller, None, unknown_key), DeviceGroupEntry(self.message_broker, self.controller, None, unknown_key),
0 0,
# 0, [unknown_key, None, "foo"] # 0, [unknown_key, None, "foo"]
) )

Loading…
Cancel
Save