diff options
author | Eevee (Alex Munroe) <eevee.git@veekun.com> | 2014-06-03 17:06:44 -0700 |
---|---|---|
committer | Eevee (Alex Munroe) <eevee.git@veekun.com> | 2014-06-03 17:06:44 -0700 |
commit | f1179521fa69e73f5b4e8cf2b31294546b4bd747 (patch) | |
tree | 33edb6e67a72e7da37d4960cc9f8ada2a005b83e /urwid/curses_display.py | |
parent | 3c7d8a32484c52dc0767dc8bde19d4fcb8349dd4 (diff) | |
download | urwid-f1179521fa69e73f5b4e8cf2b31294546b4bd747.tar.gz |
Put run_wrapper in the base class; make BaseScreen.start() a contextmanager.
Diffstat (limited to 'urwid/curses_display.py')
-rwxr-xr-x | urwid/curses_display.py | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/urwid/curses_display.py b/urwid/curses_display.py index 758d621..0a6155a 100755 --- a/urwid/curses_display.py +++ b/urwid/curses_display.py @@ -130,7 +130,7 @@ class Screen(BaseScreen, RealTerminal): if not self._signal_keys_set: self._old_signal_keys = self.tty_signal_keys() - super(Screen, self).start() + return super(Screen, self).start() def stop(self): @@ -152,19 +152,6 @@ class Screen(BaseScreen, RealTerminal): super(Screen, self).stop() - def run_wrapper(self,fn): - """Call fn in fullscreen mode. Return to normal on exit. - - This function should be called to wrap your main program loop. - Exception tracebacks will be displayed in normal mode. - """ - - try: - self.start() - return fn() - finally: - self.stop() - def _setup_colour_pairs(self): """ Initialize all 63 color pairs based on the term: |