l.s.i.a.IArchiveView(IHasBuildRecords) : interface documentation

Part of lp.soyuz.interfaces.archive View In Hierarchy

Known subclasses: lp.soyuz.interfaces.webservice.IArchive

Archive interface for operations restricted by view privilege.
TextLine title Undocumented
Int purpose Undocumented
Int sources_cached Number of source packages cached in this PPA.
Int binaries_cached Number of binary packages cached in this PPA.
Attribute package_description_cache Concatenation of the source and binary packages published in this archive. Its content is used for indexed searches across archives.
Attribute number_of_sources The number of sources published in the context archive.
Attribute number_of_binaries The number of binaries published in the context archive.
Attribute sources_size The size of sources published in the context archive.
Attribute binaries_size The size of binaries published in the context archive.
Attribute estimated_size Estimated archive size.
Int total_count The total number of builds in this archive. This counter does not include discontinued (superseded, cancelled, obsoleted) builds
Int pending_count The number of pending builds in this archive.
Int succeeded_count The number of successful builds in this archive.
Int building_count The number of active builds in this archive.
Int failed_count The number of failed builds in this archive.
Datetime date_created The time when the archive was created.
Attribute dirty_suites Suites that the next publisher run should publish regardless of pending publications.
Attribute available_processors The architectures that are available to be enabled or disabled for this archive.
Method setProcessors Set the architectures on which the archive can build.
Method getSourcesForDeletion All ISourcePackagePublishingHistory available for deletion.
Method getPublishedOnDiskBinaries Unique IBinaryPackagePublishingHistory target to this archive.
Method allowUpdatesToReleasePocket Return whether the archive allows publishing to the release pocket.
Method getComponentsForSeries Calculate the components available for use in this archive.
Method updateArchiveCache Concentrate cached information about the archive contents.
Method findDepCandidates Return matching binaries in this archive and its dependencies.
Method getPermissions Get the IArchivePermission record with the supplied details.
Method canUploadSuiteSourcePackage Check if 'person' upload 'suitesourcepackage' to 'archive'.
Method canModifySuite Decides whether or not to allow uploads for a given DS/pocket.
Method checkUploadToPocket Check if an upload to a particular archive and pocket is possible.
Method checkUpload Check if 'person' upload 'suitesourcepackage' to 'archive'.
Method verifyUpload Can 'person' upload 'sourcepackagename' to this archive ?
Method canAdministerQueue Check to see if person is allowed to administer queue items.
Method getFileByName Return the corresponding ILibraryFileAlias in this context.
Method getSourceFileByName Return the ILibraryFileAlias for a source name/version/filename.
Method getBinaryPackageRelease Find the specified IBinaryPackageRelease in the archive.
Method getBinaryPackageReleaseByFileName Return the corresponding IBinaryPackageRelease in this context.
Method requestPackageCopy Return a new PackageCopyRequest for this archive.
Method getUploadersForPackageset The ArchivePermission records for uploaders to the package set.
Method getPackagesetsForUploader The ArchivePermission records for the person's package sets.
Method getComponentsForUploader Return the components that 'person' can upload to this archive.
Method getPocketsForUploader Return the pockets that 'person' can upload to this archive.
Method getPackagesetsForSourceUploader The package set based permissions for a given source and uploader.
Method getPackagesetsForSource All package set based permissions for the given source.
Method isSourceUploadAllowed True if the person is allowed to upload the given source package.
Method updatePackageDownloadCount Update the daily download count for a given package.
Method getPackageDownloadTotal Get the total download count for a given package.
Method getPockets Return iterable containing valid pocket names for this archive.
Method getOverridePolicy Returns an instantiated IOverridePolicy for the archive.
TextLine buildd_secret The password used by the build farm to access the archive.
Method getAllPublishedBinaries All IBinaryPackagePublishingHistory target to this archive.
Method getBuildCounters Return a dictionary containing the build counters for an archive.
Method getBuildSummariesForSourceIds Return a dictionary containing a summary of the build statuses.
Method getArchiveDependency Return the IArchiveDependency object for the given dependency.
Method getAllPermissions Return all IArchivePermission records for this archive.
Method getPermissionsForPerson Return the IArchivePermission records applicable to the person.
Method getUploadersForPackage Return IArchivePermission records for the package's uploaders.
Method getUploadersForComponent Return IArchivePermission records for the component's uploaders.
Method getQueueAdminsForComponent Return IArchivePermission records for authorized queue admins.
Method getComponentsForQueueAdmin Return IArchivePermission for the person's queue admin
Method getUploadersForPocket Return IArchivePermission records for the pocket's uploaders.
Method getQueueAdminsForPocket Return IArchivePermission records for authorized queue admins.
Method getPocketsForQueueAdmin Return IArchivePermission for the person's queue admin pockets.
Method hasAnyPermission Whether or not this person has any permission at all on this
Method getPackageDownloadCount Get the IBinaryPackageDownloadCount with the given key.
Method getFilesAndSha1s Return a dictionary with the filenames and the SHA1s for each
Method copyPackage Copy a single named source into this archive.
Method copyPackages Copy multiple named sources into this archive from another.
Method _checkUpload Wrapper around checkUpload for the web service API.

