crecord: extract most of 'main' into a sub function

There are some setup and cleanup necessary around the main code, that
setup/cleanup code needs multiple adjustments so we extract the core code into
its own function first for clarity.
This commit is contained in:
Pierre-Yves David 2017-03-26 15:05:12 +02:00
parent 35d42be491
commit 83f005a5e4

View File

@ -1616,6 +1616,10 @@ are you sure you want to review/edit and confirm the selected changes [yn]?
origsigwinchhandler = signal.signal(signal.SIGWINCH,
self.sigwinchhandler)
return self._main(stdscr)
signal.signal(signal.SIGWINCH, origsigwinchhandler)
def _main(self, stdscr):
self.stdscr = stdscr
# error during initialization, cannot be printed in the curses
# interface, it should be printed by the calling code
@ -1667,4 +1671,3 @@ are you sure you want to review/edit and confirm the selected changes [yn]?
keypressed = "foobar"
if self.handlekeypressed(keypressed):
break
signal.signal(signal.SIGWINCH, origsigwinchhandler)