[MERGE] updated help topics

John Arbash Meinel john at arbash-meinel.com
Wed Nov 8 16:37:51 GMT 2006


Aaron Bentley wrote:

...

>>> Well, we still use the doc string for Commands, so I don't see us moving
>>> away from that right away.
> 
> Yes, but this is introducing a new API that works that way.  Right now,
> changing it is easy.  As soon as the API goes in, changing it is hard.
> So I'd like to get it right now.
> 
> It shouldn't be hard to change it.  Just use Foo.help instead of
> Foo.__doc__.
> 
> Aaron

Well, I decided to get into this a bit, because I want to see it merged,
and so I did 2 basic changes:

1) Switched to using a subclass of Registry. As part of doing this, I
realized that the current API wasn't what I would prefer. It was asking
the registered functions to write to a file, rather than having them
return a string. Which sort of fit with the old help api, but I don't
really think is the best way of doing it.

For one, if you have a GUI, you don't really want to have to pass in
StringIO just to get the help texts.

2) Change from using RevisionSpec.__doc__ to using
RevisionSpec.help_txt. As you say, it wasn't that hard to do. I went
with 'help_txt' because 'help' is a builtin python command. (Although
only really useful from the command line)

Attached is the new diff. I realize there are still some changes in
builtins which might conflict, but I don't think they are serious.

Plus, in my long-term goals, I'd like to refactor builtins.py to a set
of commands in bzrlib/commands/* which are all lazily registered. But
I'm not quite there yet. :)

John
=:->

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20061108/9f9bdcee/attachment.pgp 


More information about the bazaar mailing list