Inherited from IHasBuildRecords:

Method getBuildRecords Return build records in the context it is implemented.
title =
Undocumented
purpose =
Undocumented
sources_cached =
Number of source packages cached in this PPA.
binaries_cached =
Number of binary packages cached in this PPA.
package_description_cache =
Concatenation of the source and binary packages published in this archive. Its content is used for indexed searches across archives.
number_of_sources =
The number of sources published in the context archive.
number_of_binaries =
The number of binaries published in the context archive.
sources_size =
The size of sources published in the context archive.
binaries_size =
The size of binaries published in the context archive.
estimated_size =
Estimated archive size.
total_count =
The total number of builds in this archive. This counter does not include discontinued (superseded, cancelled, obsoleted) builds
pending_count =
The number of pending builds in this archive.
succeeded_count =
The number of successful builds in this archive.
building_count =
The number of active builds in this archive.
failed_count =
The number of failed builds in this archive.
date_created =
The time when the archive was created.
dirty_suites =
Suites that the next publisher run should publish regardless of pending publications.
available_processors =
The architectures that are available to be enabled or disabled for this archive.
@call_with(True, REQUEST_USER)
@operation_parameters(List(Reference(IProcessor), True))
@export_write_operation()
@operation_for_version('devel')
def setProcessors(processors, check_permissions=False, user=None):
Set the architectures on which the archive can build.
def getSourcesForDeletion(name=None, status=None, distroseries=None):
All ISourcePackagePublishingHistory available for deletion.
Parametersname: optional source name filter (SQL LIKE)
status: PackagePublishingStatus filter, can be a sequence.
distroseries: IDistroSeries filter.
ReturnsSelectResults containing ISourcePackagePublishingHistory.
def getPublishedOnDiskBinaries(name=None, version=None, status=None, distroarchseries=None, exact_match=False):
Unique IBinaryPackagePublishingHistory target to this archive.

In spite of getAllPublishedBinaries method, this method only returns distinct binary publications inside this Archive, i.e, it excludes architecture-independent publication for other architetures than the nominatedarchindep. In few words it represents the binary files published in the archive disk pool.

Parametersname: binary name filter (exact match or SQL LIKE controlled by 'exact_match' argument).
version: binary version filter (always exact match).
status: PackagePublishingStatus filter, can be a list.
distroarchseries: IDistroArchSeries filter, can be a list.
pocket: PackagePublishingPocket filter.
exact_match: either or not filter source names by exact matching.
ReturnsSelectResults containing IBinaryPackagePublishingHistory.
def allowUpdatesToReleasePocket():
Return whether the archive allows publishing to the release pocket.

If a distroseries is stable, normally release pocket publishings are not allowed. However some archive types allow this.

ReturnsTrue or False
def getComponentsForSeries(distroseries):
Calculate the components available for use in this archive.
ReturnsAn IResultSet of IComponent objects.
def updateArchiveCache():
Concentrate cached information about the archive contents.

