/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/registry.py

  • Committer: John Arbash Meinel
  • Date: 2006-10-13 00:55:26 UTC
  • mto: This revision was merged to the branch mainline in revision 2074.
  • Revision ID: john@arbash-meinel.com-20061013005526-b473dbb49c269e40
cleanup doc strings as recommended by Aaron and Martin

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
 
39
39
 
40
40
class _LazyObjectGetter(_ObjectGetter):
41
 
    """Keep a record of a future object, and on request load it."""
 
41
    """Keep a record of a possible object.
 
42
 
 
43
    When requested, load and return it.
 
44
    """
42
45
 
43
46
    __slots__ = ['_module_name', '_member_name', '_imported']
44
47
 
51
54
    def get_obj(self):
52
55
        """Get the referenced object.
53
56
 
54
 
        If not imported yet, this will import the requested module.
55
 
        Further requests will just return the already imported object.
 
57
        Upon first request, the object will be imported. Future requests will
 
58
        return the imported object.
56
59
        """
57
60
        if not self._imported:
58
61
            self._do_import()
99
102
        :param obj: The object to register.
100
103
        :param help: Help text for this entry. This may be a string or
101
104
                a callable. If it is a callable, it should take two
102
 
                parameters, this registry and the key that the help was
103
 
                registered under.
 
105
                parameters (registry, key): this registry and the key that 
 
106
                the help was registered under.
104
107
        :param info: More information for this entry. Registry.get_info()
105
 
                can be used to get this information. It is meant as an
106
 
                opaque storage location.
107
 
        :param override_existing: If True, replace the existing object
108
 
                with the new one. If False, if there is already something
109
 
                registered with the same key, raise a KeyError
 
108
                can be used to get this information. Registry treats this as an
 
109
                opaque storage location (it is defined by the caller).
 
110
        :param override_existing: Raise KeyErorr if False and something has
 
111
                already been registered for that key. If True, ignore if there
 
112
                is an existing key (always register the new value).
110
113
        """
111
114
        if not override_existing:
112
115
            if key in self._dict:
120
123
        """Register a new object to be loaded on request.
121
124
 
122
125
        :param module_name: The python path to the module. Such as 'os.path'.
123
 
        :param member_name: The member of the module to return, if empty or 
124
 
                None get() will return the module itself.
 
126
        :param member_name: The member of the module to return.  If empty or 
 
127
                None, get() will return the module itself.
125
128
        :param help: Help text for this entry. This may be a string or
126
129
                a callable.
127
130
        :param info: More information for this entry. Registry