~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/local.py

  • Committer: Martin Pool
  • Date: 2010-02-27 01:34:49 UTC
  • mto: This revision was merged to the branch mainline in revision 5064.
  • Revision ID: mbp@canonical.com-20100227013449-zxostilwfoendxfv
Handle "Directory not empty" from ftp as DirectoryNotEmpty.

FtpTransport._translate_ftp_error can handle all ftp errors; there's no clear
distinction between 'temporary' and 'permament'.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 2006 Canonical Ltd
 
1
# Copyright (C) 2005-2010 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
39
39
from bzrlib.transport import LateReadError
40
40
""")
41
41
 
42
 
from bzrlib.transport import Transport, Server
 
42
from bzrlib import transport
43
43
 
44
44
 
45
45
_append_flags = os.O_CREAT | os.O_APPEND | os.O_WRONLY | osutils.O_BINARY
46
46
_put_non_atomic_flags = os.O_CREAT | os.O_TRUNC | os.O_WRONLY | osutils.O_BINARY
47
47
 
48
48
 
49
 
class LocalTransport(Transport):
 
49
class LocalTransport(transport.Transport):
50
50
    """This is the transport agent for local filesystem access."""
51
51
 
52
52
    def __init__(self, base):
554
554
            return EmulatedWin32LocalTransport(abspath)
555
555
 
556
556
 
557
 
class LocalURLServer(Server):
558
 
    """A pretend server for local transports, using file:// urls.
559
 
 
560
 
    Of course no actual server is required to access the local filesystem, so
561
 
    this just exists to tell the test code how to get to it.
562
 
    """
563
 
 
564
 
    def setUp(self):
565
 
        """Setup the server to service requests.
566
 
 
567
 
        :param decorated_transport: ignored by this implementation.
568
 
        """
569
 
 
570
 
    def get_url(self):
571
 
        """See Transport.Server.get_url."""
572
 
        return urlutils.local_path_to_url('')
573
 
 
574
 
 
575
557
def get_test_permutations():
576
558
    """Return the permutations to be used in testing."""
577
 
    return [
578
 
            (LocalTransport, LocalURLServer),
579
 
            ]
 
559
    from bzrlib.tests import test_server
 
560
    return [(LocalTransport, test_server.LocalURLServer),]