[merge] Registry
John Arbash Meinel
john at arbash-meinel.com
Sat Sep 9 18:45:13 BST 2006
The attached patch finishes up all the work to creating a Registry
class, which can lazily import objects and modules.
It also has direct support for help text, and extra information about
the registered object.
The basic idea is that this can become a general class that we use in
all of our other registration functionality. So stuff like Transports
can be registered using this class, including the ability to late-load them.
I also plan on using it in quite a few other areas. Like the new help
topics stuff should use Registry.
Also, this would make it easy for us to split up bzrlib/builtins.py so
that all of the command classes are actually in independent files. And
then when you register a class, you add all of the information about the
aliases that it needs. Then we can get all of that information at run
time, without having to import any of those files.
And for help text, we can actually still leave it as the doc-string on
the command class. Basically, we just write a generic help function,
which will call back into Registry.get() to grab the class object, and
then read its doc string and return it.
I'd like to get this approved so that I can start refactoring some of
the other code to use it.
John
=:->
-------------- next part --------------
A non-text attachment was scrubbed...
Name: registry.diff
Type: text/x-patch
Size: 18459 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060909/2bc909e9/attachment.bin
-------------- 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/20060909/2bc909e9/attachment.pgp
More information about the bazaar
mailing list