mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-08 22:28:24 +02:00
Make mypy 1.11 happy
This commit is contained in:
@@ -317,8 +317,10 @@ def write_remote_control_protocol_docs() -> None: # {{{
|
|||||||
else:
|
else:
|
||||||
title = f'{title} (optional)'
|
title = f'{title} (optional)'
|
||||||
p(f':code:`{title}`')
|
p(f':code:`{title}`')
|
||||||
p(' ', desc), p()
|
p(' ', desc)
|
||||||
p(), p()
|
p()
|
||||||
|
p()
|
||||||
|
p()
|
||||||
|
|
||||||
with open('generated/rc.rst', 'w') as f:
|
with open('generated/rc.rst', 'w') as f:
|
||||||
p = partial(print, file=f)
|
p = partial(print, file=f)
|
||||||
|
|||||||
@@ -48,10 +48,12 @@ def setup_debug_print() -> bool:
|
|||||||
|
|
||||||
|
|
||||||
def send_to_kitten(x: Any) -> None:
|
def send_to_kitten(x: Any) -> None:
|
||||||
|
f = sys.__stdout__
|
||||||
|
assert f is not None
|
||||||
try:
|
try:
|
||||||
sys.__stdout__.buffer.write(json.dumps(x).encode())
|
f.buffer.write(json.dumps(x).encode())
|
||||||
sys.__stdout__.buffer.write(b'\n')
|
f.buffer.write(b'\n')
|
||||||
sys.__stdout__.buffer.flush()
|
f.buffer.flush()
|
||||||
except BrokenPipeError:
|
except BrokenPipeError:
|
||||||
raise SystemExit('Pipe to kitten was broken while sending data to it')
|
raise SystemExit('Pipe to kitten was broken while sending data to it')
|
||||||
|
|
||||||
|
|||||||
@@ -836,8 +836,8 @@ class Boss:
|
|||||||
focused_os_window = os_window_id
|
focused_os_window = os_window_id
|
||||||
if opts.background_opacity != get_options().background_opacity:
|
if opts.background_opacity != get_options().background_opacity:
|
||||||
self._set_os_window_background_opacity(os_window_id, opts.background_opacity)
|
self._set_os_window_background_opacity(os_window_id, opts.background_opacity)
|
||||||
if data.get('notify_on_os_window_death'):
|
if n := data.get('notify_on_os_window_death'):
|
||||||
self.os_window_death_actions[os_window_id] = partial(self.notify_on_os_window_death, data['notify_on_os_window_death'])
|
self.os_window_death_actions[os_window_id] = partial(self.notify_on_os_window_death, n)
|
||||||
if focused_os_window > 0:
|
if focused_os_window > 0:
|
||||||
focus_os_window(focused_os_window, True, activation_token)
|
focus_os_window(focused_os_window, True, activation_token)
|
||||||
elif activation_token and is_wayland() and os_window_id:
|
elif activation_token and is_wayland() and os_window_id:
|
||||||
|
|||||||
Reference in New Issue
Block a user