70
class ISourcePackagePublic(IBugTarget, IHasBranches, IHasMergeProposals,
71
IHasOfficialBugTags, IHasCodeImports,
72
IHasTranslationImports, IHasTranslationTemplates):
73
"""Public attributes for SourcePackage."""
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()
75
78
id = Attribute("ID")
79
title=_("Name"), required=True, readonly=True,
82
title=_("Name"), required=True,
80
83
description=_("The text name of this source package.")))
82
85
displayname = exported(
84
title=_("Display name"), required=True, readonly=True,
87
title=_("Display name"), required=True,
85
88
description=_("A displayname, constructed, for this package")))
87
90
path = Attribute("A path to this package, <distro>/<series>/<package>")
105
108
# Really IDistribution, circular import fixed in
106
109
# _schema_circular_imports.
107
title=_("Distribution"), required=True, readonly=True,
110
title=_("Distribution"), required=True,
108
111
description=_("The distribution for this source package.")))
110
113
# The interface for this is really IDistroSeries, but importing that would
112
115
distroseries = exported(
114
117
Interface, title=_("Distribution Series"), required=True,
116
118
description=_("The DistroSeries for this SourcePackage")))
118
120
sourcepackagename = Attribute("SourcePackageName")
128
130
productseries = exported(
130
132
title=_("Project series"), required=False,
131
vocabulary="ProductSeries", readonly=True,
133
vocabulary="ProductSeries",
132
134
schema=Interface,
134
136
"The registered project series that this source package "
263
265
: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.
266
287
shouldimport = Attribute("""Whether we should import this or not.
267
288
By 'import' we mean sourcerer analysis resulting in a manifest and a
268
289
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()
339
332
class ISourcePackageFactory(Interface):
340
333
"""A creator of source packages."""