10
10
'IDistroSeriesDifference',
11
'IDistroSeriesDifferenceAdmin',
12
11
'IDistroSeriesDifferencePublic',
13
12
'IDistroSeriesDifferenceEdit',
14
13
'IDistroSeriesDifferenceSource',
59
55
derived_series = exported(Reference(
60
56
IDistroSeries, title=_("Derived series"), required=True,
61
57
readonly=True, description=_(
62
"The distribution series which identifies the derived series "
63
"with the difference.")))
65
parent_series = exported(Reference(
66
IDistroSeries, title=_("Parent series"), required=True,
67
readonly=True, description=_(
68
"The distribution series which identifies the parent series "
69
"with the difference.")))
71
source_package_name_id = Int(
72
title=u"Source package name id", required=True, readonly=True)
58
"The distribution series which, together with its parent, "
59
"identifies the two series with the difference.")))
73
61
source_package_name = Reference(
74
62
ISourcePackageName,
75
63
title=_("Source package name"), required=True, readonly=True,
189
177
title=_("Title"), readonly=True, required=False, description=_(
190
178
"A human-readable name describing this difference."))
192
packagesets = Attribute("The packagesets for this source package in the "
195
parent_packagesets = Attribute("The packagesets for this source package "
196
"in the parent series.")
198
def update(manual=False):
199
181
"""Checks that difference type and status matches current publishings.
201
183
If the record is updated, a relevant comment is added.
203
185
If there is no longer a difference (ie. the versions are
204
186
the same) then the status is updated to RESOLVED.
206
:param manual: Boolean, True if this is a user-requested change.
207
This overrides auto-blacklisting.
208
188
:return: True if the record was updated, False otherwise.
211
191
latest_comment = Reference(
212
Interface, # IDistroSeriesDifferenceComment
192
Interface, # IDistroSeriesDifferenceComment
213
193
title=_("The latest comment"),
216
196
def getComments():
217
197
"""Return a result set of the comments for this difference."""
199
def getPackageSets():
200
"""Return a result set of the derived series packagesets for the
201
sourcepackagename of this difference.
204
def getParentPackageSets():
205
"""Return a result set of the parent packagesets for the
206
sourcepackagename of this difference.
220
210
class IDistroSeriesDifferenceEdit(Interface):
221
211
"""Difference attributes requiring launchpad.Edit."""
227
217
def addComment(commenter, comment):
228
218
"""Add a comment on this difference."""
230
@call_with(requestor=REQUEST_USER)
231
@export_write_operation()
232
def requestPackageDiffs(requestor):
233
"""Requests IPackageDiffs for the derived and parent version.
235
:raises DistroSeriesDifferenceError: When package diffs
240
class IDistroSeriesDifferenceAdmin(Interface):
241
"""Difference attributes requiring launchpad.Admin."""
243
220
@operation_parameters(
244
221
all=Bool(title=_("All"), required=False))
245
222
@export_write_operation()
257
234
The status will be updated based on the versions.
237
@call_with(requestor=REQUEST_USER)
238
@export_write_operation()
239
def requestPackageDiffs(requestor):
240
"""Requests IPackageDiffs for the derived and parent version.
242
:raises DistroSeriesDifferenceError: When package diffs
261
247
class IDistroSeriesDifference(IDistroSeriesDifferencePublic,
262
IDistroSeriesDifferenceEdit,
263
IDistroSeriesDifferenceAdmin):
248
IDistroSeriesDifferenceEdit):
264
249
"""An interface for a package difference between two distroseries."""
265
250
export_as_webservice_entry()
268
253
class IDistroSeriesDifferenceSource(Interface):
269
254
"""A utility of this interface can be used to create differences."""
271
def new(derived_series, source_package_name, parent_series=None):
256
def new(derived_series, source_package_name):
272
257
"""Create an `IDistroSeriesDifference`.
274
259
:param derived_series: The distribution series which was derived
278
263
:param source_package_name: A source package name identifying the
279
264
package with a difference.
280
265
:type source_package_name: `ISourcePackageName`.
281
:param parent_series: The distribution series which has the derived
282
series as a child. If there is only one parent, it does not need
284
:type parent_series: `IDistroSeries`.
285
266
:raises NotADerivedSeriesError: When the passed distro series
286
267
is not a derived series.
287
268
:return: A new `DistroSeriesDifference` object.
290
271
def getForDistroSeries(
292
difference_type=None,
273
difference_type=DistroSeriesDifferenceType.DIFFERENT_VERSIONS,
293
274
source_package_name_filter=None,
295
child_version_higher=False,
276
child_version_higher=False):
297
277
"""Return differences for the derived distro series sorted by
303
283
:param difference_type: The type of difference to include in the
305
285
:type difference_type: `DistroSeriesDifferenceType`.
306
:param source_package_name_filter: Name of a source package. If
307
given, restricts the search to this package.
286
:param source_package_name_filter: Package source name filter.
308
287
:type source_package_name_filter: unicode.
309
288
:param status: Only differences matching the status(es) will be
312
291
:param child_version_higher: Only differences for which the child's
313
292
version is higher than the parent's version will be included.
314
293
:type child_version_higher: bool.
315
:param parent_series: The parent series to consider. Consider all
316
parent series if this parameter is None.
317
:type distro_series: `IDistroSeries`.
318
:return: A result set of `IDistroSeriesDifference`.
294
:return: A result set of differences.
321
def getByDistroSeriesNameAndParentSeries(distro_series,
324
"""Returns a single difference matching the series, name and parent
297
def getByDistroSeriesAndName(distro_series, source_package_name):
298
"""Returns a single difference matching the series and name.
327
300
:param distro_series: The derived distribution series which is to be
328
301
searched for differences.
329
302
:type distro_series: `IDistroSeries`.
330
303
:param source_package_name: The name of the package difference.
331
304
:type source_package_name: unicode.
332
:param parent_series: The parent distribution series of the package
334
:type distro_series: `IDistroSeries`.
337
def getSimpleUpgrades(distro_series):
338
"""Find pending upgrades that can be performed mindlessly.
340
These are `DistroSeriesDifferences` where the parent has been
341
updated and the child still has the old version, unchanged.
343
Blacklisted items are excluded.