68
class ISourcePackage(IBugTarget, IHasBranches, IHasMergeProposals,
69
IHasOfficialBugTags, IHasCodeImports,
70
IHasTranslationImports, IHasTranslationTemplates):
71
"""A SourcePackage. See the MagicSourcePackage specification. This
72
interface preserves as much as possible of the old SourcePackage
73
interface from the SourcePackage table, with the new table-less
76
export_as_webservice_entry()
70
class ISourcePackagePublic(IBugTarget, IHasBranches, IHasMergeProposals,
71
IHasOfficialBugTags, IHasCodeImports,
72
IHasTranslationImports, IHasTranslationTemplates):
73
"""Public attributes for SourcePackage."""
78
75
id = Attribute("ID")
82
title=_("Name"), required=True,
79
title=_("Name"), required=True, readonly=True,
83
80
description=_("The text name of this source package.")))
85
82
displayname = exported(
87
title=_("Display name"), required=True,
84
title=_("Display name"), required=True, readonly=True,
88
85
description=_("A displayname, constructed, for this package")))
90
87
path = Attribute("A path to this package, <distro>/<series>/<package>")
108
105
# Really IDistribution, circular import fixed in
109
106
# _schema_circular_imports.
110
title=_("Distribution"), required=True,
107
title=_("Distribution"), required=True, readonly=True,
111
108
description=_("The distribution for this source package.")))
113
110
# The interface for this is really IDistroSeries, but importing that would
115
112
distroseries = exported(
117
114
Interface, title=_("Distribution Series"), required=True,
118
116
description=_("The DistroSeries for this SourcePackage")))
120
118
sourcepackagename = Attribute("SourcePackageName")
130
128
productseries = exported(
132
130
title=_("Project series"), required=False,
133
vocabulary="ProductSeries",
131
vocabulary="ProductSeries", readonly=True,
134
132
schema=Interface,
136
134
"The registered project series that this source package "
265
263
:return: An `IBranch`.
268
# 'pocket' should actually be a PackagePublishingPocket, and 'branch'
269
# should be IBranch, but we use the base classes to avoid circular
270
# imports. Correct interface specific in _schema_circular_imports.
271
@operation_parameters(
273
title=_("Pocket"), required=True,
274
vocabulary=DBEnumeratedType),
275
branch=Reference(Interface, title=_("Branch"), required=False))
276
@call_with(registrant=REQUEST_USER)
277
@export_write_operation()
278
def setBranch(pocket, branch, registrant):
279
"""Set the official branch for the given pocket of this package.
281
:param pocket: A `PackagePublishingPocket`.
282
:param branch: The branch to set as the official branch.
283
:param registrant: The individual who created this link.
287
266
shouldimport = Attribute("""Whether we should import this or not.
288
267
By 'import' we mean sourcerer analysis resulting in a manifest and a
289
268
set of Bazaar branches which describe the source package release.
311
class ISourcePackageEdit(Interface):
312
"""SourcePackage attributes requiring launchpad.Edit."""
314
# 'pocket' should actually be a PackagePublishingPocket, and 'branch'
315
# should be IBranch, but we use the base classes to avoid circular
316
# imports. Correct interface specific in _schema_circular_imports.
317
@operation_parameters(
319
title=_("Pocket"), required=True,
320
vocabulary=DBEnumeratedType),
321
branch=Reference(Interface, title=_("Branch"), required=False))
322
@call_with(registrant=REQUEST_USER)
323
@export_write_operation()
324
def setBranch(pocket, branch, registrant):
325
"""Set the official branch for the given pocket of this package.
327
:param pocket: A `PackagePublishingPocket`.
328
:param branch: The branch to set as the official branch.
329
:param registrant: The individual who created this link.
334
class ISourcePackage(ISourcePackagePublic, ISourcePackageEdit):
335
"""A source package associated to a particular distribution series."""
336
export_as_webservice_entry()
332
339
class ISourcePackageFactory(Interface):
333
340
"""A creator of source packages."""