Group the relevant package information (source name, binary names, binary summaries and distroseries with binaries) strings in the IArchive.package_description_cache search indexes (fti).

Updates 'sources_cached' and 'binaries_cached' counters.

Also include owner 'name' and 'displayname' to avoid inpecting the Person table indexes while searching.

def findDepCandidates(distro_arch_series, pocket, component, source_package_name, dep_name):
Return matching binaries in this archive and its dependencies.

Return all published IBinaryPackagePublishingHistory records with the given name, in this archive and dependencies as specified by the given build context, using the usual archive dependency rules.

We can't just use the first, since there may be other versions published in other dependency archives.

Parametersdistro_arch_seriesthe context IDistroArchSeries.
pocketthe context PackagePublishingPocket.
componentthe context IComponent.
source_package_namethe context source package name (as text).
dep_namethe name of the binary package to look up.
Returnsa sequence of matching IBinaryPackagePublishingHistory records.
def getPermissions(person, item, perm_type):
Get the IArchivePermission record with the supplied details.
ParameterspersonAn IPerson
itemAn IComponent, ISourcePackageName
perm_typeAn ArchivePermissionType enum,
ReturnsA list of IArchivePermission records.
def canUploadSuiteSourcePackage(person, suitesourcepackage):
Check if 'person' upload 'suitesourcepackage' to 'archive'.
ParameterspersonAn IPerson who might be uploading.
suitesourcepackageAn ISuiteSourcePackage to be uploaded.
ReturnsTrue if they can, False if they cannot.
def canModifySuite(distroseries, pocket):
Decides whether or not to allow uploads for a given DS/pocket.

Some archive types (e.g. PPAs) allow uploads to the RELEASE pocket regardless of the distroseries state. For others (principally primary archives), only allow uploads for RELEASE pocket in unreleased distroseries, and conversely only allow uploads for non-RELEASE pockets in released distroseries. For instance, in edgy time :

warty -> DENY edgy -> ALLOW warty-updates -> ALLOW edgy-security -> DENY

Note that FROZEN is not considered either 'stable' or 'unstable' state. Uploads to a FROZEN distroseries will end up in the UNAPPROVED queue.

Return True if the upload is allowed and False if denied.

def checkUploadToPocket(distroseries, pocket, person=None):
Check if an upload to a particular archive and pocket is possible.
ParametersdistroseriesA IDistroSeries
pocketA PackagePublishingPocket
personCheck for redirected pockets if this person is not a queue admin.
ReturnsReason why uploading is not possible or None
@operation_parameters(Reference(IPerson), Reference(IDistroSeries, _('The distro series'), True), TextLine(_('Source package name'), True), TextLine(_('Component'), True), Choice(_('Pocket'), _('The pocket into which this entry is published'), PackagePublishingPocket, True), Bool(_('Strict component'), False))
@export_operation_as('checkUpload')
@export_read_operation()
def _checkUpload(person, distroseries, sourcepackagename, component, pocket, strict_component=True):
Wrapper around checkUpload for the web service API.
def checkUpload(person, distroseries, sourcepackagename, component, pocket, strict_component=True):
Check if 'person' upload 'suitesourcepackage' to 'archive'.
ParameterspersonAn IPerson who might be uploading.
distroseriesThe IDistroSeries being uploaded to.
sourcepackagenameThe ISourcePackageName being uploaded.
componentThe Component being uploaded to.
pocketThe PackagePublishingPocket of 'distroseries' being uploaded to.
strict_componentTrue if access to the specific component for the package is needed to upload to it. If False, then access to any component will do.
ReturnsThe reason for not being able to upload, None otherwise.
def verifyUpload(person, sourcepackagename, component, distroseries, strict_component=True, pocket=None):
Can 'person' upload 'sourcepackagename' to this archive ?
ParameterspersonThe IPerson trying to upload to the package. Referred to as 'the signer' in upload code.
sourcepackagenameThe source package being uploaded. None if the package is new.
archiveThe IArchive being uploaded to.
componentThe IComponent that the source package belongs to.
distroseriesThe upload's target distro series.
strict_componentTrue if access to the specific component for the package is needed to upload to it. If False, then access to any component will do.
pocketThe PackagePublishingPocket being uploaded to. If None, then pocket permissions are not checked.
ReturnsCannotUploadToArchive if 'person' cannot upload to the archive, None otherwise.
def canAdministerQueue(person, components=None, pocket=None, distroseries=None):
Check to see if person is allowed to administer queue items.

