l.a.u.UploadHandler : class documentation

Part of lp.archiveuploader.uploadprocessor View In Hierarchy

Known subclasses: lp.archiveuploader.uploadprocessor.BuildUploadHandler, lp.archiveuploader.uploadprocessor.UserUploadHandler

Handler for processing a single upload.
Method __init__ Constructor.
Static Method forProcessor Instantiate an UploadHandler subclass for a given upload.
Method locateChangesFiles Locate .changes files in the upload directory.
Method processChangesFile Process a single changes file.
Method removeUpload Remove an upload that has succesfully been processed.
Method moveProcessedUpload Move or remove the upload depending on the status of the upload.
Method moveUpload Move the upload to the named subdir of the root, eg 'accepted'.
Static Method orderFilenames Order filenames, sorting *_source.changes before others.
def __init__(self, processor, fsroot, upload):
Constructor.
ParametersprocessorThe UploadProcessor that requested processing the upload.
fsrootPath to the directory containing the upload directory
uploadName of the directory containing the upload.
@staticmethod
def forProcessor(processor, fsroot, upload, build=None):
Instantiate an UploadHandler subclass for a given upload.
ParametersprocessorThe UploadProcessor that requested processing the upload.
fsrootPath to the directory containing the upload directory
uploadName of the directory containing the upload.
buildOptional; the build that produced the upload.
def locateChangesFiles(self):
Locate .changes files in the upload directory.

Return .changes files sorted with *_source.changes first. This
is important to us, as in an upload containing several changes files,
it's possible the binary ones will depend on the source ones, so
the source ones should always be considered first.
def processChangesFile(self, changes_file, logger=None):
Process a single changes file.

This is done by obtaining the appropriate upload policy (according to command-line options), creating a NascentUpload object and calling its process method.

We obtain the context for this processing from the relative path, within the upload folder, of this changes file. This influences our creation both of upload policy and the NascentUpload object.

See nascentupload.py for the gory details.

Returns a value from UploadStatusEnum, or re-raises an exception from NascentUpload.

Parameterschanges_filefilename of the changes file to process.
loggerlogger to use for processing.
Returnsan UploadStatusEnum value
def removeUpload(self, logger):
Remove an upload that has succesfully been processed.
ParametersloggerThe logger to use for logging results.
def moveProcessedUpload(self, destination, logger):
Move or remove the upload depending on the status of the upload.
ParametersdestinationAn UploadStatusEnum value.
loggerThe logger to use for logging results.
def moveUpload(self, subdir_name, logger):
Move the upload to the named subdir of the root, eg 'accepted'.
Parameterssubdir_nameName of the subdirectory to move to.
loggerThe logger to use for logging results.
@staticmethod
def orderFilenames(fnames):
Order filenames, sorting *_source.changes before others.

Aside from that, a standard string sort.
API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.