Skip to content

Commit 5c7a1d1

Browse files
committed
Fix typo
1 parent 46e5181 commit 5c7a1d1

File tree

3 files changed

+20
-20
lines changed

3 files changed

+20
-20
lines changed

kittens/themes/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ def main(args: List[str]) -> None:
582582
print(handler.report_traceback_on_exit, file=sys.stderr)
583583
input('Press Enter to quit.')
584584
if handler.state is State.fetching:
585-
# asycio uses non-daemonic threads in its ThreadPoolExecutor
585+
# asyncio uses non-daemonic threads in its ThreadPoolExecutor
586586
# so we will hang here till the download completes without
587587
# os._exit
588588
os._exit(loop.return_code)

kittens/tui/handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def image_manager(self) -> ImageManagerType:
6969

7070
@property
7171
def asyncio_loop(self) -> AbstractEventLoop:
72-
return self._tui_loop.asycio_loop
72+
return self._tui_loop.asyncio_loop
7373

7474
def add_shortcut(self, action: KeyActionType, spec: Union[str, ParsedShortcut]) -> None:
7575
if not hasattr(self, '_key_shortcuts'):

kittens/tui/loop.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -197,16 +197,16 @@ def __init__(
197197
on_interrupt: Callable[[], None],
198198
on_term: Callable[[], None],
199199
) -> None:
200-
self.asycio_loop = loop
200+
self.asyncio_loop = loop
201201
self.on_winch, self.on_interrupt, self.on_term = on_winch, on_interrupt, on_term
202202

203203
def __enter__(self) -> None:
204-
self.asycio_loop.add_signal_handler(signal.SIGWINCH, self.on_winch)
205-
self.asycio_loop.add_signal_handler(signal.SIGINT, self.on_interrupt)
206-
self.asycio_loop.add_signal_handler(signal.SIGTERM, self.on_term)
204+
self.asyncio_loop.add_signal_handler(signal.SIGWINCH, self.on_winch)
205+
self.asyncio_loop.add_signal_handler(signal.SIGINT, self.on_interrupt)
206+
self.asyncio_loop.add_signal_handler(signal.SIGTERM, self.on_term)
207207

208208
def __exit__(self, *a: Any) -> None:
209-
tuple(map(self.asycio_loop.remove_signal_handler, (
209+
tuple(map(self.asyncio_loop.remove_signal_handler, (
210210
signal.SIGWINCH, signal.SIGINT, signal.SIGTERM)))
211211

212212

@@ -223,10 +223,10 @@ def __init__(
223223
if is_macos:
224224
# On macOS PTY devices are not supported by the KqueueSelector and
225225
# the PollSelector is broken, causes 100% CPU usage
226-
self.asycio_loop: asyncio.AbstractEventLoop = asyncio.SelectorEventLoop(selectors.SelectSelector())
227-
asyncio.set_event_loop(self.asycio_loop)
226+
self.asyncio_loop: asyncio.AbstractEventLoop = asyncio.SelectorEventLoop(selectors.SelectSelector())
227+
asyncio.set_event_loop(self.asyncio_loop)
228228
else:
229-
self.asycio_loop = asyncio.get_event_loop()
229+
self.asyncio_loop = asyncio.get_event_loop()
230230
self.return_code = 0
231231
self.optional_actions = optional_actions
232232
self.read_buf = ''
@@ -378,7 +378,7 @@ def _write_ready(self, handler: Handler, fd: int) -> None:
378378
written = 0
379379
if written >= total_size:
380380
self.write_buf: List[bytes] = []
381-
self.asycio_loop.remove_writer(fd)
381+
self.asyncio_loop.remove_writer(fd)
382382
self.waiting_for_writes = False
383383
handler.on_writing_finished()
384384
else:
@@ -397,7 +397,7 @@ def _write_ready(self, handler: Handler, fd: int) -> None:
397397
def quit(self, return_code: Optional[int] = None) -> None:
398398
if return_code is not None:
399399
self.return_code = return_code
400-
self.asycio_loop.stop()
400+
self.asyncio_loop.stop()
401401

402402
def loop_impl(self, handler: Handler, term_manager: TermManager, image_manager: Optional[ImageManagerType] = None) -> Optional[str]:
403403
self.write_buf = []
@@ -408,7 +408,7 @@ def loop_impl(self, handler: Handler, term_manager: TermManager, image_manager:
408408
def schedule_write(data: bytes) -> None:
409409
self.write_buf.append(data)
410410
if not self.waiting_for_writes:
411-
self.asycio_loop.add_writer(tty_fd, self._write_ready, handler, tty_fd)
411+
self.asyncio_loop.add_writer(tty_fd, self._write_ready, handler, tty_fd)
412412
self.waiting_for_writes = True
413413

414414
def handle_exception(loop: asyncio.AbstractEventLoop, context: Dict[str, Any]) -> None:
@@ -420,17 +420,17 @@ def handle_exception(loop: asyncio.AbstractEventLoop, context: Dict[str, Any]) -
420420
import traceback
421421
tb += '\n' + ''.join(traceback.format_exception(exc.__class__, exc, exc.__traceback__))
422422

423-
self.asycio_loop.set_exception_handler(handle_exception)
423+
self.asyncio_loop.set_exception_handler(handle_exception)
424424
handler._initialize(self._get_screen_size(), term_manager, schedule_write, self, debug, image_manager)
425425
with handler:
426-
self.asycio_loop.add_reader(
426+
self.asyncio_loop.add_reader(
427427
tty_fd, self._read_ready, handler, tty_fd)
428-
self.asycio_loop.add_writer(
428+
self.asyncio_loop.add_writer(
429429
tty_fd, self._write_ready, handler, tty_fd)
430-
self.asycio_loop.run_forever()
431-
self.asycio_loop.remove_reader(tty_fd)
430+
self.asyncio_loop.run_forever()
431+
self.asyncio_loop.remove_reader(tty_fd)
432432
if self.waiting_for_writes:
433-
self.asycio_loop.remove_writer(tty_fd)
433+
self.asyncio_loop.remove_writer(tty_fd)
434434
return tb
435435

436436
def loop(self, handler: Handler) -> None:
@@ -441,7 +441,7 @@ def _on_sigwinch() -> None:
441441
handler.screen_size = self._get_screen_size()
442442
handler.on_resize(handler.screen_size)
443443

444-
signal_manager = SignalManager(self.asycio_loop, _on_sigwinch, handler.on_interrupt, handler.on_term)
444+
signal_manager = SignalManager(self.asyncio_loop, _on_sigwinch, handler.on_interrupt, handler.on_term)
445445
with TermManager(self.optional_actions, handler.use_alternate_screen, handler.mouse_tracking) as term_manager, signal_manager:
446446
self._get_screen_size: ScreenSizeGetter = screen_size_function(term_manager.tty_fd)
447447
image_manager = None

0 commit comments

Comments
 (0)