launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #04724
[Merge] lp:~jtv/launchpad/fix-some-utilities into lp:launchpad
Jeroen T. Vermeulen has proposed merging lp:~jtv/launchpad/fix-some-utilities into lp:launchpad.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~jtv/launchpad/fix-some-utilities/+merge/72523
= Summary =
As discussed on launchpad-dev: it's time we got more systematic about verifying that our utilities really implement their interfaces. I've got a little prototype tool (not really good enough for serious use yet) that runs them all through the zope verifier.
Here are some easy fixes that rolled out of my experimental runs. Don't worry, there's loads more.
You'll also note a few small lint cleanups, and naturally I ran the branch through our automated tools to update copyright timestamps and re-format imports.
= Launchpad lint =
Checking for conflicts and issues in changed files.
Linting changed files:
lib/canonical/launchpad/interfaces/emailaddress.py
lib/lp/registry/interfaces/gpg.py
lib/lp/bugs/interfaces/bugwatch.py
lib/lp/soyuz/interfaces/archivepermission.py
lib/lp/hardwaredb/interfaces/hwdb.py
lib/lp/registry/interfaces/product.py
lib/lp/registry/interfaces/distroseries.py
lib/lp/registry/interfaces/projectgroup.py
lib/lp/translations/interfaces/translator.py
lib/lp/registry/interfaces/distroseriesparent.py
lib/lp/translations/interfaces/poexportrequest.py
lib/lp/soyuz/interfaces/packagediff.py
lib/lp/code/interfaces/branchlookup.py
lib/lp/bugs/interfaces/bugtask.py
--
https://code.launchpad.net/~jtv/launchpad/fix-some-utilities/+merge/72523
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~jtv/launchpad/fix-some-utilities into lp:launchpad.
=== modified file 'lib/canonical/launchpad/interfaces/emailaddress.py'
--- lib/canonical/launchpad/interfaces/emailaddress.py 2010-09-13 19:29:21 +0000
+++ lib/canonical/launchpad/interfaces/emailaddress.py 2011-08-23 04:43:26 +0000
@@ -1,4 +1,4 @@
-# Copyright 2009 Canonical Ltd. This software is licensed under the
+# Copyright 2009-2011 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
# pylint: disable-msg=E0211,E0213
@@ -145,7 +145,7 @@
def getByPerson(person):
"""Return all email addresses for the given person."""
- def getPreferredEmailForPeople(self, people):
+ def getPreferredEmailForPeople(people):
"""Return preferred email addresses for the people provided."""
def getByEmail(email):
=== modified file 'lib/lp/bugs/interfaces/bugtask.py'
--- lib/lp/bugs/interfaces/bugtask.py 2011-08-03 06:25:54 +0000
+++ lib/lp/bugs/interfaces/bugtask.py 2011-08-23 04:43:26 +0000
@@ -1,4 +1,4 @@
-# Copyright 2009-2010 Canonical Ltd. This software is licensed under the
+# Copyright 2009-2011 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
# pylint: disable-msg=E0211,E0213,E0602
@@ -1597,7 +1597,7 @@
The assignee and the assignee's validity are precached.
"""
- def getBugTaskTargetMilestones(self, bugtasks, eager=False):
+ def getBugTaskTargetMilestones(bugtasks, eager=False):
"""Get all the milestones for the selected bugtasks' targets."""
open_bugtask_search = Attribute("A search returning open bugTasks.")
=== modified file 'lib/lp/bugs/interfaces/bugwatch.py'
--- lib/lp/bugs/interfaces/bugwatch.py 2010-08-26 12:12:00 +0000
+++ lib/lp/bugs/interfaces/bugwatch.py 2011-08-23 04:43:26 +0000
@@ -1,4 +1,4 @@
-# Copyright 2009 Canonical Ltd. This software is licensed under the
+# Copyright 2009-2011 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
# pylint: disable-msg=E0211,E0213
@@ -154,9 +154,11 @@
export_as_webservice_entry()
id = Int(title=_('ID'), required=True, readonly=True)
+
+ # Actually refers to Bug; redefined in bug.py.
bug = exported(
- Reference(title=_('Bug'), schema=Interface, # Redefined in bug.py
- required=True, readonly=True))
+ Reference(
+ title=_('Bug'), schema=Interface, required=True, readonly=True))
bugtracker = exported(
ReferenceChoice(
title=_('Bug System'), required=True,
@@ -349,7 +351,7 @@
If no bug tracker type can be guessed, None is returned.
"""
- def getBugWatchesForRemoteBug(self, remote_bug, bug_watch_ids=None):
+ def getBugWatchesForRemoteBug(remote_bug, bug_watch_ids=None):
"""Returns bug watches referring to the given remote bug.
Returns a set of those bug watches, optionally limited to
=== modified file 'lib/lp/code/interfaces/branchlookup.py'
--- lib/lp/code/interfaces/branchlookup.py 2011-04-04 04:14:02 +0000
+++ lib/lp/code/interfaces/branchlookup.py 2011-08-23 04:43:26 +0000
@@ -1,4 +1,4 @@
-# Copyright 2009 Canonical Ltd. This software is licensed under the
+# Copyright 2009-2011 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
# pylint: disable-msg=E0213
@@ -66,7 +66,7 @@
Return None if no match was found.
"""
- def getIdAndTrailingPath(self, path, from_slave=False):
+ def getIdAndTrailingPath(path, from_slave=False):
"""Return id of and path within the branch identified by the `path`.
To explain by example, if the branch with id 5 has unique name
=== modified file 'lib/lp/hardwaredb/interfaces/hwdb.py'
--- lib/lp/hardwaredb/interfaces/hwdb.py 2011-06-24 13:54:15 +0000
+++ lib/lp/hardwaredb/interfaces/hwdb.py 2011-08-23 04:43:26 +0000
@@ -1,4 +1,4 @@
-# Copyright 2009 Canonical Ltd. This software is licensed under the
+# Copyright 2009-2011 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
# pylint: disable-msg=E0211,E0213
@@ -964,7 +964,7 @@
matches.
"""
- def getByID(self, id):
+ def getByID(id):
"""Return an IHWDevice record with the given database ID.
:param id: The database ID.
@@ -1283,38 +1283,38 @@
required=False),
architecture=TextLine(
title=u'A processor architecture',
- description=
+ description=(
u'If specified, the result set is limited to sumbissions '
- 'made for a specific architecture.',
+ 'made for a specific architecture.'),
required=False),
owner=Reference(
IPerson,
title=u'Person',
- description=
+ description=(
u'If specified, the result set is limited to sumbissions '
- 'from this person.',
+ 'from this person.'),
required=False),
created_before=Datetime(
title=u'Created Before',
- description=
- u'If specified, exclude results created after this date.',
+ description=(
+ u'If specified, exclude results created after this date.'),
required=False),
created_after=Datetime(
title=u'Created After',
- description=
+ description=(
u'If specified, exclude results created before or on '
- 'this date.',
+ 'this date.'),
required=False),
submitted_before=Datetime(
title=u'Created Before',
- description=
- u'If specified, exclude results submitted after this date.',
+ description=(
+ u'If specified, exclude results submitted after this date.'),
required=False),
submitted_after=Datetime(
title=u'Created After',
- description=
+ description=(
u'If specified, Exclude results submitted before or on '
- 'this date.',
+ 'this date.'),
required=False))
@call_with(user=REQUEST_USER)
@operation_returns_collection_of(IHWSubmission)
=== modified file 'lib/lp/registry/interfaces/distroseries.py'
--- lib/lp/registry/interfaces/distroseries.py 2011-08-18 03:55:10 +0000
+++ lib/lp/registry/interfaces/distroseries.py 2011-08-23 04:43:26 +0000
@@ -1090,7 +1090,7 @@
released == None will do no filtering on status.
"""
- def priorReleasedSeries(self, distribution, prior_to_date):
+ def priorReleasedSeries(distribution, prior_to_date):
"""Find distroseries for the supplied distro released before a
certain date.
=== modified file 'lib/lp/registry/interfaces/distroseriesparent.py'
--- lib/lp/registry/interfaces/distroseriesparent.py 2011-06-08 13:46:27 +0000
+++ lib/lp/registry/interfaces/distroseriesparent.py 2011-08-23 04:43:26 +0000
@@ -83,7 +83,7 @@
:param parent_series: An `IDistroseries`
"""
- def getByDerivedAndParentSeries(self, derived_series, parent_series):
+ def getByDerivedAndParentSeries(derived_series, parent_series):
"""Get the `DistroSeriesParent` by derived and parent series.
:param derived_series: The derived `IDistroseries`
=== modified file 'lib/lp/registry/interfaces/gpg.py'
--- lib/lp/registry/interfaces/gpg.py 2010-08-20 20:31:18 +0000
+++ lib/lp/registry/interfaces/gpg.py 2011-08-23 04:43:26 +0000
@@ -1,4 +1,4 @@
-# Copyright 2009 Canonical Ltd. This software is licensed under the
+# Copyright 2009-2011 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
# pylint: disable-msg=E0211,E0213
@@ -157,5 +157,5 @@
Optionally for a given owner and or a given status.
"""
- def getGPGKeysForPeople(self, people):
+ def getGPGKeysForPeople(people):
"""Return OpenPGP keys for a set of people."""
=== modified file 'lib/lp/registry/interfaces/product.py'
--- lib/lp/registry/interfaces/product.py 2011-05-27 20:03:56 +0000
+++ lib/lp/registry/interfaces/product.py 2011-08-23 04:43:26 +0000
@@ -1,4 +1,4 @@
-# Copyright 2009-2010 Canonical Ltd. This software is licensed under the
+# Copyright 2009-2011 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
# pylint: disable-msg=E0211,E0213
@@ -1035,7 +1035,7 @@
with a given bugtracker type.
"""
- def getSFLinkedProductsWithNoneRemoteProduct(self):
+ def getSFLinkedProductsWithNoneRemoteProduct():
"""Get IProducts with a sourceforge project and no remote_product."""
=== modified file 'lib/lp/registry/interfaces/projectgroup.py'
--- lib/lp/registry/interfaces/projectgroup.py 2011-05-27 20:03:56 +0000
+++ lib/lp/registry/interfaces/projectgroup.py 2011-08-23 04:43:26 +0000
@@ -1,4 +1,4 @@
-# Copyright 2009 Canonical Ltd. This software is licensed under the
+# Copyright 2009-2011 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
# pylint: disable-msg=E0211,E0213
@@ -377,7 +377,7 @@
If the project can't be found a NotFoundError will be raised.
"""
- def getByName(name, default=None, ignore_inactive=False):
+ def getByName(name, ignore_inactive=False):
"""Return the project with the given name, ignoring inactive projects
if ignore_inactive is True.
=== modified file 'lib/lp/soyuz/interfaces/archivepermission.py'
--- lib/lp/soyuz/interfaces/archivepermission.py 2011-08-19 14:57:16 +0000
+++ lib/lp/soyuz/interfaces/archivepermission.py 2011-08-23 04:43:26 +0000
@@ -1,4 +1,4 @@
-# Copyright 2009 Canonical Ltd. This software is licensed under the
+# Copyright 2009-2011 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
# pylint: disable-msg=E0213
@@ -411,7 +411,7 @@
:param component: An `IComponent` or a string package name.
"""
- def deleteQueueAdmin(self, archive, person, component):
+ def deleteQueueAdmin(archive, person, component):
"""Revoke queue admin permissions for a person.
:param archive: The context `IArchive` for the permission check.
=== modified file 'lib/lp/soyuz/interfaces/packagediff.py'
--- lib/lp/soyuz/interfaces/packagediff.py 2011-06-16 18:51:45 +0000
+++ lib/lp/soyuz/interfaces/packagediff.py 2011-08-23 04:43:26 +0000
@@ -1,4 +1,4 @@
-# Copyright 2009 Canonical Ltd. This software is licensed under the
+# Copyright 2009-2011 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
# pylint: disable-msg=E0211,E0213
@@ -102,7 +102,7 @@
:return a `SelectResult` ordered by id respecting the given limit.
"""
- def getDiffsToReleases(self, sprs, preload_for_display=False):
+ def getDiffsToReleases(sprs, preload_for_display=False):
"""Return all diffs that targetting a set of source package releases.
:param sprs: a sequence of `SourcePackageRelease` objects.
=== modified file 'lib/lp/translations/interfaces/poexportrequest.py'
--- lib/lp/translations/interfaces/poexportrequest.py 2010-08-20 20:31:18 +0000
+++ lib/lp/translations/interfaces/poexportrequest.py 2011-08-23 04:43:26 +0000
@@ -1,4 +1,4 @@
-# Copyright 2009-2010 Canonical Ltd. This software is licensed under the
+# Copyright 2009-2011 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
# pylint: disable-msg=E0211,E0213
@@ -56,7 +56,7 @@
processing of the request completes.
"""
- def removeRequest(self, request_ids):
+ def removeRequest(request_ids):
"""Remove a request off the queue.
:param request_ids: A list of request record ids as returned by
@@ -79,4 +79,3 @@
pofile = Object(
title=u'The translation file requested, if any.',
required=True, readonly=True, schema=IPOFile)
-
=== modified file 'lib/lp/translations/interfaces/translator.py'
--- lib/lp/translations/interfaces/translator.py 2010-08-20 20:31:18 +0000
+++ lib/lp/translations/interfaces/translator.py 2011-08-23 04:43:26 +0000
@@ -1,4 +1,4 @@
-# Copyright 2009 Canonical Ltd. This software is licensed under the
+# Copyright 2009-2011 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
# pylint: disable-msg=E0211,E0213
@@ -12,10 +12,7 @@
'ITranslatorSet',
]
-from zope.interface import (
- Attribute,
- Interface,
- )
+from zope.interface import Interface
from zope.schema import (
Choice,
Datetime,
@@ -91,8 +88,6 @@
class ITranslatorSet(Interface):
"""A container for `ITranslator`s."""
- title = Attribute('Title')
-
def new(translationgroup, language, translator, style_guide_url):
"""Create a new `ITranslator` for a `TranslationGroup`."""