summaryrefslogtreecommitdiff
path: root/urwid/curses_display.py
diff options
context:
space:
mode:
Diffstat (limited to 'urwid/curses_display.py')
-rwxr-xr-xurwid/curses_display.py26
1 files changed, 4 insertions, 22 deletions
diff --git a/urwid/curses_display.py b/urwid/curses_display.py
index 758d621..441042e 100755
--- a/urwid/curses_display.py
+++ b/urwid/curses_display.py
@@ -102,12 +102,10 @@ class Screen(BaseScreen, RealTerminal):
self._mouse_tracking_enabled = enable
- def start(self):
+ def _start(self):
"""
Initialize the screen and input mode.
"""
- assert self._started == False
-
self.s = curses.initscr()
self.has_color = curses.has_colors()
if self.has_color:
@@ -130,15 +128,12 @@ class Screen(BaseScreen, RealTerminal):
if not self._signal_keys_set:
self._old_signal_keys = self.tty_signal_keys()
- super(Screen, self).start()
-
+ super(Screen, self)._start()
- def stop(self):
+ def _stop(self):
"""
Restore the screen.
"""
- if self._started == False:
- return
curses.echo()
self._curs_set(1)
try:
@@ -149,21 +144,8 @@ class Screen(BaseScreen, RealTerminal):
if self._old_signal_keys:
self.tty_signal_keys(*self._old_signal_keys)
- super(Screen, self).stop()
-
+ 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):
"""