[MERGE] bundle commandline cleanup

John Arbash Meinel john at arbash-meinel.com
Thu Jun 29 16:16:49 BST 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Aaron Bentley wrote:
> John Arbash Meinel wrote:
>>>>> Doesn't that mean it will go to stdout, not stderr?
>>>
>>> You're right. You could instead do:
>>>
>>> encoding = osutils.get_terminal_encoding()
>>> encoded_url = urlutils.urlfordisplay(base, encoding).encode(encoding)
>>> sys.stderr.write('Using saved location: %s\n' % (encoded_url,))
> 
>>> But you are right, we should send it to stderr, not stdout. We probably
>>> should fix up the other occurrences, and turn this into a fully fledged
>>> helper function.
> 
> I'm happy to tweak the string for the URL, but I don't understand why we
> would want to replace note with a new helper.  My idea of note is that
> it doesn't necessarily output to stderr, just to a secondary channel.
> In a GUI app, that might be a status bar, for example.
> 
> ProgressBar also has a note() function attached to it, because Robert
> wanted to be able to associate specific notes with with the progress
> they're annotating.

That makes sense.
The problem is that 'note()' has never been defined as to what its
encoding is.
So you want to call url_for_display(, encoding=???) with whatever the
encoding of the output file is going to be.

So if note() were declared as a utf8 stream, that should be the
encoding='utf8'.

I guess for right now we can just assume that note() goes to the
terminal, and use the terminal's encoding.

> 
>>> Okay, I guess I didn't catch that part. I thought this had been merged,
>>> and was disappointed when I tried to use it, and it failed again. :)
> 
> I'll do the urlutils and last_revision fixes, but I'd like to leave
> note() as is until we've cleared up what to do about it.
> 
> Aaron

Sounds reasonable.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEo+7hJdeBCYSNAAMRAjG/AKCBdOUuD3LbguI7Jd75bYzY7+GgOQCfb22F
nGMldFNJQDv7KBWTFsUfH7c=
=JRPo
-----END PGP SIGNATURE-----




More information about the bazaar mailing list