Skip to content

Commit

Permalink
mypy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
elParaguayo committed Jun 9, 2024
1 parent f06d9c9 commit d4767a5
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
4 changes: 3 additions & 1 deletion libqtile/backend/wayland/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,8 @@ def configure_node_opacity(self, node: SceneNode) -> None:
return
if node.type == SceneNodeType.BUFFER:
scene_buffer = SceneBuffer.from_node(node)
if scene_buffer is None:
return
win = self.win_from_node(node)
scene_buffer.set_opacity(win.opacity)
elif node.type == SceneNodeType.TREE:
Expand Down Expand Up @@ -660,7 +662,7 @@ def _create_implicit_grab(self, time: int, surface: Surface, sx: float, sy: floa
self._release_implicit_grab(time)
logger.debug("Creating implicit grab.")
self._implicit_grab = ImplicitGrab(
self, surface, self.cursor.x, self.cursor.y, int(sx), int(sy)
self, surface, int(self.cursor.x), int(self.cursor.y), int(sx), int(sy)
)

def _on_cursor_axis(self, _listener: Listener, event: pointer.PointerAxisEvent) -> None:
Expand Down
6 changes: 3 additions & 3 deletions libqtile/resources/sleep.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ async def _start(self) -> None:
self.take()

# Finally, attach a handler for the "PrepareForSleep" signal
self.login.on_prepare_for_sleep(self.prepare_for_sleep)
self.login.on_prepare_for_sleep(self.prepare_for_sleep) # type: ignore[attr-defined]

def take(self) -> None:
"""Create an inhibitor."""
Expand All @@ -133,7 +133,7 @@ def take(self) -> None:
async def _take(self) -> None:
"""Sends the request to dbus to create an inhibitor."""
# The "Inhibit" method returns a file descriptor
self.fd = await self.login.call_inhibit(
self.fd = await self.login.call_inhibit( # type: ignore[attr-defined]
"sleep", # what: The lock type. We only want to inhibit sleep
"qtile", # who: Name of program requesting inhibitor
"Run hooked functions before suspend", # why: Short description of purpose
Expand Down Expand Up @@ -196,7 +196,7 @@ def stop(self) -> None:
self.release()

if self.sleep or self.resume:
self.login.off_prepare_for_sleep(self.prepare_for_sleep)
self.login.off_prepare_for_sleep(self.prepare_for_sleep) # type: ignore[attr-defined]

self.bus.disconnect()
self.bus = None
Expand Down
4 changes: 3 additions & 1 deletion libqtile/scripts/migrations/rename_unspecified.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ def is_interesting_arg(arg):

return updated_node.with_changes(args=args)

def strip_unspecified_imports(self, original_node, updated_node) -> cst.Import:
def strip_unspecified_imports(
self, original_node, updated_node
) -> cst.Import | cst.RemovalSentinel:
new_names = list(filter(lambda n: n.name.value != "UNSPECIFIED", original_node.names))
if len(new_names) == len(original_node.names):
return original_node
Expand Down
8 changes: 4 additions & 4 deletions libqtile/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,10 +459,10 @@ async def _send_dbus_message(
msg = await bus.call(
Message(
message_type=message_type,
destination=destination,
interface=interface,
path=path,
member=member,
destination=destination, # type: ignore[arg-type]
interface=interface, # type: ignore[arg-type]
path=path, # type: ignore[arg-type]
member=member, # type: ignore[arg-type]
signature=signature,
body=body,
)
Expand Down

0 comments on commit d4767a5

Please sign in to comment.