:param person: An `IPerson` who should be checked for authentication.
:param components: The context `IComponent`(s) for the check.
:param pocket: The context `PackagePublishingPocket` for the check.
:param distroseries: The context `IDistroSeries` for the check.

:return: True if 'person' is allowed to administer the package upload
queue for all given 'components', or for the given 'pocket'
(optionally restricted to a single 'distroseries').  If 'components'
is empty or None and 'pocket' is None, check if 'person' has any
queue admin permissions for this archive.
def getFileByName(filename):
Return the corresponding `ILibraryFileAlias` in this context.

The following file types (and extension) can be looked up in the
archive context:

 * Source files: '.orig.tar.gz', 'tar.gz', '.diff.gz' and '.dsc';
 * Binary files: '.deb' and '.udeb';
 * Source changesfile: '_source.changes';
 * Package diffs: '.diff.gz';

:param filename: exactly filename to be looked up.

:raises AssertionError if the given filename contains a unsupported
    filename and/or extension, see the list above.
:raises NotFoundError if no file could not be found.

:return the corresponding `ILibraryFileAlias` is the file was found.
def getSourceFileByName(name, version, filename):
Return the ILibraryFileAlias for a source name/version/filename.

This can be used to avoid ambiguities with getFileByName in imported archives, where the upstream archive software may not always have had robust historical filename uniqueness checks.

ParametersnameThe name of the source package.
versionThe version of the source package.
filenameThe exact filename to look up.
Returnsthe corresponding ILibraryFileAlias.
RaisesNotFoundErrorif no matching file could be found.
def getBinaryPackageRelease(name, version, archtag):

Find the specified IBinaryPackageRelease in the archive.

:return The binary package release with the given name and version,
or None if one does not exist or there is more than one.
ParametersnameThe IBinaryPackageName of the package.
versionThe version of the package.
archtagThe architecture tag of the package's build. 'all' will not work here -- 'i386' (the build DAS) must be used instead.
def getBinaryPackageReleaseByFileName(filename):
Return the corresponding IBinaryPackageRelease in this context.
ParametersfilenameThe filename to look up.
ReturnsThe IBinaryPackageRelease with the specified filename, or None if it was not found.
def requestPackageCopy(target_location, requestor, suite=None, copy_binaries=False, reason=None):
Return a new PackageCopyRequest for this archive.

:return The new IPackageCopyRequest

Parameterstarget_locationthe archive location to which the packages are to be copied.
requestorThe IPerson who is requesting the package copy operation.
suiteThe IDistroSeries name with optional pocket, for example, 'hoary-security'. If this is not provided it will default to the current series' release pocket.
copy_binariesWhether or not binary packages should be copied as well.
reasonThe reason for this package copy request.
RaisesNotFoundErrorif the provided suite is not found for this archive's distribution.
@operation_parameters(Reference(Interface, _('Package set'), True), Bool(_('Ignore package set hierarchy'), False))
@operation_returns_collection_of(Interface)
@export_read_operation()
def getUploadersForPackageset(packageset, direct_permissions=True):
The ArchivePermission records for uploaders to the package set.
ParameterspackagesetAn IPackageset.
direct_permissionsIf True, only consider permissions granted directly for the package set at hand. Otherwise, include any uploaders for package sets that include this one.
ReturnsArchivePermission records for all the uploaders who are authorized to upload to the named source package set.
@operation_parameters(Reference(IPerson))
@operation_returns_collection_of(Interface)
@export_read_operation()
def getPackagesetsForUploader(person):
The ArchivePermission records for the person's package sets.
ParameterspersonAn IPerson for whom you want to find out which package sets they have access to.
ReturnsArchivePermission records for all the package sets that 'person' is allowed to upload to.
def getComponentsForUploader(person):
Return the components that 'person' can upload to this archive.

