Coding style.
This commit is contained in:
parent
4ee9f57fb6
commit
d8f1f211d1
1 changed files with 8 additions and 8 deletions
16
fill3.py
16
fill3.py
|
|
@ -443,6 +443,11 @@ async def _update_screen(screen_widget, appearance_changed_event):
|
|||
patch_screen(screen_widget)
|
||||
|
||||
|
||||
def on_input(urwid_screen, screen_widget):
|
||||
for event in urwid_screen.get_input():
|
||||
screen_widget.on_input_event(event)
|
||||
|
||||
|
||||
def main(loop, appearance_changed_event, screen_widget, exit_loop=None):
|
||||
appearance_changed_event.set()
|
||||
if exit_loop is None:
|
||||
|
|
@ -452,11 +457,6 @@ def main(loop, appearance_changed_event, screen_widget, exit_loop=None):
|
|||
loop.add_signal_handler(signal.SIGTERM, exit_loop)
|
||||
asyncio.ensure_future(_update_screen(screen_widget,
|
||||
appearance_changed_event))
|
||||
with terminal.hidden_cursor():
|
||||
with _urwid_screen() as urwid_screen:
|
||||
|
||||
def on_input(urwid_screen):
|
||||
for event in urwid_screen.get_input():
|
||||
screen_widget.on_input_event(event)
|
||||
loop.add_reader(sys.stdin, on_input, urwid_screen)
|
||||
loop.run_forever()
|
||||
with terminal.hidden_cursor(), _urwid_screen() as urwid_screen:
|
||||
loop.add_reader(sys.stdin, on_input, urwid_screen, screen_widget)
|
||||
loop.run_forever()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue