l.s.l.c.FileUploadClient : class documentation

Part of lp.services.librarian.client View In Hierarchy

Known subclasses: lp.services.librarian.client.LibrarianClient

Simple blocking client for uploading to the librarian.
Method __init__ Undocumented
Method addFile Add a file to the librarian.
Method remoteAddFile See IFileUploadClient.
Method _connect Connect this client.
Method _close Close connection
Method _checkError Undocumented
Method _sendLine Undocumented
Method _sendHeader Undocumented
Method _getDatabaseName Undocumented
def __init__(self):
Undocumented
def _connect(self):
Connect this client.

The host and port default to what is specified in the configuration

def _close(self):
Close connection
def _checkError(self):
Undocumented
def _sendLine(self, line, check_for_error_responses=True):
Undocumented
def _sendHeader(self, name, value):
Undocumented
def addFile(self, name, size, file, contentType, expires=None, debugID=None, allow_zero_length=False):
Add a file to the librarian.
ParametersnameName to store the file as
sizeSize of the file
fileFile-like object with the content in it
contentTypemime-type, e.g. text/plain
expiresExpiry time of file. See LibrarianGarbageCollection. Set to None to only expire when it is no longer referenced.
debugIDOptional. If set, causes extra logging for this request on the server, which will be marked with the value given.
allow_zero_lengthIf True permit zero length files.
ReturnsaliasID as an integer
RaisesUploadFailedIf the server rejects the upload for some reason.
def _getDatabaseName(self, store):
Undocumented
def remoteAddFile(self, name, size, file, contentType, expires=None):
See IFileUploadClient.
API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.