:param person: An `IPerson` wishing to upload to an archive.
:return: A `set` of `IComponent`s that 'person' can upload to.
@operation_parameters(Reference(IPerson))
@operation_returns_collection_of(Interface)
@export_read_operation()
@operation_for_version('devel')
def getPocketsForUploader(person):
Return the pockets that 'person' can upload to this archive.
ParameterspersonAn IPerson wishing to upload to an archive.
ReturnsA set of PackagePublishingPocket items that 'person' can upload to.
@operation_parameters(TextLine(_('Source package name'), True), Reference(IPerson))
@operation_returns_collection_of(Interface)
@export_read_operation()
def getPackagesetsForSourceUploader(sourcepackagename, person):

The package set based permissions for a given source and uploader.

Return the IArchivePermission records that
  • apply to this archive

  • relate to
    • package sets that include the given source package name
    • the given person
Parameterssourcepackagenamethe source package name; can be either a string or a ISourcePackageName.
personAn IPerson for whom you want to find out which package sets they have access to.
ReturnsArchivePermission records for the package sets that include the given source package name and to which the given person may upload.
RaisesNoSuchSourcePackageNameif a source package with the given name could not be found.
@operation_parameters(TextLine(_('Source package name'), True), Bool(_('Ignore package set hierarchy'), False))
@operation_returns_collection_of(Interface)
@export_read_operation()
def getPackagesetsForSource(sourcepackagename, direct_permissions=True):
All package set based permissions for the given source.

This method is meant to aid the process of "debugging" package set based archive permission since It allows the listing of permissions for the given source package in this archive (irrespective of the principal).

Parameterssourcepackagenamethe source package name; can be either a string or a ISourcePackageName.
direct_permissionsIf set only package sets that directly include the given source will be considered.
ReturnsArchivePermission records for the package sets that include the given source package name and apply to the archive in question.
RaisesNoSuchSourcePackageNameif a source package with the given name could not be found.
@operation_parameters(TextLine(_('Source package name'), True), Reference(IPerson), Reference(IDistroSeries, _('The distro series'), False))
@export_read_operation()
def isSourceUploadAllowed(sourcepackagename, person, distroseries=None):
True if the person is allowed to upload the given source package.

Return True if there exists a permission that combines
  • this archive
  • a package set that includes the given source package name
  • the given person or a team they are a member of

If the source package name is included by any package set with an explicit permission then only such explicit permissions will be considered.

Parameterssourcepackagenamethe source package name; can be either a string or a ISourcePackageName.
personAn IPerson for whom you want to find out which package sets they have access to.
distroseriesThe IDistroSeries for which to check permissions. If none is supplied then currentseries in the archive's distribution is assumed.
ReturnsTrue if the person is allowed to upload the source package.
RaisesNoSuchSourcePackageNameif a source package with the given name could not be found.
def updatePackageDownloadCount(bpr, day, country, count):
Update the daily download count for a given package.

If there's no matching IBinaryPackageReleaseDownloadCount entry, we create one with the given count. Otherwise we just increase the count of the existing one by the given amount.

