1 |
Author: zmedico |
2 |
Date: 2010-01-29 18:43:21 +0000 (Fri, 29 Jan 2010) |
3 |
New Revision: 15224 |
4 |
|
5 |
Modified: |
6 |
main/branches/2.1.7/pym/_emerge/JobStatusDisplay.py |
7 |
Log: |
8 |
Use get_term_size() to adjust to current terminal width. Thanks to Dror Levin |
9 |
<spatz@g.0> for the initial patch. (trunk r15156) |
10 |
|
11 |
Modified: main/branches/2.1.7/pym/_emerge/JobStatusDisplay.py |
12 |
=================================================================== |
13 |
--- main/branches/2.1.7/pym/_emerge/JobStatusDisplay.py 2010-01-29 18:43:08 UTC (rev 15223) |
14 |
+++ main/branches/2.1.7/pym/_emerge/JobStatusDisplay.py 2010-01-29 18:43:21 UTC (rev 15224) |
15 |
@@ -22,7 +22,6 @@ |
16 |
class JobStatusDisplay(object): |
17 |
|
18 |
_bound_properties = ("curval", "failed", "running") |
19 |
- _jobs_column_width = 48 |
20 |
|
21 |
# Don't update the display unless at least this much |
22 |
# time has passed, in units of seconds. |
23 |
@@ -48,7 +47,12 @@ |
24 |
object.__setattr__(self, "_changed", False) |
25 |
object.__setattr__(self, "_displayed", False) |
26 |
object.__setattr__(self, "_last_display_time", 0) |
27 |
- object.__setattr__(self, "width", 80) |
28 |
+ |
29 |
+ width = portage.output.get_term_size()[1] |
30 |
+ if width <= 0 or width > 80: |
31 |
+ width = 80 |
32 |
+ object.__setattr__(self, "width", width) |
33 |
+ object.__setattr__(self, "_jobs_column_width", width - 32) |
34 |
self.reset() |
35 |
|
36 |
isatty = hasattr(self.out, "isatty") and self.out.isatty() |