1 |
commit: 0177e7d1aa9267897032d7a4c7de9c6968c5072d |
2 |
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Jul 10 00:04:58 2012 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Jul 10 00:11:02 2012 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0177e7d1 |
7 |
|
8 |
migrate emaint to use the new title and label features of the progressbar. |
9 |
|
10 |
--- |
11 |
bin/emaint | 6 ++---- |
12 |
1 files changed, 2 insertions(+), 4 deletions(-) |
13 |
|
14 |
diff --git a/bin/emaint b/bin/emaint |
15 |
index cf2ccb8..5f54f6a 100755 |
16 |
--- a/bin/emaint |
17 |
+++ b/bin/emaint |
18 |
@@ -610,19 +610,16 @@ def emaint_main(myargv): |
19 |
|
20 |
|
21 |
if action == "-c/--check": |
22 |
- status = "Checking %s for problems" |
23 |
func = "check" |
24 |
else: |
25 |
- status = "Attempting to fix %s" |
26 |
func = "fix" |
27 |
|
28 |
isatty = os.environ.get('TERM') != 'dumb' and sys.stdout.isatty() |
29 |
for task in tasks: |
30 |
- print(status % task.name()) |
31 |
inst = task() |
32 |
onProgress = None |
33 |
if isatty: |
34 |
- progressBar = portage.output.TermProgressBar() |
35 |
+ progressBar = portage.output.TermProgressBar(title="Emaint", max_desc_length=26) |
36 |
progressHandler = ProgressHandler() |
37 |
onProgress = progressHandler.onProgress |
38 |
def display(): |
39 |
@@ -632,6 +629,7 @@ def emaint_main(myargv): |
40 |
lines, progressBar.term_columns = \ |
41 |
portage.output.get_term_size() |
42 |
signal.signal(signal.SIGWINCH, sigwinch_handler) |
43 |
+ progressBar.label(func + " " + inst.name()) |
44 |
result = getattr(inst, func)(onProgress=onProgress) |
45 |
if isatty: |
46 |
# make sure the final progress is displayed |