From 6dba22abc55a889e0063bbf0ebdecf863110f872 Mon Sep 17 00:00:00 2001 From: Adam Stokes Date: Tue, 30 Jun 2015 17:53:12 -0400 Subject: [PATCH] fix redrawing of screen in serial mode Signed-off-by: Adam Stokes --- Makefile | 3 +++ subiquity/controllers/__init__.py | 21 +++++++++++++-------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 947744a2..0d019a69 100644 --- a/Makefile +++ b/Makefile @@ -17,6 +17,9 @@ INSTALLER_RESOURCES += $(shell find installer/resources -type f) ui-view: (PYTHONPATH=$(PYTHONPATH) bin/$(PYTHONSRC)) +ui-view-serial: + (TERM=att4424 PYTHONPATH=$(PYTHONPATH) bin/$(PYTHONSRC) --serial) + lint: echo "Running flake8 lint tests..." flake8 bin/$(PYTHONSRC) --ignore=F403 diff --git a/subiquity/controllers/__init__.py b/subiquity/controllers/__init__.py index ad788762..9bc03222 100644 --- a/subiquity/controllers/__init__.py +++ b/subiquity/controllers/__init__.py @@ -85,22 +85,27 @@ class BaseController: def run(self): if not hasattr(self, 'loop'): palette = STYLES - loop_opts = {'screen': urwid.raw_display.Screen(), - 'unhandled_input': self.header_hotkeys} + additional_opts = { + 'screen': urwid.raw_display.Screen(), + 'unhandled_input': self.header_hotkeys, + 'handle_mouse': False + } if self.opts.run_on_serial: palette = STYLES_MONO - loop_opts['screen'] = urwid.curses_display.Screen() - loop_opts['handle_mouse'] = False + additional_opts['screen'] = urwid.curses_display.Screen() else: - loop_opts['screen'].set_terminal_properties(colors=256) - loop_opts['screen'].reset_default_terminal_palette() - loop_opts['event_loop'] = AsyncioEventLoop( + additional_opts['screen'].set_terminal_properties(colors=256) + additional_opts['screen'].reset_default_terminal_palette() + additional_opts['event_loop'] = AsyncioEventLoop( loop=asyncio.get_event_loop()) self.loop = urwid.MainLoop( - self.ui, palette, **loop_opts) + self.ui, palette, **additional_opts) try: + if self.opts.run_on_serial: + self.loop.screen.start() + self.begin() self.loop.run() except: