diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-08-15 16:58:46 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-08-16 11:19:02 +0100 |
commit | 4c4f714612d133dc51808ee5fe4b3ddc3d0681fa (patch) | |
tree | 09982912b602cd89720c8a4815d4fec4ce0d1d9f /bitbake | |
parent | b95356c455ee7611cd3c0a766785a9c13fbe8f69 (diff) | |
download | poky-4c4f714612d133dc51808ee5fe4b3ddc3d0681fa.tar.gz |
bitbake: knotty: Chain the WINCH signal handler in progressbar so any other handler is preserved and called
(Bitbake rev: 7753e075dbeee471b9ceb34f1e3165aa656932ed)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/bb/ui/knotty.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py index 9f51823912..34b5969e6b 100644 --- a/bitbake/lib/bb/ui/knotty.py +++ b/bitbake/lib/bb/ui/knotty.py | |||
@@ -25,6 +25,7 @@ import sys | |||
25 | import xmlrpclib | 25 | import xmlrpclib |
26 | import logging | 26 | import logging |
27 | import progressbar | 27 | import progressbar |
28 | import signal | ||
28 | import bb.msg | 29 | import bb.msg |
29 | from bb.ui import uihelper | 30 | from bb.ui import uihelper |
30 | 31 | ||
@@ -37,8 +38,21 @@ class BBProgress(progressbar.ProgressBar): | |||
37 | widgets = [progressbar.Percentage(), ' ', progressbar.Bar(), ' ', | 38 | widgets = [progressbar.Percentage(), ' ', progressbar.Bar(), ' ', |
38 | progressbar.ETA()] | 39 | progressbar.ETA()] |
39 | 40 | ||
41 | try: | ||
42 | self._resize_default = signal.getsignal(signal.SIGWINCH) | ||
43 | except: | ||
44 | self._resize_default = None | ||
40 | progressbar.ProgressBar.__init__(self, maxval, [self.msg + ": "] + widgets) | 45 | progressbar.ProgressBar.__init__(self, maxval, [self.msg + ": "] + widgets) |
41 | 46 | ||
47 | def _handle_resize(self, signum, frame): | ||
48 | progressbar.ProgressBar._handle_resize(self, signum, frame) | ||
49 | if self._resize_default: | ||
50 | self._resize_default(signum, frame) | ||
51 | def finish(self): | ||
52 | progressbar.ProgressBar.finish(self) | ||
53 | if self._resize_default: | ||
54 | signal.signal(signal.SIGWINCH, self._resize_default) | ||
55 | |||
42 | class NonInteractiveProgress(object): | 56 | class NonInteractiveProgress(object): |
43 | fobj = sys.stdout | 57 | fobj = sys.stdout |
44 | 58 | ||