~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/local_transport.py

  • Committer: John Arbash Meinel
  • Date: 2005-07-11 21:34:11 UTC
  • mto: (1185.11.1)
  • mto: This revision was merged to the branch mainline in revision 1396.
  • Revision ID: john@arbash-meinel.com-20050711213411-e66967f569f16716
Fixed some encoding issues, added is_remote function for Transport objects.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
        from os.path import realpath
16
16
        super(LocalTransport, self).__init__(realpath(base))
17
17
 
 
18
    def is_remote(self):
 
19
        return False
 
20
 
18
21
    def clone(self, offset=None):
19
22
        """Return a new LocalTransport with root at self.base + offset
20
23
        Because the local filesystem does not require a connection, 
45
48
        """
46
49
        if decode:
47
50
            import codecs
48
 
            codecs.open(self.abspath(relpath), 'rb', encoding='utf-8',
49
 
                    buffering=60000)
 
51
            return codecs.open(self.abspath(relpath), 'rb',
 
52
                    encoding='utf-8', buffering=60000)
50
53
        else:
51
54
            return open(self.abspath(relpath), 'rb')
52
55
 
57
60
        :param f:       File-like or string object.
58
61
        :param encode:  If True, translate the contents into utf-8 encoded text.
59
62
        """
60
 
        raise NotImplementedError
61
63
        from bzrlib.atomicfile import AtomicFile
62
64
 
63
65
        if encode: