~launchpad-pqm/launchpad/devel

« back to all changes in this revision

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

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-12-06 09:08:39 UTC
  • mfrom: (14421.2.8 sponsor-syncs-bug-827555)
  • Revision ID: launchpad@pqm.canonical.com-20111206090839-fm73xxdr08hyvasc
[r=benji][bug=827555] Make the package copier accept a "sponsored"
 Person which will be used as the SPPH.creator and From: address on
 announcement emails. Also expose the new parameter on
 IArchive.copyPackage[s]() on the API.

Show diffs side-by-side

added added

removed removed

Lines of Context:
952
952
            required=False),
953
953
        component_name=TextLine(title=_("Component name"), required=False),
954
954
        )
955
 
 
956
955
    # Really returns ISourcePackagePublishingHistory, see below for
957
956
    # patch to avoid circular import.
958
957
    @call_with(eager_load=True)
1204
1203
            title=_("Include Binaries"),
1205
1204
            description=_("Whether or not to copy binaries already built for"
1206
1205
                          " this source"),
1207
 
            required=False))
 
1206
            required=False),
 
1207
        sponsored=Reference(
 
1208
            schema=IPerson,
 
1209
            title=_("Sponsored Person"),
 
1210
            description=_("The person who is being sponsored for this copy."))
 
1211
        )
1208
1212
    @export_write_operation()
1209
1213
    @operation_for_version('devel')
1210
1214
    def copyPackage(source_name, version, from_archive, to_pocket,
1211
 
                    person, to_series=None, include_binaries=False):
 
1215
                    person, to_series=None, include_binaries=False,
 
1216
                    sponsored=None):
1212
1217
        """Copy a single named source into this archive.
1213
1218
 
1214
1219
        Asynchronously copy a specific version of a named source to the
1225
1230
            the published binaries for each given source should also be
1226
1231
            copied along with the source.
1227
1232
        :param person: the `IPerson` who requests the sync.
 
1233
        :param sponsored: the `IPerson` who is being sponsored. Specifying
 
1234
            this will ensure that the person's email address is used as the
 
1235
            "From:" on the announcement email and will also be recorded as
 
1236
            the creator of the new source publication.
1228
1237
 
1229
1238
        :raises NoSuchSourcePackageName: if the source name is invalid
1230
1239
        :raises PocketNotFound: if the pocket name is invalid
1245
1254
            title=_("Include Binaries"),
1246
1255
            description=_("Whether or not to copy binaries already built for"
1247
1256
                          " this source"),
1248
 
            required=False))
 
1257
            required=False),
 
1258
        sponsored=Reference(
 
1259
            schema=IPerson,
 
1260
            title=_("Sponsored Person"),
 
1261
            description=_("The person who is being sponsored for this copy."))
 
1262
        )
1249
1263
    @export_write_operation()
1250
1264
    @operation_for_version('devel')
1251
1265
    def copyPackages(source_names, from_archive, to_pocket, person,
1252
 
                     to_series=None, include_binaries=False):
 
1266
                     to_series=None, include_binaries=False,
 
1267
                     sponsored=None):
1253
1268
        """Copy multiple named sources into this archive from another.
1254
1269
 
1255
1270
        Asynchronously copy the most recent PUBLISHED versions of the named
1268
1283
            the published binaries for each given source should also be
1269
1284
            copied along with the source.
1270
1285
        :param person: the `IPerson` who requests the sync.
 
1286
        :param sponsored: the `IPerson` who is being sponsored. Specifying
 
1287
            this will ensure that the person's email address is used as the
 
1288
            "From:" on the announcement email and will also be recorded as
 
1289
            the creator of the new source publication.
1271
1290
 
1272
1291
        :raises NoSuchSourcePackageName: if the source name is invalid
1273
1292
        :raises PocketNotFound: if the pocket name is invalid