Mercurial > hg
changeset 31929:bf6b44da1d8e
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.
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Sun, 26 Mar 2017 15:05:12 +0200 |
parents | 277b3e2d711b |
children | 7e7743a01103 |
files | mercurial/crecord.py |
diffstat | 1 files changed, 4 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/crecord.py Mon Apr 03 23:13:49 2017 +0900 +++ b/mercurial/crecord.py Sun Mar 26 15:05:12 2017 +0200 @@ -1616,6 +1616,10 @@ 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 @@ keypressed = "foobar" if self.handlekeypressed(keypressed): break - signal.signal(signal.SIGWINCH, origsigwinchhandler)