summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2012-08-15 16:58:46 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-08-16 11:19:02 +0100
commit4c4f714612d133dc51808ee5fe4b3ddc3d0681fa (patch)
tree09982912b602cd89720c8a4815d4fec4ce0d1d9f /bitbake
parentb95356c455ee7611cd3c0a766785a9c13fbe8f69 (diff)
downloadpoky-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.py14
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
25import xmlrpclib 25import xmlrpclib
26import logging 26import logging
27import progressbar 27import progressbar
28import signal
28import bb.msg 29import bb.msg
29from bb.ui import uihelper 30from 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
42class NonInteractiveProgress(object): 56class NonInteractiveProgress(object):
43 fobj = sys.stdout 57 fobj = sys.stdout
44 58