/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/inter.py

  • Committer: Martin Pool
  • Date: 2011-05-20 14:46:02 UTC
  • mto: This revision was merged to the branch mainline in revision 5923.
  • Revision ID: mbp@canonical.com-20110520144602-bqli0t6dj01gl0pv
Various pyflakes import fixes.

Some modules were used for subclassing or at module load time, so there is no
point loading them lazily.

Some were not imported when they should be.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
"""Inter-object utility class."""
19
19
 
20
20
 
 
21
from bzrlib.errors import NoCompatibleInter
 
22
 
 
23
 
21
24
class InterObject(object):
22
25
    """This class represents operations taking place between two objects.
23
26
 
75
78
                       the InterObject instance.
76
79
        :param target: the object to be the 'target' member of
77
80
                       the InterObject instance.
 
81
 
78
82
        If an optimised worker exists it will be used otherwise
79
83
        a default Inter worker instance will be created.
80
84
        """
81
85
        for provider in reversed(klass._optimisers):
82
86
            if provider.is_compatible(source, target):
83
87
                return provider(source, target)
84
 
        return klass(source, target)
 
88
        raise NoCompatibleInter(source, target)
85
89
 
86
90
    def lock_read(self):
87
91
        """Take out a logical read lock.