[rfc] don't show at all non-flashing progress bar?
John A Meinel
john at arbash-meinel.com
Tue Jun 27 14:13:32 BST 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Alexander Belchenko wrote:
> I see in recent bzr.dev that progress bar is not flashing on fast
> operations (I saw Aaron's message about disabling flashing progress bar
> on first 1-2 seconds).
>
> But nevertheless progress bar is exists as string of spaces. And this
> garbage (of space strings + '\r's) is catched by my editor anyway. Can
> progress bar don't print anything at all when it try to print spaces?
>
> --
> Alexander
It has to print spaces so that it can overwrite the old lines. Also, it
does:
[=== ] more text 0/1
So you have to space over to do so.
There is another progress bar (DotsProgressBar), that is supposed to be
used when sys.stdout is not a TTY.
However, in the switch to nested progress bars we forgot to check if we
have a tty.
This patch fixes that:
=== modified file 'bzrlib/progress.py'
- --- bzrlib/progress.py 2006-06-21 02:33:40 +0000
+++ bzrlib/progress.py 2006-06-27 13:12:33 +0000
@@ -93,7 +93,7 @@
self._show_count = show_count
self._to_messages_file = to_messages_file
self._stack = []
- - self._klass = klass or TTYProgressBar
+ self._klass = klass or ProgressBar
def top(self):
if len(self._stack) != 0:
But I don't have time right now to write a test case.
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFEoS78JdeBCYSNAAMRAtQPAJ9WX+Xi2hUbXNRed/SZopziSPnNBACfQJtd
EKcFhgIeP2xoVJe12iAq48Q=
=cJfb
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list