ParametersbprThe IBinaryPackageRelease to update the count for.
dayThe date to update the count for.
countryThe ICountry to update the count for.
countThe new download count.
def getPackageDownloadTotal(bpr):
Get the total download count for a given package.
def getPockets():
Return iterable containing valid pocket names for this archive.
def getOverridePolicy(distroseries, pocket, phased_update_percentage=None):
Returns an instantiated IOverridePolicy for the archive.
buildd_secret =
The password used by the build farm to access the archive.
@call_with(True)
@rename_parameters_as('binary_name', 'distro_arch_series')
@operation_parameters(TextLine(_('Binary Package Name'), False), TextLine(_('Version'), False), Choice(_('Package Publishing Status'), _('The status of this publishing record'), PackagePublishingStatus, False), Reference(Interface, _('Distro Arch Series'), False), Choice(_('Pocket'), _('The pocket into which this entry is published'), PackagePublishingPocket, False, True), Bool(_('Whether or not to filter binary names by exact matching.'), False), Datetime(_('Created Since Date'), _('Return entries whose `date_created` is greater than or equal to this date.'), False), Bool(_('Ordered'), _('Return ordered results by default, but specifying False will return results more quickly.'), False, True), Bool(_('Order by creation date'), _('Return newest results first. This is recommended for applications that need to catch up with publications since their last run.'), False))
@operation_returns_collection_of(Interface)
@export_operation_as('getPublishedBinaries')
@export_read_operation()
def getAllPublishedBinaries(name=None, version=None, status=None, distroarchseries=None, pocket=None, exact_match=False, created_since_date=None, ordered=True, order_by_date=False, eager_load=False):
All IBinaryPackagePublishingHistory target to this archive.
Parametersnamebinary name filter (exact match or SQL LIKE controlled by 'exact_match' argument).
versionbinary version filter (always exact match).
statusPackagePublishingStatus filter, can be a list.
distroarchseriesIDistroArchSeries filter, can be a list.
pocketPackagePublishingPocket filter.
exact_matcheither or not filter source names by exact matching.
created_since_dateOnly return publications created on or after this date.
orderedNormally publications are ordered by binary package name and then ID order (creation order). If this parameter is False then the results will be unordered. This will make the operation much quicker to return results if you don't care about ordering.
order_by_dateOrder publications by descending creation date and then by descending ID. This is suitable for applications that need to catch up with publications since their last run.
ReturnsA collection containing BinaryPackagePublishingHistory.
@operation_parameters(Bool(_('Include builds with state NEEDSBUILD'), False))
@export_read_operation()
def getBuildCounters(include_needsbuild=True):

Return a dictionary containing the build counters for an archive.

This is necessary currently because the IArchive.failed_builds etc. counters are not in use.

The returned dictionary contains the follwoing keys and values:

  • 'total': total number of builds (includes SUPERSEDED);
  • 'pending': number of builds in BUILDING or NEEDSBUILD state;
  • 'failed': number of builds in FAILEDTOBUILD, MANUALDEPWAIT, CHROOTWAIT and FAILEDTOUPLOAD state;
  • 'succeeded': number of SUCCESSFULLYBUILT builds.
  • 'superseded': number of SUPERSEDED builds.
Parametersinclude_needsbuildIndicates whether to include builds with the status NEEDSBUILD in the pending and total counts. This is useful in situations where a build that hasn't started isn't considered a build by the user. (type: bool)
Returnsa dictionary with the 4 keys specified above. (type: dict.)
@operation_parameters(List(_('A list of source publishing history record ids.'), Int()))
@export_read_operation()
def getBuildSummariesForSourceIds(source_ids):
Return a dictionary containing a summary of the build statuses.

Only information for sources belonging to the current archive will be returned. See IPublishingSet.getBuildStatusSummariesForSourceIdsAndArchive() for details.

