~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/sftp.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-09-19 03:52:02 UTC
  • mfrom: (2018.1.11 bzr+ssh:// testing)
  • Revision ID: pqm@pqm.ubuntu.com-20060919035202-8174b4dc7ff91add
(Andrew Bennetts, Robert Collins) Add bzr+ssh:// url support and turn the smart server into a anonymous readonly server by default.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1022
1022
class SFTPServer(Server):
1023
1023
    """Common code for SFTP server facilities."""
1024
1024
 
1025
 
    def __init__(self):
 
1025
    def __init__(self, server_interface=StubServer):
1026
1026
        self._original_vendor = None
1027
1027
        self._homedir = None
1028
1028
        self._server_homedir = None
1029
1029
        self._listener = None
1030
1030
        self._root = None
1031
1031
        self._vendor = ssh.ParamikoVendor()
 
1032
        self._server_interface = server_interface
1032
1033
        # sftp server logs
1033
1034
        self.logs = []
1034
1035
        self.add_latency = 0
1059
1060
        f.close()
1060
1061
        host_key = paramiko.RSAKey.from_private_key_file(key_file)
1061
1062
        ssh_server.add_server_key(host_key)
1062
 
        server = StubServer(self)
 
1063
        server = self._server_interface(self)
1063
1064
        ssh_server.set_subsystem_handler('sftp', paramiko.SFTPServer,
1064
1065
                                         StubSFTPServer, root=self._root,
1065
1066
                                         home=self._server_homedir)