~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/soyuz/interfaces/archive.py

Show diffs side-by-side

added added

removed removed

Lines of Context:
616
616
        :param component: The `Component` being uploaded to.
617
617
        :param pocket: The `PackagePublishingPocket` of 'distroseries' being
618
618
            uploaded to.
 
619
        :param strict_component: True if access to the specific component for
 
620
            the package is needed to upload to it. If False, then access to
 
621
            any component will do.
619
622
        :return: The reason for not being able to upload, None otherwise.
620
623
        """
621
624
 
632
635
        :param distroseries: The upload's target distro series.
633
636
        :param strict_component: True if access to the specific component for
634
637
            the package is needed to upload to it. If False, then access to
635
 
            any package will do.
 
638
            any component will do.
636
639
        :return: CannotUploadToArchive if 'person' cannot upload to the
637
640
            archive,
638
641
            None otherwise.
1173
1176
    @operation_returns_collection_of(Interface)
1174
1177
    @export_read_operation()
1175
1178
    def getComponentsForQueueAdmin(person):
1176
 
        """Return `IArchivePermission` for the person's queue admin components
 
1179
        """Return `IArchivePermission` for the person's queue admin
 
1180
        components.
1177
1181
 
1178
 
        :param person: An `IPerson`
 
1182
        :param person: An `IPerson`.
1179
1183
        :return: A list of `IArchivePermission` records.
1180
1184
        """
1181
1185
 
 
1186
    def hasAnyPermission(person):
 
1187
        """Whether or not this person has any permission at all on this
 
1188
        archive.
 
1189
 
 
1190
        :param person: The `IPerson` for whom the check is performed.
 
1191
        :return: A boolean indicating if the person has any permission on this
 
1192
            archive at all.
 
1193
        """
 
1194
 
1182
1195
    def getPackageDownloadCount(bpr, day, country):
1183
1196
        """Get the `IBinaryPackageDownloadCount` with the given key."""
1184
1197
 
1212
1225
class IArchiveAppend(Interface):
1213
1226
    """Archive interface for operations restricted by append privilege."""
1214
1227
 
 
1228
    @call_with(person=REQUEST_USER)
1215
1229
    @operation_parameters(
1216
1230
        source_names=List(
1217
1231
            title=_("Source package names"),
1227
1241
    @export_write_operation()
1228
1242
    # Source_names is a string because exporting a SourcePackageName is
1229
1243
    # rather nonsensical as it only has id and name columns.
1230
 
    def syncSources(source_names, from_archive, to_pocket,
1231
 
                    to_series=None, include_binaries=False):
 
1244
    def syncSources(source_names, from_archive, to_pocket, to_series=None,
 
1245
                    include_binaries=False, person=None):
1232
1246
        """Synchronise (copy) named sources into this archive from another.
1233
1247
 
1234
1248
        It will copy the most recent PUBLISHED versions of the named
1246
1260
        :param include_binaries: optional boolean, controls whether or not
1247
1261
            the published binaries for each given source should also be
1248
1262
            copied along with the source.
 
1263
        :param person: the `IPerson` who requests the sync.
1249
1264
 
1250
1265
        :raises NoSuchSourcePackageName: if the source name is invalid
1251
1266
        :raises PocketNotFound: if the pocket name is invalid
1253
1268
        :raises CannotCopy: if there is a problem copying.
1254
1269
        """
1255
1270
 
 
1271
    @call_with(person=REQUEST_USER)
1256
1272
    @operation_parameters(
1257
1273
        source_name=TextLine(title=_("Source package name")),
1258
1274
        version=TextLine(title=_("Version")),
1271
1287
    # we should consider either changing this method or adding a new one
1272
1288
    # that takes that object instead.
1273
1289
    def syncSource(source_name, version, from_archive, to_pocket,
1274
 
                   to_series=None, include_binaries=False):
 
1290
                   to_series=None, include_binaries=False, person=None):
1275
1291
        """Synchronise (copy) a single named source into this archive.
1276
1292
 
1277
1293
        Copy a specific version of a named source to the destination
1285
1301
        :param include_binaries: optional boolean, controls whether or not
1286
1302
            the published binaries for each given source should also be
1287
1303
            copied along with the source.
 
1304
        :param person: the `IPerson` who requests the sync.
1288
1305
 
1289
1306
        :raises NoSuchSourcePackageName: if the source name is invalid
1290
1307
        :raises PocketNotFound: if the pocket name is invalid