Parameterssource_idsA list of source publishing history record ids. (type: list)
ReturnsA dict consisting of the overall status summaries for the given ids that belong in the archive.
@operation_parameters(Reference(Interface))
@operation_returns_entry(Interface)
@export_read_operation()
def getArchiveDependency(dependency):
Return the IArchiveDependency object for the given dependency.
Parametersdependencyis an IArchive object.
ReturnsIArchiveDependency or None if a corresponding object could not be found.
@operation_returns_collection_of(Interface)
@export_read_operation()
@operation_for_version('devel')
def getAllPermissions():
Return all IArchivePermission records for this archive.
ReturnsA list of IArchivePermission records.
@operation_parameters(Reference(IPerson))
@operation_returns_collection_of(Interface)
@export_read_operation()
def getPermissionsForPerson(person):
Return the IArchivePermission records applicable to the person.
ParameterspersonAn IPerson
ReturnsA list of IArchivePermission records.
@operation_parameters(TextLine(_('Source Package Name'), True))
@operation_returns_collection_of(Interface)
@export_read_operation()
def getUploadersForPackage(source_package_name):
Return IArchivePermission records for the package's uploaders.
Parameterssource_package_nameAn ISourcePackageName or textual name for the source package.
ReturnsA list of IArchivePermission records.
@operation_parameters(TextLine(_('Component Name'), False))
@operation_returns_collection_of(Interface)
@export_read_operation()
def getUploadersForComponent(component_name=None):
Return IArchivePermission records for the component's uploaders.
Parameterscomponent_nameAn IComponent or textual name for the component.
ReturnsA list of IArchivePermission records.
@operation_parameters(TextLine(_('Component Name'), True))
@operation_returns_collection_of(Interface)
@export_read_operation()
def getQueueAdminsForComponent(component_name):
Return IArchivePermission records for authorized queue admins.
Parameterscomponent_nameAn IComponent or textual name for the component.
ReturnsA list of IArchivePermission records.
@operation_parameters(Reference(IPerson))
@operation_returns_collection_of(Interface)
@export_read_operation()
def getComponentsForQueueAdmin(person):
Return IArchivePermission for the person's queue admin components.
ParameterspersonAn IPerson.
ReturnsA list of IArchivePermission records.
@operation_parameters(Choice(_('Pocket'), PackagePublishingPocket, True))
@operation_returns_collection_of(Interface)
@export_read_operation()
@operation_for_version('devel')
def getUploadersForPocket(pocket):
Return IArchivePermission records for the pocket's uploaders.
ParameterspocketA PackagePublishingPocket.
ReturnsA list of IArchivePermission records.
@operation_parameters(Choice(_('Pocket'), PackagePublishingPocket, True), Reference(IDistroSeries, _('Distro series'), False))
@operation_returns_collection_of(Interface)
@export_read_operation()
@operation_for_version('devel')
def getQueueAdminsForPocket(pocket, distroseries=None):
Return IArchivePermission records for authorized queue admins.
ParameterspocketA PackagePublishingPocket.
distroseriesAn optional IDistroSeries.
ReturnsA list of IArchivePermission records.
@operation_parameters(Reference(IPerson))
@operation_returns_collection_of(Interface)
@export_read_operation()
@operation_for_version('devel')
def getPocketsForQueueAdmin(person):
Return IArchivePermission for the person's queue admin pockets.
ParameterspersonAn IPerson.
ReturnsA list of IArchivePermission records.
def hasAnyPermission(person):
Whether or not this person has any permission at all on this archive.
ParameterspersonThe IPerson for whom the check is performed.
ReturnsA boolean indicating if the person has any permission on this archive at all.
def getPackageDownloadCount(bpr, day, country):
Get the IBinaryPackageDownloadCount with the given key.
def getFilesAndSha1s(source_files):
Return a dictionary with the filenames and the SHA1s for each source file.
Parameterssource_filesA list of filenames to return SHA1s of
ReturnsA dictionary of filenames and SHA1s.
@call_with(REQUEST_USER)
@operation_parameters(TextLine(_('Source package name')), TextLine(_('Version')), Reference(Interface), TextLine(_('Target pocket name')), TextLine(_('Target distroseries name'), False), Bool(_('Include Binaries'), _('Whether or not to copy binaries already built for this source'), False), Reference(IPerson, _('Sponsored Person'), _('The person who is being sponsored for this copy.')), Bool(_('Unembargo restricted files')), Bool(_('Automatic approval'), _('Automatically approve this copy (queue admins only).'), False), Bool(_('Silent'), _("Don't notify anyone about this copy. For use by queue admins only."), False), TextLine(_('Source pocket name'), False), TextLine(_('Source distroseries name'), False), Int(_('Phased update percentage'), _('The percentage of users for whom this package should be recommended, or None to publish the update for everyone.'), False))
@export_write_operation()
@operation_for_version('devel')
def copyPackage(source_name, version, from_archive, to_pocket, person, to_series=None, include_binaries=False, sponsored=None, unembargo=False, auto_approve=False, silent=False, from_pocket=None, from_series=None, phased_update_percentage=None):
Copy a single named source into this archive.

Asynchronously copy a specific version of a named source to the destination archive if necessary. Calls to this method will return immediately if the copy passes basic security checks and the copy will happen sometime later with full checking.

