builtins: self.outf.write vs trace.note

Gordon Tyler gordon at doxxx.net
Fri Nov 13 22:43:13 GMT 2009


On 11/13/2009 4:34 PM, Gioele Barabucci wrote:
> I documented this distinction in HACKING.txt, together with
> UIFactory.show_{message,warning}. [1]
>
> However, looking at how the code uses trace.note and ui_factory.note, I
> cannot really grasp the difference between the two. I see trace.note as a
> vehicle for messages that are not important enough wrt the running command
> to be displayed but noteworthy enough to be saved in the log (and displayed
> on stderr) like "I'm saving this URL for later use". On the contrary,
> ui_factory.note is for messages that are part of the command itself like
> "starting upgrade from version X to Y" in "bzr upgrade". Am I right?

Except TextUIFactory doesn't look like it pays any attention to the 
--quiet option. Only a few things use ui_factory.note, nothing uses 
ui_factory.show_error/etc. and quite a few things use 
ui_factory.nested_progressbar. It looks like an incomplete attempt to 
formalize the UI.

For the moment, I'm converting the appropriate outf.write calls to note 
calls. If and when it is decided what to do about ui_factory, these 
changes can be built upon since one could then define a replacement note 
function that calls into ui.ui_factory.note and none of the actual 
call-sites will have to change.

Ciao,
Gordon



More information about the bazaar mailing list