l.c.s.TransportSFTPServer : class documentation

Part of lp.codehosting.sftp View In Hierarchy

An implementation of ISFTPServer that backs onto a Bazaar transport.

The transport must be a Twisted Transport.

Method __init__ Undocumented
Method extendedRequest See ISFTPServer.
Method makeLink See ISFTPServer.
Method openDirectory See ISFTPServer.
Method openFile See ISFTPServer.
Method readLink See ISFTPServer.
Method realPath See ISFTPServer.
Method setAttrs See ISFTPServer.
Method getAttrs See ISFTPServer.
Method gotVersion See ISFTPServer.
Method makeDirectory See ISFTPServer.
Method removeDirectory See ISFTPServer.
Method removeFile See ISFTPServer.
Method renameFile See ISFTPServer.
Static Method translateError Translate Bazaar errors to filetransfer.SFTPError instances.
Method _stat_files_in_list Stat the a list of files.
Method _format_directory_entries Produce entries suitable for returning from openDirectory.
Method _translate_stat Translate the stat result stat_val into an attributes dict.
def __init__(self, transport):
Undocumented
def extendedRequest(self, extendedName, extendedData):
See ISFTPServer.
def makeLink(self, src, dest):
See ISFTPServer.
def _stat_files_in_list(self, file_list, escaped_dir_path):
Stat the a list of files.
Parametersfile_listThe list of escaped file names.
escaped_dir_pathThe escaped path of the directory containing the files.
ReturnsA Deferred which will be called back with the list of all the stat results.
def _format_directory_entries(self, stat_results, filenames):
Produce entries suitable for returning from openDirectory.
Parametersstat_resultsA list of the results of calling stat on each file in filenames.
filenamesThe list of filenames to produce entries for.
ReturnsAn iterator of (shortname, longname, attributes).
@with_sftp_error
def openDirectory(self, path):
See ISFTPServer.
@with_sftp_error
def openFile(self, path, flags, attrs):
See ISFTPServer.
def readLink(self, path):
See ISFTPServer.
def realPath(self, relpath):
See ISFTPServer.
def setAttrs(self, path, attrs):
See ISFTPServer.

This just delegates to TransportSFTPFile's implementation.

def _translate_stat(self, stat_val):
Translate the stat result stat_val into an attributes dict.

This is very like conch.ssh.unix.SFTPServerForUnixConchUser._getAttrs, but (a) that is private and (b) we use getattr() to access the attributes as not all the Bazaar transports return full stat results.

@with_sftp_error
def getAttrs(self, path, followLinks):
See ISFTPServer.

This just delegates to TransportSFTPFile's implementation.

def gotVersion(self, otherVersion, extensionData):
See ISFTPServer.
@with_sftp_error
def makeDirectory(self, path, attrs):
See ISFTPServer.
@with_sftp_error
def removeDirectory(self, path):
See ISFTPServer.
@with_sftp_error
def removeFile(self, path):
See ISFTPServer.
@with_sftp_error
def renameFile(self, oldpath, newpath):
See ISFTPServer.
@staticmethod
def translateError(failure, func_name):
Translate Bazaar errors to filetransfer.SFTPError instances.
API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.