summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre-Yves David <pierre-yves.david@ens-lyon.org>2017-03-26 15:05:12 +0200
committerAndrej Shadura <andrew@shadura.me>2018-07-03 21:23:54 +0200
commit376c40291e9dce0e155fb77609e096559f015706 (patch)
tree145d13387bf0ccb22dca232fcf23b5491fa495b9
parentc07ebd7fb720e02dfc68473b5d4f19400bf00a0a (diff)
chunk_selector: extract most of 'main' into a sub function
-rw-r--r--git_crecord/chunk_selector.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/git_crecord/chunk_selector.py b/git_crecord/chunk_selector.py
index 58febe4..fd235c9 100644
--- a/git_crecord/chunk_selector.py
+++ b/git_crecord/chunk_selector.py
@@ -1112,16 +1112,20 @@ Are you sure you want to review/edit and confirm the selected changes [yN]?
Method to be wrapped by curses.wrapper() for selecting chunks.
"""
+ self.opts = opts
+
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
self.initerr = None
self.yscreensize, self.xscreensize = self.stdscr.getmaxyx()
- self.opts = opts
-
curses.start_color()
curses.use_default_colors()