~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/registry.py

  • Committer: Jelmer Vernooij
  • Date: 2011-03-10 13:52:27 UTC
  • mto: (5712.4.5 bzrdir-weave)
  • mto: This revision was merged to the branch mainline in revision 5716.
  • Revision ID: jelmer@samba.org-20110310135227-ufcw0utlwsp8r6k6
Revert registry changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
        """Get the object that was saved at creation time"""
44
44
        return self._obj
45
45
 
46
 
    def __eq__(self, other):
47
 
        if other == self.get_obj():
48
 
            return True
49
 
        if isinstance(other, self.__class__):
50
 
            return (self.get_obj() == other.get_obj())
51
 
        return False
52
 
 
53
46
 
54
47
class _LazyObjectGetter(_ObjectGetter):
55
48
    """Keep a record of a possible object.
81
74
            self._imported = True
82
75
        return super(_LazyObjectGetter, self).get_obj()
83
76
 
84
 
    def __eq__(self, other):
85
 
        if isinstance(other, self.__class__):
86
 
            return (self._member_name == other._member_name and
87
 
                    self._module_name == other._module_name)
88
 
        return super(_LazyObjectGetter, self).__eq__(other)
89
 
 
90
77
    def __repr__(self):
91
78
        return "<%s.%s object at %x, module=%r attribute=%r imported=%r>" % (
92
79
            self.__class__.__module__, self.__class__.__name__, id(self),