~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/soyuz/interfaces/packagecopyjob.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:
30
30
 
31
31
from canonical.launchpad import _
32
32
from lp.registry.interfaces.distroseries import IDistroSeries
 
33
from lp.registry.interfaces.person import IPerson
33
34
from lp.services.job.interfaces.job import (
34
35
    IJob,
35
36
    IJobSource,
126
127
    def create(package_name, source_archive,
127
128
               target_archive, target_distroseries, target_pocket,
128
129
               include_binaries=False, package_version=None,
129
 
               copy_policy=PackageCopyPolicy.INSECURE, requester=None):
 
130
               copy_policy=PackageCopyPolicy.INSECURE, requester=None,
 
131
               sponsored=None):
130
132
        """Create a new `IPlainPackageCopyJob`.
131
133
 
132
134
        :param package_name: The name of the source package to copy.
142
144
            that is to be copied.
143
145
        :param copy_policy: Applicable `PackageCopyPolicy`.
144
146
        :param requester: The user requesting the copy.
 
147
        :param sponsored: The user who is being sponsored to make the copy.
 
148
            The person who is making this request then becomes the sponsor.
145
149
        """
146
150
 
147
151
    def createMultiple(target_distroseries, copy_tasks, requester,
190
194
        title=_("Copy binaries"),
191
195
        required=False, readonly=True)
192
196
 
 
197
    sponsored = Reference(
 
198
        schema=IPerson, title=_('Sponsored Person'),
 
199
        required=False, readonly=True)
 
200
 
193
201
    def addSourceOverride(override):
194
202
        """Add an `ISourceOverride` to the metadata."""
195
203