summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
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