If the source or target distribution has a development series alias, then it may be used as the source or target distroseries name respectively; but note that this will always be resolved to the true development series of that distribution, which may not match the alias in the respective published archives.

Parameterssource_namea string name of the package to copy.
versionthe version of the package to copy.
from_archivethe source archive from which to copy.
to_pocketthe target pocket (as a string).
to_seriesthe target distroseries (as a string).
include_binariesoptional boolean, controls whether or not the published binaries for each given source should also be copied along with the source.
personthe IPerson who requests the sync.
sponsoredthe IPerson who is being sponsored. Specifying this will ensure that the person's email address is used as the "From:" on the announcement email and will also be recorded as the creator of the new source publication.
unembargoif True, allow copying restricted files from a private archive to a public archive, and re-upload them to the public librarian when doing so.
auto_approveif True and the IPerson requesting the sync has queue admin permissions on the target, accept the copy immediately rather than setting it to unapproved.
silentSuppress any emails that the copy would generate. Only usable with queue admin permissions on the target.
from_pocketthe source pocket (as a string). If omitted, copy from any pocket with a matching version.
from_seriesthe source distroseries (as a string). If omitted, copy from any series with a matching version.
phased_update_percentagethe phased update percentage to apply to the copied publication.
RaisesNoSuchSourcePackageNameif the source name is invalid
PocketNotFoundif the pocket name is invalid
NoSuchDistroSeriesif the distro series name is invalid
CannotCopyif there is a problem copying.
@call_with(REQUEST_USER)
@operation_parameters(List(_('Source package names'), TextLine()), Reference(Interface), TextLine(_('Pocket name')), TextLine(_('Distroseries name'), _('The distro series to copy packages into.'), False), TextLine(_('Distroseries name'), _('The distro series to copy packages from.'), False), Bool(_('Include Binaries'), _('Whether or not to copy binaries already built for this source'), False), Reference(IPerson, _('Sponsored Person'), _('The person who is being sponsored for this copy.')), Bool(_('Unembargo restricted files')), Bool(_('Automatic approval'), _('Automatically approve this copy (queue admins only).'), False), Bool(_('Silent'), _("Don't notify anyone about this copy. For use by queue admins only."), False))
@export_write_operation()
@operation_for_version('devel')
def copyPackages(source_names, from_archive, to_pocket, person, to_series=None, from_series=None, include_binaries=False, sponsored=None, unembargo=False, auto_approve=False, silent=False):
Copy multiple named sources into this archive from another.

Asynchronously copy the most recent PUBLISHED versions of the named sources to the destination archive if necessary. Calls to this method will return immediately if the copy passes basic security checks and the copy will happen sometime later with full checking.

Partial changes of the destination archive can happen because each source is copied in its own transaction.

If the source or target distribution has a development series alias, then it may be used as the source or target distroseries name respectively; but note that this will always be resolved to the true development series of that distribution, which may not match the alias in the respective published archives.

Parameterssource_namesa list of string names of packages to copy.
from_archivethe source archive from which to copy.
to_pocketthe target pocket (as a string).
to_seriesthe target distroseries (as a string).
from_seriesthe source distroseries (as a string).
include_binariesoptional boolean, controls whether or not the published binaries for each given source should also be copied along with the source.
personthe IPerson who requests the sync.
sponsoredthe IPerson who is being sponsored. Specifying this will ensure that the person's email address is used as the "From:" on the announcement email and will also be recorded as the creator of the new source publication.
unembargoif True, allow copying restricted files from a private archive to a public archive, and re-upload them to the public librarian when doing so.
auto_approveif True and the IPerson requesting the sync has queue admin permissions on the target, accept the copies immediately rather than setting it to unapproved.
silentSuppress any emails that the copy would generate. Only usable with queue admin permissions on the target.
RaisesNoSuchSourcePackageNameif the source name is invalid
PocketNotFoundif the pocket name is invalid
NoSuchDistroSeriesif the distro series name is invalid
CannotCopyif there is a problem copying.
API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.