diff options
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 | ||