Part of bzrlib.directory_service View In Hierarchy
Directory services may be registered via the standard Registry methods. They will be invoked if their key is a prefix of the supplied URL.
Each item registered should be a factory of objects that provide a look_up method, as invoked by dereference. Specifically, look_up should accept a name and URL, and return a URL.
Method | dereference | Dereference a supplied URL if possible. |
Inherited from Registry:
Method | __init__ | Create a new Registry. |
Method | register | Register a new object to a name. |
Method | register_lazy | Register a new object to be loaded on request. |
Method | get | Return the object register()'ed to the given key. |
Method | get_prefix | Return an object whose key is a prefix of the supplied value. |
Method | get_help | Get the help text associated with the given key |
Method | get_info | Get the extra information associated with the given key |
Method | remove | Remove a registered entry. |
Method | __contains__ | Undocumented |
Method | keys | Get a list of registered entries |
Method | iteritems | Undocumented |
Method | items | Undocumented |
Method | _add_help_and_info | Add the help and information about this key |
Method | _get_module | Return the module the object will be or was loaded from. |
Method | _get_key_or_default | Return either 'key' or the default key if key is None |
Method | _set_default_key | Undocumented |
Method | _get_default_key | Undocumented |
URLs that match a registered directory service prefix are looked up in it. Non-matching urls are returned verbatim.
This is applied only once; the resulting URL must not be one that requires further dereferencing.
Parameters | url | The URL to dereference |
Returns | The dereferenced URL if applicable, the input URL otherwise. |