launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #18938
[Merge] lp:~cjwatson/launchpad/zope-interface-class-decorators into lp:launchpad
Colin Watson has proposed merging lp:~cjwatson/launchpad/zope-interface-class-decorators into lp:launchpad.
Commit message:
Switch zope.interface users from class advice to class decorators.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/zope-interface-class-decorators/+merge/264175
Switch zope.interface users from class advice to class decorators.
This will, in the fullness of time, be needed as part of porting to Python 3; in the meantime, it appears to work fine on Python 2 with the zope.interface version we already have. We still need to do likewise with at least zope.component.adapts and lazr.delegates.delegates, but I can handle those a bit later.
Um, yeah. This is kind of a big patch, and you probably don't actually want to review this whole thing by eye. It's mostly the result of applying zope.fixers, with manual tweaks to fix up bugs in the automatic mangling (incorrect import transformations, lost comments, etc.). The main bit I had to handle substantially by hand was lib/lp/services/librarianserver/testing/fake.py, where using a class attribute as an argument to a decorator of that same class wasn't going to work.
--
The attached diff has been truncated due to its size.
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~cjwatson/launchpad/zope-interface-class-decorators into lp:launchpad.
=== modified file 'lib/lp/answers/browser/question.py'
--- lib/lp/answers/browser/question.py 2013-04-10 08:35:47 +0000
+++ lib/lp/answers/browser/question.py 2015-07-08 16:13:45 +0000
@@ -44,7 +44,7 @@
)
from zope.interface import (
alsoProvides,
- implements,
+ implementer,
providedBy,
)
from zope.schema import Choice
@@ -405,6 +405,7 @@
return self.context.isSubscribed(self.user)
+@implementer(IContextSourceBinder)
class QuestionLanguageVocabularyFactory:
"""Factory for a vocabulary containing a subset of the possible languages.
@@ -416,8 +417,6 @@
English variants.
"""
- implements(IContextSourceBinder)
-
def __init__(self, view):
"""Create a QuestionLanguageVocabularyFactory.
=== modified file 'lib/lp/answers/mail/handler.py'
--- lib/lp/answers/mail/handler.py 2012-01-01 02:58:52 +0000
+++ lib/lp/answers/mail/handler.py 2015-07-08 16:13:45 +0000
@@ -11,7 +11,7 @@
import re
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from lp.answers.enums import QuestionStatus
from lp.answers.interfaces.questioncollection import IQuestionSet
@@ -20,11 +20,10 @@
from lp.services.webapp.interfaces import ILaunchBag
+@implementer(IMailHandler)
class AnswerTrackerHandler:
"""Handles emails sent to the Answer Tracker."""
- implements(IMailHandler)
-
allow_unknown_users = False
# XXX flacoste 2007-04-23: The 'ticket' part is there for backward
=== modified file 'lib/lp/answers/model/answercontact.py'
--- lib/lp/answers/model/answercontact.py 2013-01-07 02:40:55 +0000
+++ lib/lp/answers/model/answercontact.py 2015-07-08 16:13:45 +0000
@@ -8,18 +8,17 @@
from sqlobject import ForeignKey
-from zope.interface import implements
+from zope.interface import implementer
from lp.answers.interfaces.answercontact import IAnswerContact
from lp.registry.interfaces.person import validate_public_person
from lp.services.database.sqlbase import SQLBase
+@implementer(IAnswerContact)
class AnswerContact(SQLBase):
"""An entry for an answer contact for an `IQuestionTarget`."""
- implements(IAnswerContact)
-
_defaultOrder = ['id']
_table = 'AnswerContact'
=== modified file 'lib/lp/answers/model/faq.py'
--- lib/lp/answers/model/faq.py 2015-03-13 06:00:30 +0000
+++ lib/lp/answers/model/faq.py 2015-07-08 16:13:45 +0000
@@ -20,7 +20,7 @@
)
from storm.expr import And
from zope.event import notify
-from zope.interface import implements
+from zope.interface import implementer
from lp.answers.interfaces.faq import (
CannotDeleteFAQ,
@@ -49,11 +49,10 @@
)
+@implementer(IFAQ)
class FAQ(SQLBase):
"""See `IFAQ`."""
- implements(IFAQ)
-
_table = 'FAQ'
_defaultOrder = ['date_created', 'id']
@@ -286,11 +285,10 @@
raise AssertionError("Unknown FAQSort value: %r" % sort)
+@implementer(IFAQSet)
class FAQSet:
"""See `IFAQSet`."""
- implements(IFAQSet)
-
def getFAQ(self, id):
"""See `IFAQSet`."""
return FAQ.getForTarget(id, None)
=== modified file 'lib/lp/answers/model/question.py'
--- lib/lp/answers/model/question.py 2015-03-13 19:05:50 +0000
+++ lib/lp/answers/model/question.py 2015-07-08 16:13:45 +0000
@@ -39,7 +39,7 @@
from zope.component import getUtility
from zope.event import notify
from zope.interface import (
- implements,
+ implementer,
providedBy,
)
from zope.security.interfaces import Unauthorized
@@ -157,11 +157,10 @@
return notify_question_modified
+@implementer(IQuestion, IBugLinkTarget)
class Question(SQLBase, BugLinkTargetMixin):
"""See `IQuestion`."""
- implements(IQuestion, IBugLinkTarget)
-
_table = 'Question'
_defaultOrder = ['-priority', 'datecreated']
@@ -691,11 +690,10 @@
message.visible = visible
+@implementer(IQuestionSet)
class QuestionSet:
"""The set of questions in the Answer Tracker."""
- implements(IQuestionSet)
-
def __init__(self):
"""See `IQuestionSet`."""
self.title = 'Launchpad'
=== modified file 'lib/lp/answers/model/questionjob.py'
--- lib/lp/answers/model/questionjob.py 2013-06-20 05:50:00 +0000
+++ lib/lp/answers/model/questionjob.py 2015-07-08 16:13:45 +0000
@@ -18,8 +18,8 @@
)
from zope.component import getUtility
from zope.interface import (
- classProvides,
- implements,
+ implementer,
+ provider,
)
from lp.answers.enums import (
@@ -50,11 +50,10 @@
from lp.services.scripts import log
+@implementer(IQuestionJob)
class QuestionJob(StormBase):
"""A Job for queued question emails."""
- implements(IQuestionJob)
-
__storm_table__ = 'QuestionJob'
id = Int(primary=True)
@@ -100,12 +99,12 @@
return QuestionEmailJob(self)
+@implementer(IQuestionEmailJob)
+@provider(IQuestionEmailJobSource)
class QuestionEmailJob(BaseRunnableJob):
"""Intermediate class for deriving from QuestionJob."""
delegates(IQuestionJob)
- implements(IQuestionEmailJob)
- classProvides(IQuestionEmailJobSource)
config = config.IQuestionEmailJobSource
def __init__(self, job):
=== modified file 'lib/lp/answers/model/questionmessage.py'
--- lib/lp/answers/model/questionmessage.py 2013-01-07 02:40:55 +0000
+++ lib/lp/answers/model/questionmessage.py 2015-07-08 16:13:45 +0000
@@ -11,7 +11,7 @@
from lazr.delegates import delegates
from sqlobject import ForeignKey
-from zope.interface import implements
+from zope.interface import implementer
from lp.answers.enums import (
QuestionAction,
@@ -25,11 +25,10 @@
from lp.services.propertycache import cachedproperty
+@implementer(IQuestionMessage)
class QuestionMessage(SQLBase):
"""A table linking questions and messages."""
- implements(IQuestionMessage)
-
delegates(IMessage, context='message')
_table = 'QuestionMessage'
=== modified file 'lib/lp/answers/model/questionreopening.py'
--- lib/lp/answers/model/questionreopening.py 2013-01-07 02:40:55 +0000
+++ lib/lp/answers/model/questionreopening.py 2015-07-08 16:13:45 +0000
@@ -11,7 +11,7 @@
from lazr.lifecycle.event import ObjectCreatedEvent
from sqlobject import ForeignKey
from zope.event import notify
-from zope.interface import implements
+from zope.interface import implementer
from zope.security.proxy import ProxyFactory
from lp.answers.enums import QuestionStatus
@@ -23,11 +23,10 @@
from lp.services.database.sqlbase import SQLBase
+@implementer(IQuestionReopening)
class QuestionReopening(SQLBase):
"""A table recording each time a question is re-opened."""
- implements(IQuestionReopening)
-
_table = 'QuestionReopening'
question = ForeignKey(
=== modified file 'lib/lp/answers/model/questionsubscription.py'
--- lib/lp/answers/model/questionsubscription.py 2013-01-07 02:40:55 +0000
+++ lib/lp/answers/model/questionsubscription.py 2015-07-08 16:13:45 +0000
@@ -13,7 +13,7 @@
DateTime,
Int,
)
-from zope.interface import implements
+from zope.interface import implementer
from lp.answers.interfaces.questionsubscription import IQuestionSubscription
from lp.registry.interfaces.person import validate_public_person
@@ -22,11 +22,10 @@
from lp.services.database.sqlbase import SQLBase
+@implementer(IQuestionSubscription)
class QuestionSubscription(SQLBase):
"""A subscription for person to a question."""
- implements(IQuestionSubscription)
-
_table = 'QuestionSubscription'
id = Int(primary=True)
=== modified file 'lib/lp/answers/publisher.py'
--- lib/lp/answers/publisher.py 2014-11-24 00:17:05 +0000
+++ lib/lp/answers/publisher.py 2015-07-08 16:13:45 +0000
@@ -12,7 +12,7 @@
]
-from zope.interface import implements
+from zope.interface import implementer
from zope.publisher.interfaces.browser import (
IBrowserRequest,
IDefaultBrowserLayer,
@@ -26,8 +26,8 @@
)
+@implementer(IFacet)
class AnswersFacet:
- implements(IFacet)
name = "answers"
rootsite = "answers"
@@ -39,9 +39,9 @@
"""The Answers layer."""
+@implementer(AnswersLayer)
class AnswersBrowserRequest(LaunchpadBrowserRequest):
"""Instances of AnswersBrowserRequest provide `AnswersLayer`."""
- implements(AnswersLayer)
def __init__(self, body_instream, environ, response=None):
super(AnswersBrowserRequest, self).__init__(
=== modified file 'lib/lp/answers/tests/test_question_notifications.py'
--- lib/lp/answers/tests/test_question_notifications.py 2014-01-30 15:04:06 +0000
+++ lib/lp/answers/tests/test_question_notifications.py 2015-07-08 16:13:45 +0000
@@ -12,7 +12,7 @@
from unittest import TestCase
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from zope.security.proxy import removeSecurityProxy
from lp.answers.enums import QuestionRecipientSet
@@ -74,9 +74,9 @@
self.subject = subject
+@implementer(IPerson)
class FakeUser:
"""A fake user."""
- implements(IPerson)
class FakeEvent:
=== modified file 'lib/lp/answers/vocabulary.py'
--- lib/lp/answers/vocabulary.py 2013-01-03 00:27:37 +0000
+++ lib/lp/answers/vocabulary.py 2015-07-08 16:13:45 +0000
@@ -12,7 +12,7 @@
from sqlobject import OR
from storm.expr import And
-from zope.interface import implements
+from zope.interface import implementer
from zope.schema.vocabulary import SimpleTerm
from lp.answers.interfaces.faq import IFAQ
@@ -31,9 +31,9 @@
)
+@implementer(IHugeVocabulary)
class FAQVocabulary(FilteredVocabularyBase):
"""Vocabulary containing all the FAQs in an `IFAQTarget`."""
- implements(IHugeVocabulary)
displayname = 'Select a FAQ'
step_title = 'Search'
=== modified file 'lib/lp/app/browser/badge.py'
--- lib/lp/app/browser/badge.py 2013-01-07 03:47:45 +0000
+++ lib/lp/app/browser/badge.py 2015-07-08 16:13:45 +0000
@@ -17,7 +17,7 @@
]
from zope.interface import (
- implements,
+ implementer,
Interface,
)
@@ -102,6 +102,7 @@
"""
+@implementer(IHasBadges)
class HasBadgeBase:
"""The standard base implementation for badge visibility.
@@ -111,7 +112,6 @@
The visibility of these badges are checked by calling a method like
`isFooBadgeVisible` where Foo is the capitalised name of the badge.
"""
- implements(IHasBadges)
# All private objects should show the private badge.
badges = ('private',)
=== modified file 'lib/lp/app/browser/folder.py'
--- lib/lp/app/browser/folder.py 2012-06-29 08:40:05 +0000
+++ lib/lp/app/browser/folder.py 2015-07-08 16:13:45 +0000
@@ -16,7 +16,7 @@
from zope.browserresource.file import setCacheControl
from zope.contenttype import guess_content_type
from zope.datetime import rfc1123_date
-from zope.interface import implements
+from zope.interface import implementer
from zope.publisher.interfaces import NotFound
from zope.publisher.interfaces.browser import IBrowserPublisher
@@ -38,6 +38,7 @@
self.lmh = rfc1123_date(self.lmt)
+@implementer(IBrowserPublisher)
class ExportedFolder:
"""View that gives access to the files in a folder.
@@ -51,8 +52,6 @@
to True to change this.
"""
- implements(IBrowserPublisher)
-
rev_part_re = re.compile('rev\d+$')
export_subdirectories = False
=== modified file 'lib/lp/app/browser/launchpad.py'
--- lib/lp/app/browser/launchpad.py 2015-04-20 09:48:57 +0000
+++ lib/lp/app/browser/launchpad.py 2015-07-08 16:13:45 +0000
@@ -44,7 +44,7 @@
from zope.i18nmessageid import Message
from zope.interface import (
alsoProvides,
- implements,
+ implementer,
Interface,
)
from zope.publisher.defaultview import getDefaultViewName
@@ -448,6 +448,7 @@
return []
+@implementer(IBrowserPublisher, ITraversable)
class Macro:
"""Keeps templates that are registered as pages from being URL accessable.
@@ -489,7 +490,6 @@
permission="zope.Public"
/>
"""
- implements(IBrowserPublisher, ITraversable)
def __init__(self, context, request):
self.context = context
=== modified file 'lib/lp/app/browser/launchpadform.py'
--- lib/lp/app/browser/launchpadform.py 2013-04-10 08:35:47 +0000
+++ lib/lp/app/browser/launchpadform.py 2015-07-08 16:13:45 +0000
@@ -35,7 +35,7 @@
)
from zope.interface import (
classImplements,
- implements,
+ implementer,
providedBy,
)
from zope.interface.advice import addClassAdvisor
@@ -570,6 +570,7 @@
return field
+@implementer(ITraversable)
class WidgetHasStructuredDoc:
"""Check if widget has structured doc.
@@ -577,8 +578,6 @@
tal:condition="widget/query:has-structured-doc"
"""
- implements(ITraversable)
-
def __init__(self, widget):
self.widget = widget
=== modified file 'lib/lp/app/browser/stringformatter.py'
--- lib/lp/app/browser/stringformatter.py 2015-06-29 23:02:22 +0000
+++ lib/lp/app/browser/stringformatter.py 2015-07-08 16:13:45 +0000
@@ -26,7 +26,7 @@
import markdown
from zope.component import getUtility
from zope.error.interfaces import IErrorReportingUtility
-from zope.interface import implements
+from zope.interface import implementer
from zope.traversing.interfaces import (
ITraversable,
TraversalError,
@@ -299,11 +299,10 @@
header_next = False
+@implementer(ITraversable)
class FormattersAPI:
"""Adapter from strings to HTML formatted text."""
- implements(ITraversable)
-
def __init__(self, stringtoformat):
self._stringtoformat = stringtoformat
=== modified file 'lib/lp/app/browser/tales.py'
--- lib/lp/app/browser/tales.py 2015-04-21 10:49:24 +0000
+++ lib/lp/app/browser/tales.py 2015-07-08 16:13:45 +0000
@@ -32,7 +32,7 @@
from zope.error.interfaces import IErrorReportingUtility
from zope.interface import (
Attribute,
- implements,
+ implementer,
Interface,
)
from zope.publisher.browser import BrowserView
@@ -351,6 +351,7 @@
return len(self._context)
+@implementer(ITraversable)
class EnumValueAPI:
"""Namespace to test the value of an EnumeratedType Item.
@@ -360,7 +361,6 @@
Registered for canonical.lazr.enum.Item.
"""
- implements(ITraversable)
def __init__(self, item):
self.item = item
@@ -381,6 +381,7 @@
return False
+@implementer(ITraversable)
class HTMLFormAPI:
"""HTML form helper API, available as request/htmlform:.
@@ -394,7 +395,6 @@
return None
"""
- implements(ITraversable)
def __init__(self, request):
self.form = request.form
@@ -420,10 +420,9 @@
return formvalue == value
+@implementer(ITraversable)
class HTMLFormOperation:
- implements(ITraversable)
-
def __init__(self, formvalue, operation):
self.formvalue = formvalue
self.operation = operation
@@ -442,9 +441,9 @@
cookie_scope = Attribute("The scope parameters for cookies.")
+@implementer(IRequestAPI)
class RequestAPI:
"""Adapter from IApplicationRequest to IRequestAPI."""
- implements(IRequestAPI)
def __init__(self, request):
self.request = request
@@ -465,11 +464,11 @@
return params
+@implementer(ITraversable)
class DBSchemaAPI:
"""Adapter from integers to things that can extract information from
DBSchemas.
"""
- implements(ITraversable)
def __init__(self, number):
self._number = number
@@ -482,6 +481,7 @@
raise TraversalError(name)
+@implementer(ITraversable)
class NoneFormatter:
"""Adapter from None to various string formats.
@@ -489,7 +489,6 @@
of handling NULL values from the database, which become None values for
attributes in content classes.
"""
- implements(ITraversable)
allowed_names = set([
'approximatedate',
@@ -543,11 +542,10 @@
raise TraversalError(name)
+@implementer(ITraversable)
class ObjectFormatterAPI:
"""Adapter for any object to a formatted string."""
- implements(ITraversable)
-
# Although we avoid mutables as class attributes, the two ones below are
# constants, so it's not a problem. We might want to use something like
# frozenset (http://code.activestate.com/recipes/414283/) here, though.
@@ -897,6 +895,7 @@
return markup % dict(icon=icon)
+@implementer(ITraversable)
class BugTaskImageDisplayAPI(ObjectImageDisplayAPI):
"""Adapter for IBugTask objects to a formatted string. This inherits
from the generic ObjectImageDisplayAPI and overrides the icon
@@ -904,7 +903,6 @@
Used for image:icon.
"""
- implements(ITraversable)
allowed_names = set([
'icon',
@@ -2072,11 +2070,10 @@
return self._make_external_link(self._context.remotebug)
+@implementer(ITraversable)
class NumberFormatterAPI:
"""Adapter for converting numbers to formatted strings."""
- implements(ITraversable)
-
def __init__(self, number):
self._number = number
@@ -2280,11 +2277,10 @@
self._context.sourcepackage, IPathAdapter, 'fmt').link(view_name)
+@implementer(ITraversable)
class DurationFormatterAPI:
"""Adapter from timedelta objects to a formatted string."""
- implements(ITraversable)
-
def __init__(self, duration):
self._duration = duration
@@ -2498,6 +2494,7 @@
return clean_path_split
+@implementer(ITraversable)
class PermissionRequiredQuery:
"""Check if the logged in user has a given permission on a given object.
@@ -2505,8 +2502,6 @@
tal:condition="person/required:launchpad.Edit"
"""
- implements(ITraversable)
-
def __init__(self, context):
self.context = context
@@ -2522,15 +2517,16 @@
path = TextLine(title=u'The absolute path to this main template.')
+@implementer(IMainTemplateFile)
class LaunchpadLayerToMainTemplateAdapter:
adapts(LaunchpadLayer)
- implements(IMainTemplateFile)
def __init__(self, context):
here = os.path.dirname(os.path.realpath(__file__))
self.path = os.path.join(here, '../templates/base-layout.pt')
+@implementer(ITraversable)
class PageMacroDispatcher:
"""Selects a macro, while storing information about page layout.
@@ -2550,8 +2546,6 @@
view/macro:has-watermark
"""
- implements(ITraversable)
-
def __init__(self, context):
# The context of this object is a view object.
self.context = context
@@ -2750,6 +2744,7 @@
diff.diff_content.content.filesize)
+@implementer(ITraversable)
class CSSFormatter:
"""A tales path adapter used for CSS rules.
@@ -2759,8 +2754,6 @@
value evaluates to false.
"""
- implements(ITraversable)
-
def __init__(self, context):
self.context = context
@@ -2781,11 +2774,10 @@
raise TraversalError(name)
+@implementer(ITraversable)
class IRCNicknameFormatterAPI(ObjectFormatterAPI):
"""Adapter from IrcID objects to a formatted string."""
- implements(ITraversable)
-
traversable_names = {
'displayname': 'displayname',
'formatted_displayname': 'formatted_displayname',
=== modified file 'lib/lp/app/browser/tests/menu.txt'
--- lib/lp/app/browser/tests/menu.txt 2011-12-24 17:49:30 +0000
+++ lib/lp/app/browser/tests/menu.txt 2015-07-08 16:13:45 +0000
@@ -6,7 +6,7 @@
are usually bound to a view.
>>> from zope.component import provideAdapter
- >>> from zope.interface import implements, Interface
+ >>> from zope.interface import implementer, Interface
>>> from lp.services.webapp.interfaces import INavigationMenu
>>> from lp.services.webapp.menu import (
... enabled_with_permission, Link, NavigationMenu)
@@ -33,9 +33,9 @@
... def admin(self):
... return Link('+admin', 'Administer this user')
- >>> class EditView(LaunchpadView):
+ >>> @implementer(IEditMenuMarker)
+ ... class EditView(LaunchpadView):
... """A simple view."""
- ... implements(IEditMenuMarker)
... # A hack that reveals secret of how facets work.
... __launchpad_facetname__ = 'overview'
=== modified file 'lib/lp/app/browser/tests/test_inlineeditpickerwidget.py'
--- lib/lp/app/browser/tests/test_inlineeditpickerwidget.py 2012-08-24 05:09:51 +0000
+++ lib/lp/app/browser/tests/test_inlineeditpickerwidget.py 2015-07-08 16:13:45 +0000
@@ -6,7 +6,7 @@
__metaclass__ = type
from zope.interface import (
- implements,
+ implementer,
Interface,
)
from zope.schema import Choice
@@ -72,8 +72,8 @@
class ITest(Interface):
test_field = Choice(**kwargs)
+ @implementer(ITest)
class Test:
- implements(ITest)
def __init__(self):
self.test_field = widget_value
=== modified file 'lib/lp/app/browser/tests/test_launchpadform_doc.py'
--- lib/lp/app/browser/tests/test_launchpadform_doc.py 2013-04-10 08:35:47 +0000
+++ lib/lp/app/browser/tests/test_launchpadform_doc.py 2015-07-08 16:13:45 +0000
@@ -10,7 +10,7 @@
)
from zope.interface import (
directlyProvides,
- implements,
+ implementer,
)
from lp.app.browser.launchpadform import LaunchpadFormView
@@ -67,8 +67,8 @@
"""Verify a field marked .for_display has no (Optional) marker."""
# IInputWidgets have an (Optional) marker if they are not required.
form = LaunchpadFormView(None, None)
+ @implementer(IInputWidget)
class FakeInputWidget:
- implements(IInputWidget)
def __init__(self, required):
self.required = required
form.widgets = {'widget': FakeInputWidget(required=False)}
@@ -78,8 +78,8 @@
self.assertFalse(form.showOptionalMarker('widget'))
# IDisplayWidgets have no (Optional) marker, regardless of whether
# they are required or not, since they are read only.
+ @implementer(IDisplayWidget)
class FakeDisplayWidget:
- implements(IDisplayWidget)
def __init__(self, required):
self.required = required
form.widgets = {'widget': FakeDisplayWidget(required=False)}
=== modified file 'lib/lp/app/browser/tests/test_page_macro.py'
--- lib/lp/app/browser/tests/test_page_macro.py 2012-03-23 20:26:55 +0000
+++ lib/lp/app/browser/tests/test_page_macro.py 2015-07-08 16:13:45 +0000
@@ -7,7 +7,7 @@
import os
-from zope.interface import implements
+from zope.interface import implementer
from zope.location.interfaces import LocationError
from zope.traversing.interfaces import IPathAdapter
@@ -31,8 +31,8 @@
"""A mechanism for adaption."""
+@implementer(ITest)
class TestObject:
- implements(ITest)
def __init__(self):
self.private = False
=== modified file 'lib/lp/app/browser/tests/test_vocabulary.py'
--- lib/lp/app/browser/tests/test_vocabulary.py 2013-04-10 07:45:16 +0000
+++ lib/lp/app/browser/tests/test_vocabulary.py 2015-07-08 16:13:45 +0000
@@ -15,7 +15,7 @@
getUtility,
)
from zope.formlib.interfaces import MissingInputError
-from zope.interface import implements
+from zope.interface import implementer
from zope.schema.interfaces import IVocabularyFactory
from zope.schema.vocabulary import SimpleTerm
from zope.security.proxy import removeSecurityProxy
@@ -450,8 +450,8 @@
self.getPickerEntry(distribution).alt_title_link)
+@implementer(IHugeVocabulary)
class TestPersonVocabulary:
- implements(IHugeVocabulary)
test_persons = []
@classmethod
=== modified file 'lib/lp/app/browser/tests/watermark.txt'
--- lib/lp/app/browser/tests/watermark.txt 2015-06-27 04:10:49 +0000
+++ lib/lp/app/browser/tests/watermark.txt 2015-07-08 16:13:45 +0000
@@ -114,9 +114,10 @@
If the view class implements IMajorHeadingView, then this is the index page
for the context and the heading is rendered in H1.
- >>> from zope.interface import implements
+ >>> from zope.interface import implementer
>>> from lp.app.interfaces.headings import IMajorHeadingView
- >>> class HeadingView(TrivialView):
- ... implements(IMajorHeadingView)
+ >>> @implementer(IMajorHeadingView)
+ ... class HeadingView(TrivialView):
+ ... pass
>>> print get_hierarchy(widget, viewcls=HeadingView).heading()
<h1...><a...>Widget</a></h1>
=== modified file 'lib/lp/app/browser/vocabulary.py'
--- lib/lp/app/browser/vocabulary.py 2014-07-09 03:08:57 +0000
+++ lib/lp/app/browser/vocabulary.py 2015-07-08 16:13:45 +0000
@@ -24,7 +24,7 @@
from zope.formlib.interfaces import MissingInputError
from zope.interface import (
Attribute,
- implements,
+ implementer,
Interface,
)
from zope.schema.interfaces import IVocabularyFactory
@@ -79,9 +79,9 @@
target_type = Attribute('Target data for target picker entries.')
+@implementer(IPickerEntry)
class PickerEntry:
"""See `IPickerEntry`."""
- implements(IPickerEntry)
def __init__(self, description=None, image=None, css=None, alt_title=None,
title_link=None, details=None, alt_title_link=None,
@@ -115,11 +115,10 @@
@adapter(Interface)
+@implementer(IPickerEntrySource)
class DefaultPickerEntrySourceAdapter(object):
"""Adapts Interface to IPickerEntrySource."""
- implements(IPickerEntrySource)
-
def __init__(self, context):
self.context = context
=== modified file 'lib/lp/app/doc/badges.txt'
--- lib/lp/app/doc/badges.txt 2013-04-11 05:53:01 +0000
+++ lib/lp/app/doc/badges.txt 2015-07-08 16:13:45 +0000
@@ -84,11 +84,11 @@
implementation of IHasBadges. HasBadgeBase is also a default adapter
for Interface, which just provides the privacy badge.
- >>> from zope.interface import Interface, Attribute, implements
+ >>> from zope.interface import Interface, Attribute, implementer
>>> from lp.app.browser.badge import IHasBadges, HasBadgeBase
>>> from lp.testing import verifyObject
- >>> class PrivateClass:
- ... implements(Interface)
+ >>> @implementer(Interface)
+ ... class PrivateClass:
... private = True
>>> private_object = PrivateClass()
>>> has_badge_base = HasBadgeBase(private_object)
@@ -168,9 +168,9 @@
... bugs = Attribute('Some linked bugs')
... blueprints = Attribute('Some linked blueprints')
- >>> from zope.interface import implements
- >>> class Foo(object):
- ... implements(IFoo)
+ >>> from zope.interface import implementer
+ >>> @implementer(IFoo)
+ ... class Foo(object):
... @property
... def bugs(self):
... print "Foo.bugs"
=== modified file 'lib/lp/app/doc/hierarchical-menu.txt'
--- lib/lp/app/doc/hierarchical-menu.txt 2014-11-16 09:15:46 +0000
+++ lib/lp/app/doc/hierarchical-menu.txt 2015-07-08 16:13:45 +0000
@@ -11,7 +11,7 @@
First, we need a hierarchy of objects to build upon:
>>> from zope.component import getMultiAdapter, provideAdapter
- >>> from zope.interface import Interface, implements
+ >>> from zope.interface import Interface, implementer
>>> class ICookbook(Interface):
... """A cookbook for holding recipes."""
@@ -25,8 +25,8 @@
>>> from lp.services.webapp.interfaces import ICanonicalUrlData
>>> from lp.services.webapp.url import urlappend
- >>> class BaseContent:
- ... implements(ICanonicalUrlData)
+ >>> @implementer(ICanonicalUrlData)
+ ... class BaseContent:
...
... def __init__(self, name, parent, path_prefix=None):
... self.name = name
@@ -40,14 +40,17 @@
>>> class Root(BaseContent):
... """ The site root."""
- >>> class Cookbook(BaseContent):
- ... implements(ICookbook)
-
- >>> class Recipe(BaseContent):
- ... implements(IRecipe)
-
- >>> class Cooker(BaseContent):
- ... implements(ICooker)
+ >>> @implementer(ICookbook)
+ ... class Cookbook(BaseContent):
+ ... pass
+
+ >>> @implementer(IRecipe)
+ ... class Recipe(BaseContent):
+ ... pass
+
+ >>> @implementer(ICooker)
+ ... class Cooker(BaseContent):
+ ... pass
Today we'll be cooking with Spam!
=== modified file 'lib/lp/app/doc/launchpadform.txt'
--- lib/lp/app/doc/launchpadform.txt 2014-01-30 15:04:06 +0000
+++ lib/lp/app/doc/launchpadform.txt 2015-07-08 16:13:45 +0000
@@ -46,7 +46,7 @@
an interface specifically tailored for data entry. Below is an
example schema:
- >>> from zope.interface import Interface, implements
+ >>> from zope.interface import Interface, implementer
>>> from zope.schema import TextLine
>>> class IFormTest(Interface):
@@ -54,8 +54,8 @@
... displayname = TextLine(title=u"Title")
... password = TextLine(title=u"Password")
- >>> class FormTest:
- ... implements(IFormTest)
+ >>> @implementer(IFormTest)
+ ... class FormTest:
... name = 'fred'
... displayname = 'Fred'
... password = 'password'
=== modified file 'lib/lp/app/doc/launchpadformharness.txt'
--- lib/lp/app/doc/launchpadformharness.txt 2011-12-24 17:49:30 +0000
+++ lib/lp/app/doc/launchpadformharness.txt 2015-07-08 16:13:45 +0000
@@ -7,7 +7,7 @@
To demonstrate its use we'll create a sample schema and view class:
- >>> from zope.interface import Interface, implements
+ >>> from zope.interface import Interface, implementer
>>> from zope.schema import Int, TextLine
>>> from lp.app.browser.launchpadform import LaunchpadFormView, action
@@ -15,8 +15,8 @@
... string = TextLine(title=u"String")
... number = Int(title=u"Number")
- >>> class HarnessTest:
- ... implements(IHarnessTest)
+ >>> @implementer(IHarnessTest)
+ ... class HarnessTest:
... string = None
... number = 0
=== modified file 'lib/lp/app/doc/menus.txt'
--- lib/lp/app/doc/menus.txt 2013-04-10 09:36:25 +0000
+++ lib/lp/app/doc/menus.txt 2015-07-08 16:13:45 +0000
@@ -43,11 +43,11 @@
They are derived from a base class that provides the required behaviours
for traversable objects.
- >>> from zope.interface import implements
+ >>> from zope.interface import implementer
>>> from lp.services.webapp.interfaces import ICanonicalUrlData
- >>> class BaseContent:
- ... implements(ICanonicalUrlData)
+ >>> @implementer(ICanonicalUrlData)
+ ... class BaseContent:
...
... def __init__(self, name, parent):
... self.name = name
@@ -58,11 +58,13 @@
>>> class Root(BaseContent):
... """The root of 'cookery', a vhost and facet."""
- >>> class Cookbook(BaseContent):
- ... implements(ICookbook)
+ >>> @implementer(ICookbook)
+ ... class Cookbook(BaseContent):
+ ... pass
- >>> class Recipe(BaseContent):
- ... implements(IRecipe)
+ >>> @implementer(IRecipe)
+ ... class Recipe(BaseContent):
+ ... pass
Content views associates with menus
@@ -113,17 +115,17 @@
>>> class RecipeIndexView(LaunchpadView):
... """View for summary of a recipe on the cookery facet."""
- >>> class RecipeEditInstructionsView(LaunchpadView):
+ >>> @implementer(IRecipeEditMenuMarker)
+ ... class RecipeEditInstructionsView(LaunchpadView):
... """View for editing recipe instructions on the cookery facet."""
- ... implements(IRecipeEditMenuMarker)
- >>> class RecipeEditIngredientsView(LaunchpadView):
+ >>> @implementer(IRecipeEditMenuMarker)
+ ... class RecipeEditIngredientsView(LaunchpadView):
... """View for editing recipe ingedients on the cookery facet."""
- ... implements(IRecipeEditMenuMarker)
- >>> class RecipeReadJournalView(LaunchpadView):
+ >>> @implementer(IRecipeJournalMenuMarker)
+ ... class RecipeReadJournalView(LaunchpadView):
... """View for reading a recipe's journal on the cookery facet."""
- ... implements(IRecipeJournalMenuMarker)
>>> class RecipeQuestionsAllView(LaunchpadView):
... """View for all questions of a recipe on the questions facet."""
@@ -1017,8 +1019,9 @@
>>> class IComment(Interface):
... """A comment on a recipe."""
- >>> class Comment(BaseContent):
- ... implements(IComment)
+ >>> @implementer(IComment)
+ ... class Comment(BaseContent):
+ ... pass
# This is usually done in ZCML by browser:defaultView.
@@ -1061,9 +1064,9 @@
or a navigation menu adapter, then no menu will be returned, and no
error will be raised by the template.
- >>> class MenulessView(LaunchpadView):
- ... # Needed so the IPathAdapter can be applied to this view.
- ... implements(Interface)
+ >>> # Needed so the IPathAdapter can be applied to this view.
+ >>> @implementer(Interface)
+ ... class MenulessView(LaunchpadView):
... __launchpad_facetname__ = 'cookery'
>>> menuless_view = MenulessView(comment, request)
=== modified file 'lib/lp/app/doc/tales.txt'
--- lib/lp/app/doc/tales.txt 2015-05-14 13:57:51 +0000
+++ lib/lp/app/doc/tales.txt 2015-07-08 16:13:45 +0000
@@ -1236,10 +1236,10 @@
Test the 'fmt:url' namespace for canonical urls.
- >>> from zope.interface import implements
+ >>> from zope.interface import implementer
>>> from lp.services.webapp.interfaces import ICanonicalUrlData
- >>> class ObjectThatHasUrl:
- ... implements(ICanonicalUrlData)
+ >>> @implementer(ICanonicalUrlData)
+ ... class ObjectThatHasUrl:
... path = 'bonobo/saki'
... inside = None
... rootsite = None
@@ -1253,11 +1253,11 @@
Make a mock-up IBrowserRequest, and use this as the interaction.
- >>> from zope.interface import implements
+ >>> from zope.interface import implementer
>>> from lp.services.webapp.interfaces import (
... ILaunchpadBrowserApplicationRequest)
- >>> class MockBrowserRequest:
- ... implements(ILaunchpadBrowserApplicationRequest,)
+ >>> @implementer(ILaunchpadBrowserApplicationRequest,)
+ ... class MockBrowserRequest:
...
... interaction = None
... principal = None
=== modified file 'lib/lp/app/longpoll/tests/test_longpoll.py'
--- lib/lp/app/longpoll/tests/test_longpoll.py 2012-01-01 02:58:52 +0000
+++ lib/lp/app/longpoll/tests/test_longpoll.py 2015-07-08 16:13:45 +0000
@@ -11,7 +11,7 @@
)
from zope.interface import (
Attribute,
- implements,
+ implementer,
Interface,
)
@@ -35,18 +35,17 @@
ident = Attribute("ident")
+@implementer(IFakeObject)
class FakeObject:
- implements(IFakeObject)
-
def __init__(self, ident):
self.ident = ident
+@implementer(ILongPollEvent)
class FakeEvent:
adapts(IFakeObject)
- implements(ILongPollEvent)
def __init__(self, source):
self.source = source
=== modified file 'lib/lp/app/model/cdatetime.py'
--- lib/lp/app/model/cdatetime.py 2011-12-22 17:24:23 +0000
+++ lib/lp/app/model/cdatetime.py 2015-07-08 16:13:45 +0000
@@ -8,7 +8,7 @@
from datetime import datetime
import pytz
-from zope.interface import implements
+from zope.interface import implementer
from lp.app.interfaces.launchpad import IAging
@@ -20,9 +20,9 @@
DAYS_PER_WEEK = 7
+@implementer(IAging)
class AgingAdapter:
"""Adapt an IHasDateCreated to an IAging."""
- implements(IAging)
def __init__(self, context):
self.context = context
=== modified file 'lib/lp/app/model/launchpad.py'
--- lib/lp/app/model/launchpad.py 2012-10-09 10:28:02 +0000
+++ lib/lp/app/model/launchpad.py 2015-07-08 16:13:45 +0000
@@ -11,7 +11,7 @@
'Privacy',
]
-from zope.interface import implements
+from zope.interface import implementer
from zope.security.interfaces import (
Forbidden,
ForbiddenAttribute,
@@ -22,9 +22,9 @@
from lp.app.interfaces.launchpad import IPrivacy
+@implementer(IPrivacy)
class Privacy:
"""Represent any object as IPrivacy."""
- implements(IPrivacy)
def __init__(self, context, private):
self.context = context
=== modified file 'lib/lp/app/security.py'
--- lib/lp/app/security.py 2013-02-20 05:30:49 +0000
+++ lib/lp/app/security.py 2015-07-08 16:13:45 +0000
@@ -17,14 +17,14 @@
)
from zope.component import queryAdapter
-from zope.interface import implements
+from zope.interface import implementer
from zope.security.permission import checkPermission
from lp.app.interfaces.security import IAuthorization
+@implementer(IAuthorization)
class AuthorizationBase:
- implements(IAuthorization)
permission = None
usedfor = None
=== modified file 'lib/lp/app/services.py'
--- lib/lp/app/services.py 2012-04-17 07:33:58 +0000
+++ lib/lp/app/services.py 2015-07-08 16:13:45 +0000
@@ -9,7 +9,7 @@
]
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from lp.app.interfaces.services import (
IService,
@@ -18,6 +18,7 @@
from lp.services.webapp.publisher import Navigation
+@implementer(IServiceFactory)
class ServiceFactory(Navigation):
"""Creates a named service.
@@ -25,8 +26,6 @@
Implementation classes are registered as named zope utilities.
"""
- implements(IServiceFactory)
-
def __init__(self):
super(ServiceFactory, self).__init__(None)
=== modified file 'lib/lp/app/tests/test_security.py'
--- lib/lp/app/tests/test_security.py 2015-03-05 19:40:24 +0000
+++ lib/lp/app/tests/test_security.py 2015-07-08 16:13:45 +0000
@@ -9,7 +9,7 @@
getUtility,
)
from zope.interface import (
- implements,
+ implementer,
Interface,
)
from zope.security.proxy import removeSecurityProxy
@@ -71,9 +71,9 @@
"""Marker interface to test forwarding."""
+@implementer(IDummy)
class Dummy:
"""An implementation of IDummy."""
- implements(IDummy)
class TestAuthorizationBase(TestCaseWithFactory):
=== modified file 'lib/lp/app/tests/test_services.py'
--- lib/lp/app/tests/test_services.py 2012-04-17 04:28:15 +0000
+++ lib/lp/app/tests/test_services.py 2015-07-08 16:13:45 +0000
@@ -5,7 +5,7 @@
from lazr.restful.interfaces._rest import IHTTPResource
from zope.component import getUtility
-from zope.interface.declarations import implements
+from zope.interface import implementer
from zope.publisher.interfaces import NotFound
from lp.app.interfaces.services import (
@@ -26,8 +26,8 @@
"""Fake service interface."""
+@implementer(IFakeService, IHTTPResource)
class FakeService:
- implements(IFakeService, IHTTPResource)
name = 'fake_service'
=== modified file 'lib/lp/app/utilities/celebrities.py'
--- lib/lp/app/utilities/celebrities.py 2015-06-30 01:07:40 +0000
+++ lib/lp/app/utilities/celebrities.py 2015-07-08 16:13:45 +0000
@@ -7,7 +7,7 @@
__all__ = ['LaunchpadCelebrities']
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from lp.app.errors import NotFoundError
from lp.app.interfaces.launchpad import ILaunchpadCelebrities
@@ -123,9 +123,9 @@
return celebrity.code == self.name
+@implementer(ILaunchpadCelebrities)
class LaunchpadCelebrities:
"""See `ILaunchpadCelebrities`."""
- implements(ILaunchpadCelebrities)
admin = PersonCelebrityDescriptor('admins')
software_center_agent = PersonCelebrityDescriptor(
=== modified file 'lib/lp/app/validators/__init__.py'
--- lib/lp/app/validators/__init__.py 2013-04-10 08:35:47 +0000
+++ lib/lp/app/validators/__init__.py 2015-07-08 16:13:45 +0000
@@ -16,7 +16,7 @@
)
from zope.formlib.interfaces import IWidgetInputError
from zope.interface import (
- implements,
+ implementer,
Interface,
)
from zope.schema.interfaces import ValidationError
@@ -32,6 +32,7 @@
"""Render as an HTML error message, as per IWidgetInputErrorView"""
+@implementer(ILaunchpadValidationError)
class LaunchpadValidationError(ValidationError):
"""A LaunchpadValidationError may be raised from a schema field
validation method.
@@ -48,7 +49,6 @@
... structured('<a title="%s">Ok</a>', '<evil/>')).snippet()
u'<a title="<evil/>">Ok</a>'
"""
- implements(ILaunchpadValidationError)
def __init__(self, message, already_escaped=False):
"""Create a LaunchpadValidationError instance.
@@ -85,13 +85,13 @@
"""
+@implementer(ILaunchpadWidgetInputErrorView)
class WidgetInputErrorView(Z3WidgetInputErrorView):
"""Display an input error as a snippet of text.
This is used to override the default Z3 one which blindly HTML encodes
error messages.
"""
- implements(ILaunchpadWidgetInputErrorView)
def snippet(self):
"""Convert a widget input error to an html snippet
=== modified file 'lib/lp/app/vocabularies.py'
--- lib/lp/app/vocabularies.py 2012-09-20 15:18:54 +0000
+++ lib/lp/app/vocabularies.py 2015-07-08 16:13:45 +0000
@@ -29,17 +29,16 @@
from lazr.enum import IEnumeratedType
-from zope.interface import implements
+from zope.interface import implementer
from zope.schema.vocabulary import (
SimpleTerm,
SimpleVocabulary,
)
+@implementer(IEnumeratedType)
class InformationTypeVocabulary(SimpleVocabulary):
- implements(IEnumeratedType)
-
def __init__(self, types):
terms = []
for type in types:
=== modified file 'lib/lp/app/widgets/announcementdate.py'
--- lib/lp/app/widgets/announcementdate.py 2013-04-10 08:35:47 +0000
+++ lib/lp/app/widgets/announcementdate.py 2015-07-08 16:13:45 +0000
@@ -16,7 +16,7 @@
CustomWidgetFactory,
SimpleInputWidget,
)
-from zope.interface import implements
+from zope.interface import implementer
from zope.schema import (
Choice,
Datetime,
@@ -38,11 +38,10 @@
"""A widget for selecting the date of a news item."""
+@implementer(IAlwaysSubmittedWidget)
class AnnouncementDateWidget(SimpleInputWidget):
"""See IAnnouncementDateWidget."""
- implements(IAlwaysSubmittedWidget)
-
def __init__(self, context, request):
SimpleInputWidget.__init__(self, context, request)
fields = form.Fields(
=== modified file 'lib/lp/app/widgets/context.py'
--- lib/lp/app/widgets/context.py 2011-02-02 15:43:31 +0000
+++ lib/lp/app/widgets/context.py 2015-07-08 16:13:45 +0000
@@ -9,7 +9,7 @@
__metaclass__ = type
from zope.interface import (
- implements,
+ implementer,
Interface,
)
@@ -26,9 +26,8 @@
pass
+@implementer(IContextWidget)
class ContextWidget(RequestWidget):
-
- implements(IContextWidget)
def __init__(self, context, vocabulary, request):
RequestWidget.__init__(self, context, request)
=== modified file 'lib/lp/app/widgets/exception.py'
--- lib/lp/app/widgets/exception.py 2013-04-10 08:35:47 +0000
+++ lib/lp/app/widgets/exception.py 2015-07-08 16:13:45 +0000
@@ -7,9 +7,10 @@
IWidgetInputErrorView,
WidgetInputError as _WidgetInputError,
)
-from zope.interface import implements
-
-
+from zope.interface import implementer
+
+
+@implementer(IWidgetInputError)
class WidgetInputError(_WidgetInputError):
"""A customized WidgetInputError to work around a bug in Z3
(The snippet method fails if errors is a list of ValidationError objects)
@@ -18,7 +19,6 @@
fixed upstream -- StuartBishop 20050520
"""
- implements(IWidgetInputError)
def __init__(self, field_name, widget_title, errors):
"""Initialize Error
@@ -35,9 +35,9 @@
return ', '.join([v.doc() for v in self.errors])
+@implementer(IWidgetInputErrorView)
class WidgetInputErrorView(object):
"""Rendering of IWidgetInputError"""
- implements(IWidgetInputErrorView)
def __init__(self, context, request):
self.context = context
=== modified file 'lib/lp/app/widgets/image.py'
--- lib/lp/app/widgets/image.py 2013-04-10 08:35:47 +0000
+++ lib/lp/app/widgets/image.py 2015-07-08 16:13:45 +0000
@@ -14,7 +14,7 @@
SimpleInputWidget,
)
from zope.formlib.widgets import FileWidget
-from zope.interface import implements
+from zope.interface import implementer
from zope.schema import (
Bytes,
Choice,
@@ -43,14 +43,13 @@
return contents
+@implementer(IAlwaysSubmittedWidget)
class ImageChangeWidget(SimpleInputWidget):
"""Widget for changing an existing image.
This widget should be used only on edit forms.
"""
- implements(IAlwaysSubmittedWidget)
-
EDIT_STYLE = 'editview'
ADD_STYLE = 'addview'
=== modified file 'lib/lp/app/widgets/launchpadtarget.py'
--- lib/lp/app/widgets/launchpadtarget.py 2013-04-10 08:35:47 +0000
+++ lib/lp/app/widgets/launchpadtarget.py 2015-07-08 16:13:45 +0000
@@ -19,7 +19,7 @@
InputWidget,
renderElement,
)
-from zope.interface import implements
+from zope.interface import implementer
from zope.schema import Choice
from lp.app.errors import (
@@ -40,11 +40,10 @@
)
+@implementer(IAlwaysSubmittedWidget, IMultiLineWidgetLayout, IInputWidget)
class LaunchpadTargetWidget(BrowserWidget, InputWidget):
"""Widget for selecting a product, distribution or package target."""
- implements(IAlwaysSubmittedWidget, IMultiLineWidgetLayout, IInputWidget)
-
template = ViewPageTemplateFile('templates/launchpad-target.pt')
default_option = "package"
_widgets_set_up = False
=== modified file 'lib/lp/app/widgets/owner.py'
--- lib/lp/app/widgets/owner.py 2013-04-10 08:35:47 +0000
+++ lib/lp/app/widgets/owner.py 2015-07-08 16:13:45 +0000
@@ -9,13 +9,14 @@
IInputWidget,
)
from zope.interface import (
- implements,
+ implementer,
Interface,
)
from lp.services.webapp.interfaces import ILaunchBag
+@implementer(IInputWidget, IBrowserWidget)
class RequestWidget(object):
'''A widget that sets itself to a value calculated from request
@@ -24,7 +25,6 @@
are the Views (the AddView and the Widgets). It is easier to define
a custom widget than to override the AddView
'''
- implements(IInputWidget, IBrowserWidget)
_prefix = 'field.'
name = ''
@@ -85,8 +85,8 @@
pass
+@implementer(IUserWidget)
class HiddenUserWidget(RequestWidget):
- implements(IUserWidget)
def __init__(self, context, vocabulary, request=None):
'''Construct the HiddenUserWidget.
=== modified file 'lib/lp/app/widgets/project.py'
--- lib/lp/app/widgets/project.py 2013-04-10 08:35:47 +0000
+++ lib/lp/app/widgets/project.py 2015-07-08 16:13:45 +0000
@@ -19,7 +19,7 @@
InputWidget,
renderElement,
)
-from zope.interface import implements
+from zope.interface import implementer
from zope.schema import Choice
from lp.app.errors import UnexpectedFormData
@@ -27,11 +27,10 @@
from lp.services.webapp.interfaces import IAlwaysSubmittedWidget
+@implementer(IAlwaysSubmittedWidget, IInputWidget)
class ProjectScopeWidget(BrowserWidget, InputWidget):
"""Widget for selecting a scope. Either 'All projects' or only one."""
- implements(IAlwaysSubmittedWidget, IInputWidget)
-
default_option = "all"
_error = None
=== modified file 'lib/lp/app/widgets/tests/test_launchpadtarget.py'
--- lib/lp/app/widgets/tests/test_launchpadtarget.py 2013-04-10 08:35:47 +0000
+++ lib/lp/app/widgets/tests/test_launchpadtarget.py 2015-07-08 16:13:45 +0000
@@ -13,7 +13,7 @@
WidgetInputError,
)
from zope.interface import (
- implements,
+ implementer,
Interface,
)
@@ -39,8 +39,8 @@
target = Reference(schema=Interface)
+@implementer(IThing)
class Thing:
- implements(IThing)
target = None
=== modified file 'lib/lp/app/widgets/tests/test_suggestion.py'
--- lib/lp/app/widgets/tests/test_suggestion.py 2015-05-14 13:57:51 +0000
+++ lib/lp/app/widgets/tests/test_suggestion.py 2015-07-08 16:13:45 +0000
@@ -16,7 +16,7 @@
getUtility,
provideUtility,
)
-from zope.interface import implements
+from zope.interface import implementer
from zope.schema import Choice
from zope.schema.interfaces import IVocabularyFactory
from zope.schema.vocabulary import (
@@ -50,8 +50,8 @@
self.displayname = displayname
+@implementer(IHugeVocabulary)
class SimpleHugeVocabulary(SimpleVocabulary, FilteredVocabularyBase):
- implements(IHugeVocabulary)
displayname = "Simple objects"
step_title = "Select something"
=== modified file 'lib/lp/archivepublisher/archivesigningkey.py'
--- lib/lp/archivepublisher/archivesigningkey.py 2012-12-26 01:12:37 +0000
+++ lib/lp/archivepublisher/archivesigningkey.py 2015-07-08 16:13:45 +0000
@@ -14,7 +14,7 @@
import gpgme
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from lp.app.interfaces.launchpad import ILaunchpadCelebrities
from lp.archivepublisher.config import getPubConfig
@@ -29,11 +29,10 @@
)
+@implementer(IArchiveSigningKey)
class ArchiveSigningKey:
"""`IArchive` adapter for manipulating its GPG key."""
- implements(IArchiveSigningKey)
-
def __init__(self, archive):
self.archive = archive
=== modified file 'lib/lp/archivepublisher/model/publisherconfig.py'
--- lib/lp/archivepublisher/model/publisherconfig.py 2013-06-20 05:50:00 +0000
+++ lib/lp/archivepublisher/model/publisherconfig.py 2015-07-08 16:13:45 +0000
@@ -16,7 +16,7 @@
Storm,
Unicode,
)
-from zope.interface import implements
+from zope.interface import implementer
from lp.archivepublisher.interfaces.publisherconfig import (
IPublisherConfig,
@@ -28,9 +28,9 @@
)
+@implementer(IPublisherConfig)
class PublisherConfig(Storm):
"""See `IArchiveAuthToken`."""
- implements(IPublisherConfig)
__storm_table__ = 'PublisherConfig'
id = Int(primary=True)
@@ -45,9 +45,9 @@
copy_base_url = Unicode(name='copy_base_url', allow_none=False)
+@implementer(IPublisherConfigSet)
class PublisherConfigSet:
"""See `IPublisherConfigSet`."""
- implements(IPublisherConfigSet)
title = "Soyuz Publisher Configurations"
def new(self, distribution, root_dir, base_url, copy_base_url):
=== modified file 'lib/lp/archiveuploader/tests/static-translations.txt'
--- lib/lp/archiveuploader/tests/static-translations.txt 2013-06-20 07:31:01 +0000
+++ lib/lp/archiveuploader/tests/static-translations.txt 2015-07-08 16:13:45 +0000
@@ -21,15 +21,15 @@
librarian and are retrieved using the webservice. We can demonstrate the
publishing behaviour using a mock PackageUploadCustom object:
- >>> from zope.interface import implements
+ >>> from zope.interface import implementer
>>> from lp.registry.interfaces.distribution import IDistributionSet
>>> from lp.registry.interfaces.pocket import PackagePublishingPocket
>>> from lp.soyuz.enums import PackageUploadCustomFormat
>>> from lp.soyuz.interfaces.queue import (
... IPackageUpload, IPackageUploadCustom)
>>> from lp.soyuz.model.queue import PackageUploadCustom
- >>> class MockPackageUploadCustom(PackageUploadCustom):
- ... implements(IPackageUploadCustom)
+ >>> @implementer(IPackageUploadCustom)
+ ... class MockPackageUploadCustom(PackageUploadCustom):
... packageupload = None
...
... def __init__(self):
@@ -48,4 +48,3 @@
>>> custom_upload.publish(logger=FakeLogger())
DEBUG Publishing custom to ubuntu/breezy-autotest
DEBUG Skipping publishing of static translations.
-
=== modified file 'lib/lp/archiveuploader/uploadpolicy.py'
--- lib/lp/archiveuploader/uploadpolicy.py 2014-08-13 08:34:49 +0000
+++ lib/lp/archiveuploader/uploadpolicy.py 2015-07-08 16:13:45 +0000
@@ -25,7 +25,7 @@
getUtility,
)
from zope.interface import (
- implements,
+ implementer,
Interface,
)
@@ -63,6 +63,7 @@
MIXED_ONLY = Item("Mixed only")
+@implementer(IArchiveUploadPolicy)
class AbstractUploadPolicy:
"""Encapsulate the policy of an upload to a launchpad archive.
@@ -72,7 +73,6 @@
tests themselves and they operate on NascentUpload instances in order
to verify them.
"""
- implements(IArchiveUploadPolicy)
name = 'abstract'
options = None
=== modified file 'lib/lp/blueprints/adapters.py'
--- lib/lp/blueprints/adapters.py 2012-03-19 09:39:07 +0000
+++ lib/lp/blueprints/adapters.py 2015-07-08 16:13:45 +0000
@@ -5,14 +5,14 @@
__metaclass__ = type
-from zope.interface import implements
+from zope.interface import implementer
from lp.blueprints.interfaces.specification import ISpecificationDelta
+@implementer(ISpecificationDelta)
class SpecificationDelta:
"""See lp.blueprints.interfaces.specification.ISpecificationDelta."""
- implements(ISpecificationDelta)
def __init__(self, specification, user, title=None,
summary=None, whiteboard=None, specurl=None, productseries=None,
=== modified file 'lib/lp/blueprints/browser/specificationbranch.py'
--- lib/lp/blueprints/browser/specificationbranch.py 2014-11-27 20:52:37 +0000
+++ lib/lp/blueprints/browser/specificationbranch.py 2015-07-08 16:13:45 +0000
@@ -11,7 +11,7 @@
'SpecificationBranchURL',
]
-from zope.interface import implements
+from zope.interface import implementer
from lp import _
from lp.app.browser.launchpadform import (
@@ -24,11 +24,10 @@
from lp.services.webapp.interfaces import ICanonicalUrlData
+@implementer(ICanonicalUrlData)
class SpecificationBranchURL:
"""Specification branch URL creation rules."""
- implements(ICanonicalUrlData)
-
rootsite = "blueprints"
def __init__(self, specification_branch):
=== modified file 'lib/lp/blueprints/browser/sprint.py'
--- lib/lp/blueprints/browser/sprint.py 2014-11-24 12:22:05 +0000
+++ lib/lp/blueprints/browser/sprint.py 2015-07-08 16:13:45 +0000
@@ -30,7 +30,7 @@
import pytz
from zope.component import getUtility
from zope.formlib.widgets import TextAreaWidget
-from zope.interface import implements
+from zope.interface import implementer
from lp import _
from lp.app.browser.launchpadform import (
@@ -102,8 +102,9 @@
usedfor = ISprint
+@implementer(IHeadingBreadcrumb, IMultiFacetedBreadcrumb)
class SprintBreadcrumb(TitleBreadcrumb):
- implements(IHeadingBreadcrumb, IMultiFacetedBreadcrumb)
+ pass
class SprintOverviewMenu(NavigationMenu):
@@ -170,10 +171,9 @@
page_title = 'Events'
+@implementer(IMajorHeadingView)
class SprintView(HasSpecificationsView):
- implements(IMajorHeadingView)
-
# XXX Michael Nelson 20090923 bug=435255
# This class inherits a label from HasSpecificationsView, which causes
# a second h1 to display. But as this view implements IMajorHeadingView
@@ -532,11 +532,10 @@
return Link('+all', text, icon='list')
+@implementer(IRegistryCollectionNavigationMenu)
class SprintSetView(LaunchpadView):
"""View for the /sprints top level collection page."""
- implements(IRegistryCollectionNavigationMenu)
-
page_title = 'Meetings and sprints registered in Launchpad'
def all_batched(self):
=== modified file 'lib/lp/blueprints/interfaces/specificationdependency.py'
--- lib/lp/blueprints/interfaces/specificationdependency.py 2013-01-07 02:40:55 +0000
+++ lib/lp/blueprints/interfaces/specificationdependency.py 2015-07-08 16:13:45 +0000
@@ -15,7 +15,7 @@
]
from zope.interface import (
- implements,
+ implementer,
Interface,
)
from zope.schema import (
@@ -50,8 +50,8 @@
vocabulary='SpecificationDependencies')
+@implementer(ISpecificationDependencyRemoval)
class SpecDependencyIsAlsoRemoval:
- implements(ISpecificationDependencyRemoval)
def __init__(self, specdep):
self.specdep = specdep
=== modified file 'lib/lp/blueprints/model/specification.py'
--- lib/lp/blueprints/model/specification.py 2015-02-16 13:01:34 +0000
+++ lib/lp/blueprints/model/specification.py 2015-07-08 16:13:45 +0000
@@ -32,7 +32,7 @@
from storm.store import Store
from zope.component import getUtility
from zope.event import notify
-from zope.interface import implements
+from zope.interface import implementer
from lp.app.enums import (
InformationType,
@@ -161,11 +161,10 @@
}
+@implementer(ISpecification, IBugLinkTarget, IInformationType)
class Specification(SQLBase, BugLinkTargetMixin, InformationTypeMixin):
"""See ISpecification."""
- implements(ISpecification, IBugLinkTarget, IInformationType)
-
_defaultOrder = ['-priority', 'definition_status', 'name', 'id']
# db field names
@@ -1001,11 +1000,10 @@
user, filter=[SpecificationFilter.ALL]).count()
+@implementer(ISpecificationSet)
class SpecificationSet(HasSpecificationsMixin):
"""The set of feature specifications."""
- implements(ISpecificationSet)
-
def __init__(self):
"""See ISpecificationSet."""
self.title = 'Specifications registered in Launchpad'
=== modified file 'lib/lp/blueprints/model/specificationbranch.py'
--- lib/lp/blueprints/model/specificationbranch.py 2013-01-07 02:40:55 +0000
+++ lib/lp/blueprints/model/specificationbranch.py 2015-07-08 16:13:45 +0000
@@ -14,7 +14,7 @@
ForeignKey,
IN,
)
-from zope.interface import implements
+from zope.interface import implementer
from lp.blueprints.interfaces.specificationbranch import (
ISpecificationBranch,
@@ -26,9 +26,9 @@
from lp.services.database.sqlbase import SQLBase
+@implementer(ISpecificationBranch)
class SpecificationBranch(SQLBase):
"""See `ISpecificationBranch`."""
- implements(ISpecificationBranch)
datecreated = UtcDateTimeCol(notNull=True, default=UTC_NOW)
specification = ForeignKey(dbName="specification",
@@ -40,9 +40,9 @@
storm_validator=validate_public_person, notNull=True)
+@implementer(ISpecificationBranchSet)
class SpecificationBranchSet:
"""See `ISpecificationBranchSet`."""
- implements(ISpecificationBranchSet)
def getSpecificationBranchesForBranches(self, branches, user):
"""See `ISpecificationBranchSet`."""
=== modified file 'lib/lp/blueprints/model/specificationbug.py'
--- lib/lp/blueprints/model/specificationbug.py 2013-01-07 02:40:55 +0000
+++ lib/lp/blueprints/model/specificationbug.py 2015-07-08 16:13:45 +0000
@@ -7,17 +7,16 @@
from lazr.restful.interfaces import IJSONPublishable
from sqlobject import ForeignKey
-from zope.interface import implements
+from zope.interface import implementer
from lp.blueprints.interfaces.specificationbug import ISpecificationBug
from lp.services.database.sqlbase import SQLBase
+@implementer(ISpecificationBug, IJSONPublishable)
class SpecificationBug(SQLBase):
"""A link between a spec and a bug."""
- implements(ISpecificationBug, IJSONPublishable)
-
_table = 'SpecificationBug'
specification = ForeignKey(dbName='specification',
foreignKey='Specification', notNull=True)
=== modified file 'lib/lp/blueprints/model/specificationdependency.py'
--- lib/lp/blueprints/model/specificationdependency.py 2013-01-07 02:40:55 +0000
+++ lib/lp/blueprints/model/specificationdependency.py 2015-07-08 16:13:45 +0000
@@ -6,7 +6,7 @@
__all__ = ['SpecificationDependency']
from sqlobject import ForeignKey
-from zope.interface import implements
+from zope.interface import implementer
from lp.blueprints.interfaces.specificationdependency import (
ISpecificationDependency,
@@ -14,11 +14,10 @@
from lp.services.database.sqlbase import SQLBase
+@implementer(ISpecificationDependency)
class SpecificationDependency(SQLBase):
"""A link between a spec and a bug."""
- implements(ISpecificationDependency)
-
_table = 'SpecificationDependency'
specification = ForeignKey(dbName='specification',
foreignKey='Specification', notNull=True)
=== modified file 'lib/lp/blueprints/model/specificationmessage.py'
--- lib/lp/blueprints/model/specificationmessage.py 2015-03-13 19:05:50 +0000
+++ lib/lp/blueprints/model/specificationmessage.py 2015-07-08 16:13:45 +0000
@@ -13,7 +13,7 @@
BoolCol,
ForeignKey,
)
-from zope.interface import implements
+from zope.interface import implementer
from lp.blueprints.interfaces.specificationmessage import (
ISpecificationMessage,
@@ -26,11 +26,10 @@
)
+@implementer(ISpecificationMessage)
class SpecificationMessage(SQLBase):
"""A table linking specifictions and messages."""
- implements(ISpecificationMessage)
-
_table = 'SpecificationMessage'
specification = ForeignKey(
@@ -39,11 +38,10 @@
visible = BoolCol(notNull=True, default=True)
+@implementer(ISpecificationMessageSet)
class SpecificationMessageSet:
"""See ISpecificationMessageSet."""
- implements(ISpecificationMessageSet)
-
def createMessage(self, subject, spec, owner, content=None):
"""See ISpecificationMessageSet."""
msg = Message(
=== modified file 'lib/lp/blueprints/model/specificationsubscription.py'
--- lib/lp/blueprints/model/specificationsubscription.py 2013-01-07 02:40:55 +0000
+++ lib/lp/blueprints/model/specificationsubscription.py 2015-07-08 16:13:45 +0000
@@ -10,7 +10,7 @@
ForeignKey,
)
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from lp.blueprints.interfaces.specificationsubscription import (
ISpecificationSubscription,
@@ -24,11 +24,10 @@
from lp.services.database.sqlbase import SQLBase
+@implementer(ISpecificationSubscription)
class SpecificationSubscription(SQLBase):
"""A subscription for person to a spec."""
- implements(ISpecificationSubscription)
-
_table = 'SpecificationSubscription'
specification = ForeignKey(dbName='specification',
foreignKey='Specification', notNull=True)
=== modified file 'lib/lp/blueprints/model/specificationworkitem.py'
--- lib/lp/blueprints/model/specificationworkitem.py 2015-03-02 00:40:01 +0000
+++ lib/lp/blueprints/model/specificationworkitem.py 2015-07-08 16:13:45 +0000
@@ -13,7 +13,7 @@
Unicode,
)
from storm.store import Store
-from zope.interface import implements
+from zope.interface import implementer
from lp.blueprints.enums import SpecificationWorkItemStatus
from lp.blueprints.interfaces.specificationworkitem import (
@@ -27,8 +27,8 @@
from lp.services.database.stormbase import StormBase
+@implementer(ISpecificationWorkItem)
class SpecificationWorkItem(StormBase):
- implements(ISpecificationWorkItem)
__storm_table__ = 'SpecificationWorkItem'
__storm_order__ = 'id'
@@ -69,8 +69,8 @@
return self.status == SpecificationWorkItemStatus.DONE
+@implementer(ISpecificationWorkItemSet)
class SpecificationWorkItemSet:
- implements(ISpecificationWorkItemSet)
def unlinkMilestone(self, milestone):
"""See `ISpecificationWorkItemSet`."""
=== modified file 'lib/lp/blueprints/model/sprint.py'
--- lib/lp/blueprints/model/sprint.py 2014-11-24 13:05:12 +0000
+++ lib/lp/blueprints/model/sprint.py 2015-07-08 16:13:45 +0000
@@ -21,7 +21,7 @@
Store,
)
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from lp.app.interfaces.launchpad import (
IHasIcon,
@@ -61,11 +61,10 @@
from lp.services.propertycache import cachedproperty
+@implementer(ISprint, IHasLogo, IHasMugshot, IHasIcon)
class Sprint(SQLBase, HasDriversMixin, HasSpecificationsMixin):
"""See `ISprint`."""
- implements(ISprint, IHasLogo, IHasMugshot, IHasIcon)
-
_defaultOrder = ['name']
# db field names
@@ -300,11 +299,10 @@
user.inTeam(admins))
+@implementer(ISprintSet)
class SprintSet:
"""The set of sprints."""
- implements(ISprintSet)
-
def __init__(self):
"""See `ISprintSet`."""
self.title = 'Sprints and meetings'
=== modified file 'lib/lp/blueprints/model/sprintattendance.py'
--- lib/lp/blueprints/model/sprintattendance.py 2014-11-24 13:05:12 +0000
+++ lib/lp/blueprints/model/sprintattendance.py 2015-07-08 16:13:45 +0000
@@ -10,7 +10,7 @@
Int,
Reference,
)
-from zope.interface import implements
+from zope.interface import implementer
from lp.blueprints.interfaces.sprintattendance import ISprintAttendance
from lp.registry.interfaces.person import validate_public_person
@@ -18,11 +18,10 @@
from lp.services.database.stormbase import StormBase
+@implementer(ISprintAttendance)
class SprintAttendance(StormBase):
"""A record of the attendance of a person at a sprint."""
- implements(ISprintAttendance)
-
__storm_table__ = 'SprintAttendance'
id = Int(primary=True)
=== modified file 'lib/lp/blueprints/model/sprintspecification.py'
--- lib/lp/blueprints/model/sprintspecification.py 2013-01-07 02:40:55 +0000
+++ lib/lp/blueprints/model/sprintspecification.py 2015-07-08 16:13:45 +0000
@@ -9,7 +9,7 @@
ForeignKey,
StringCol,
)
-from zope.interface import implements
+from zope.interface import implementer
from lp.blueprints.enums import SprintSpecificationStatus
from lp.blueprints.interfaces.sprintspecification import ISprintSpecification
@@ -23,11 +23,10 @@
from lp.services.database.sqlbase import SQLBase
+@implementer(ISprintSpecification)
class SprintSpecification(SQLBase):
"""A link between a sprint and a specification."""
- implements(ISprintSpecification)
-
_table = 'SprintSpecification'
sprint = ForeignKey(dbName='sprint', foreignKey='Sprint',
=== modified file 'lib/lp/blueprints/publisher.py'
--- lib/lp/blueprints/publisher.py 2014-11-23 21:37:40 +0000
+++ lib/lp/blueprints/publisher.py 2015-07-08 16:13:45 +0000
@@ -12,7 +12,7 @@
]
-from zope.interface import implements
+from zope.interface import implementer
from zope.publisher.interfaces.browser import (
IBrowserRequest,
IDefaultBrowserLayer,
@@ -26,8 +26,8 @@
)
+@implementer(IFacet)
class SpecificationsFacet:
- implements(IFacet)
name = "specifications"
rootsite = "blueprints"
@@ -39,9 +39,9 @@
"""The Blueprints layer."""
+@implementer(BlueprintsLayer)
class BlueprintsBrowserRequest(LaunchpadBrowserRequest):
"""Instances of BlueprintsBrowserRequest provide `BlueprintsLayer`."""
- implements(BlueprintsLayer)
def blueprints_request_publication_factory():
=== modified file 'lib/lp/blueprints/vocabularies/specificationdependency.py'
--- lib/lp/blueprints/vocabularies/specificationdependency.py 2013-05-24 07:25:24 +0000
+++ lib/lp/blueprints/vocabularies/specificationdependency.py 2015-07-08 16:13:45 +0000
@@ -15,7 +15,7 @@
Store,
)
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from zope.schema.vocabulary import SimpleTerm
from lp.blueprints.model.specification import (
@@ -42,6 +42,7 @@
)
+@implementer(IHugeVocabulary)
class SpecificationDepCandidatesVocabulary(SQLObjectVocabularyBase):
"""Specifications that could be dependencies of this spec.
@@ -62,8 +63,6 @@
linked to the same series.
"""
- implements(IHugeVocabulary)
-
_table = Specification
_orderBy = 'name'
displayname = 'Select a blueprint'
=== modified file 'lib/lp/bugs/adapters/bugchange.py'
--- lib/lp/bugs/adapters/bugchange.py 2013-11-29 14:12:13 +0000
+++ lib/lp/bugs/adapters/bugchange.py 2015-07-08 16:13:45 +0000
@@ -46,7 +46,7 @@
from textwrap import dedent
-from zope.interface import implements
+from zope.interface import implementer
from zope.security.proxy import isinstance as zope_isinstance
from lp.bugs.enums import BugNotificationLevel
@@ -138,11 +138,10 @@
new_value=field_delta['new'])
+@implementer(IBugChange)
class BugChangeBase:
"""An abstract base class for Bug[Task]Changes."""
- implements(IBugChange)
-
# Most changes will be at METADATA level.
change_level = BugNotificationLevel.METADATA
=== modified file 'lib/lp/bugs/adapters/bugdelta.py'
--- lib/lp/bugs/adapters/bugdelta.py 2012-04-27 05:56:48 +0000
+++ lib/lp/bugs/adapters/bugdelta.py 2015-07-08 16:13:45 +0000
@@ -5,14 +5,14 @@
__metaclass__ = type
-from zope.interface import implements
+from zope.interface import implementer
from lp.bugs.interfaces.bug import IBugDelta
+@implementer(IBugDelta)
class BugDelta:
"""See `IBugDelta`."""
- implements(IBugDelta)
def __init__(self, bug, bugurl, user,
title=None, description=None, name=None,
=== modified file 'lib/lp/bugs/browser/bug.py'
--- lib/lp/bugs/browser/bug.py 2015-03-13 19:05:50 +0000
+++ lib/lp/bugs/browser/bug.py 2015-07-08 16:13:45 +0000
@@ -50,7 +50,7 @@
from zope.event import notify
from zope.formlib.widgets import TextWidget
from zope.interface import (
- implements,
+ implementer,
Interface,
providedBy,
)
@@ -1172,9 +1172,9 @@
return "\n".join(texts)
+@implementer(ICanonicalUrlData)
class BugURL:
"""Bug URL creation rules."""
- implements(ICanonicalUrlData)
inside = None
rootsite = 'bugs'
=== modified file 'lib/lp/bugs/browser/bugattachment.py'
--- lib/lp/bugs/browser/bugattachment.py 2012-11-26 08:40:20 +0000
+++ lib/lp/bugs/browser/bugattachment.py 2015-07-08 16:13:45 +0000
@@ -18,7 +18,7 @@
getUtility,
)
from zope.contenttype import guess_content_type
-from zope.interface import implements
+from zope.interface import implementer
from lp.app.browser.launchpadform import (
action,
@@ -93,9 +93,9 @@
# Despite declaring compliance with ICanonicalUrlData, the LaunchBag
# dependency means this tends towards the "not canonical at all" end of
# the canonicalness scale. Beware.
+@implementer(ICanonicalUrlData)
class BugAttachmentURL:
"""Bug URL creation rules."""
- implements(ICanonicalUrlData)
rootsite = 'bugs'
=== modified file 'lib/lp/bugs/browser/bugbranch.py'
--- lib/lp/bugs/browser/bugbranch.py 2014-11-28 22:07:05 +0000
+++ lib/lp/bugs/browser/bugbranch.py 2015-07-08 16:13:45 +0000
@@ -17,7 +17,7 @@
getMultiAdapter,
)
from zope.interface import (
- implements,
+ implementer,
Interface,
)
@@ -138,9 +138,9 @@
bug.linkBranch(branch=self.context, registrant=self.user)
+@implementer(Interface)
class BugBranchXHTMLRepresentation:
adapts(IBugBranch, IWebServiceClientRequest)
- implements(Interface)
def __init__(self, branch, request):
self.branch = branch
=== modified file 'lib/lp/bugs/browser/bugcomment.py'
--- lib/lp/bugs/browser/bugcomment.py 2014-05-29 16:18:50 +0000
+++ lib/lp/bugs/browser/bugcomment.py 2015-07-08 16:13:45 +0000
@@ -30,7 +30,7 @@
getUtility,
)
from zope.interface import (
- implements,
+ implementer,
Interface,
)
from zope.security.proxy import removeSecurityProxy
@@ -173,6 +173,7 @@
yield [event for (kind, event) in window_group]
+@implementer(IBugComment)
class BugComment(MessageComment):
"""Data structure that holds all data pertaining to a bug comment.
@@ -184,7 +185,6 @@
canonical_url()s of BugComments to take you to the correct
(task-specific) location.
"""
- implements(IBugComment)
delegates(IMessage, '_message')
@@ -350,9 +350,9 @@
expand_reply_box = True
+@implementer(Interface)
class BugCommentXHTMLRepresentation:
adapts(IBugComment, IWebServiceClientRequest)
- implements(Interface)
def __init__(self, comment, request):
self.comment = comment
=== modified file 'lib/lp/bugs/browser/buglisting.py'
--- lib/lp/bugs/browser/buglisting.py 2015-01-29 08:00:20 +0000
+++ lib/lp/bugs/browser/buglisting.py 2015-07-08 16:13:45 +0000
@@ -42,7 +42,7 @@
from zope.formlib.interfaces import InputErrors
from zope.formlib.itemswidgets import RadioWidget
from zope.interface import (
- implements,
+ implementer,
Interface,
)
from zope.schema.vocabulary import getVocabularyRegistry
@@ -887,11 +887,10 @@
]
+@implementer(IBugTaskSearchListingMenu)
class BugTaskSearchListingView(LaunchpadFormView, FeedsMixin, BugsInfoMixin):
"""View that renders a list of bugs for a given set of search criteria."""
- implements(IBugTaskSearchListingMenu)
-
related_features = {
'bugs.dynamic_bug_listings.pre_fetch': False
}
=== modified file 'lib/lp/bugs/browser/bugtarget.py'
--- lib/lp/bugs/browser/bugtarget.py 2015-01-29 16:28:30 +0000
+++ lib/lp/bugs/browser/bugtarget.py 2015-07-08 16:13:45 +0000
@@ -38,7 +38,7 @@
from zope.formlib.widgets import TextWidget
from zope.interface import (
alsoProvides,
- implements,
+ implementer,
Interface,
)
from zope.publisher.interfaces import NotFound
@@ -214,11 +214,10 @@
self.updateContextFromData(data)
+@implementer(IBrowserPublisher)
class FileBugViewBase(LaunchpadFormView):
"""Base class for views related to filing a bug."""
- implements(IBrowserPublisher)
-
schema = IBug
custom_widget('information_type', LaunchpadRadioWidgetWithDescription)
=== modified file 'lib/lp/bugs/browser/bugtask.py'
--- lib/lp/bugs/browser/bugtask.py 2014-11-29 01:33:59 +0000
+++ lib/lp/bugs/browser/bugtask.py 2015-07-08 16:13:45 +0000
@@ -64,7 +64,6 @@
from zope.formlib.widget import CustomWidgetFactory
from zope.interface import (
implementer,
- implements,
providedBy,
)
from zope.schema import Choice
@@ -2272,11 +2271,10 @@
)
+@implementer(IObjectPrivacy)
class BugTaskPrivacyAdapter:
"""Provides `IObjectPrivacy` for `IBugTask`."""
- implements(IObjectPrivacy)
-
def __init__(self, context):
self.context = context
=== modified file 'lib/lp/bugs/browser/bugtracker.py'
--- lib/lp/bugs/browser/bugtracker.py 2013-05-02 17:52:00 +0000
+++ lib/lp/bugs/browser/bugtracker.py 2015-07-08 16:13:45 +0000
@@ -27,7 +27,7 @@
from zope.component import getUtility
from zope.formlib import form
from zope.formlib.widgets import TextAreaWidget
-from zope.interface import implements
+from zope.interface import implementer
from zope.schema import Choice
from zope.schema.vocabulary import SimpleVocabulary
@@ -560,11 +560,10 @@
return self.context.title
+@implementer(IRemoteBug)
class RemoteBug:
"""Represents a bug in a remote bug tracker."""
- implements(IRemoteBug)
-
def __init__(self, bugtracker, remotebug, bugs):
self.bugtracker = bugtracker
self.remotebug = remotebug
=== modified file 'lib/lp/bugs/browser/tests/test_expose.py'
--- lib/lp/bugs/browser/tests/test_expose.py 2015-06-29 02:00:53 +0000
+++ lib/lp/bugs/browser/tests/test_expose.py 2015-07-08 16:13:45 +0000
@@ -15,7 +15,7 @@
Equals,
KeysEqual,
)
-from zope.interface import implements
+from zope.interface import implementer
from zope.traversing.browser import absoluteURL
from lp.bugs.browser.structuralsubscription import (
@@ -45,10 +45,10 @@
)
+@implementer(IWebServiceClientRequest, IJSONRequestCache)
class FakeRequest:
"""A request that implements some interfaces so adapting returns itself.
"""
- implements(IWebServiceClientRequest, IJSONRequestCache)
def __init__(self):
self.objects = {}
=== modified file 'lib/lp/bugs/browser/widgets/bugtask.py'
--- lib/lp/bugs/browser/widgets/bugtask.py 2013-05-02 00:40:14 +0000
+++ lib/lp/bugs/browser/widgets/bugtask.py 2015-07-08 16:13:45 +0000
@@ -35,7 +35,7 @@
Widget,
)
from zope.interface import (
- implements,
+ implementer,
Interface,
)
from zope.schema.interfaces import (
@@ -73,11 +73,10 @@
from lp.services.webapp.interfaces import ILaunchBag
+@implementer(IInputWidget)
class BugTaskAssigneeWidget(Widget):
"""A widget for setting the assignee on an IBugTask."""
- implements(IInputWidget)
-
__call__ = ViewPageTemplateFile(
"templates/bugtask-assignee-widget.pt")
@@ -554,11 +553,10 @@
return getUtility(ILaunchpadCelebrities).ubuntu
+@implementer(IDisplayWidget)
class AssigneeDisplayWidget(BrowserWidget):
"""A widget for displaying an assignee."""
- implements(IDisplayWidget)
-
def __init__(self, context, vocabulary, request):
super(AssigneeDisplayWidget, self).__init__(context, request)
@@ -583,11 +581,10 @@
return renderElement('i', contents='unknown')
+@implementer(IDisplayWidget)
class DBItemDisplayWidget(BrowserWidget):
"""A widget for displaying a bugtask dbitem."""
- implements(IDisplayWidget)
-
def __init__(self, context, vocabulary, request):
super(DBItemDisplayWidget, self).__init__(context, request)
=== modified file 'lib/lp/bugs/doc/checkwatches.txt'
--- lib/lp/bugs/doc/checkwatches.txt 2013-02-11 12:41:19 +0000
+++ lib/lp/bugs/doc/checkwatches.txt 2015-07-08 16:13:45 +0000
@@ -295,7 +295,7 @@
We'll create a non-functioning ExternalBugtracker to demonstrate this.
- >>> from zope.interface import implements
+ >>> from zope.interface import implementer
>>> from lp.bugs.interfaces.bugtask import (
... BugTaskStatus, BugTaskImportance)
>>> from lp.bugs.interfaces.externalbugtracker import (
@@ -305,11 +305,10 @@
... BATCH_SIZE_UNLIMITED, ExternalBugTracker)
>>> nowish = datetime.now(utc)
- >>> class UselessExternalBugTracker(ExternalBugTracker):
- ...
- ... implements(
- ... ISupportsBackLinking, ISupportsCommentImport,
- ... ISupportsCommentPushing)
+ >>> @implementer(
+ ... ISupportsBackLinking, ISupportsCommentImport,
+ ... ISupportsCommentPushing)
+ ... class UselessExternalBugTracker(ExternalBugTracker):
...
... batch_size = BATCH_SIZE_UNLIMITED
...
=== modified file 'lib/lp/bugs/doc/externalbugtracker-bug-imports.txt'
--- lib/lp/bugs/doc/externalbugtracker-bug-imports.txt 2012-06-13 21:01:11 +0000
+++ lib/lp/bugs/doc/externalbugtracker-bug-imports.txt 2015-07-08 16:13:45 +0000
@@ -6,12 +6,12 @@
this by implementing ISupportsBugImport, and implement all the specified
methods.
- >>> from zope.interface import implements
+ >>> from zope.interface import implementer
>>> from lp.bugs.interfaces.externalbugtracker import ISupportsBugImport
>>> from lp.bugs.externalbugtracker import (
... ExternalBugTracker)
- >>> class BugImportingExternalBugTracker(ExternalBugTracker):
- ... implements(ISupportsBugImport)
+ >>> @implementer(ISupportsBugImport)
+ ... class BugImportingExternalBugTracker(ExternalBugTracker):
...
... _bugs = {}
...
=== modified file 'lib/lp/bugs/doc/externalbugtracker-comment-imports.txt'
--- lib/lp/bugs/doc/externalbugtracker-comment-imports.txt 2013-05-02 00:40:14 +0000
+++ lib/lp/bugs/doc/externalbugtracker-comment-imports.txt 2015-07-08 16:13:45 +0000
@@ -6,7 +6,7 @@
In order to demonstrate this we need to create example Bug, BugTracker
and BugWatch instances with which to work.
- >>> from zope.interface import implements
+ >>> from zope.interface import implementer
>>> from lp.services.config import config
>>> from lp.bugs.tests.externalbugtracker import (
... new_bugtracker)
@@ -42,8 +42,8 @@
>>> from lp.bugs.externalbugtracker import (
... ExternalBugTracker)
>>> from lp.bugs.interfaces.externalbugtracker import ISupportsCommentImport
- >>> class CommentImportingExternalBugTracker(ExternalBugTracker):
- ... implements(ISupportsCommentImport)
+ >>> @implementer(ISupportsCommentImport)
+ ... class CommentImportingExternalBugTracker(ExternalBugTracker):
...
... comment_dict = {}
... remote_comments = {
=== modified file 'lib/lp/bugs/doc/externalbugtracker-comment-pushing.txt'
--- lib/lp/bugs/doc/externalbugtracker-comment-pushing.txt 2012-04-12 11:38:44 +0000
+++ lib/lp/bugs/doc/externalbugtracker-comment-pushing.txt 2015-07-08 16:13:45 +0000
@@ -6,7 +6,7 @@
In order to demonstrate this we need to create example Bug, BugTracker,
BugWatch, Message and BugMessage instances with which to work.
- >>> from zope.interface import implements
+ >>> from zope.interface import implementer
>>> from lp.bugs.tests.externalbugtracker import (
... new_bugtracker)
>>> from lp.services.messages.interfaces.message import IMessageSet
@@ -48,8 +48,8 @@
>>> from lp.bugs.externalbugtracker import (
... ExternalBugTracker)
- >>> class CommentPushingExternalBugTracker(ExternalBugTracker):
- ... implements(ISupportsCommentPushing)
+ >>> @implementer(ISupportsCommentPushing)
+ ... class CommentPushingExternalBugTracker(ExternalBugTracker):
...
... next_comment_id = 1
... remote_comments = {}
@@ -180,9 +180,9 @@
example ExternalBugTracker that does comment importing.
>>> from lp.bugs.interfaces.externalbugtracker import ISupportsCommentImport
- >>> class CommentImportingExternalBugTracker(
+ >>> @implementer(ISupportsCommentImport)
+ ... class CommentImportingExternalBugTracker(
... CommentPushingExternalBugTracker):
- ... implements(ISupportsCommentImport)
...
... external_comment_dict = {
... '4': "External comment 1.",
=== modified file 'lib/lp/bugs/doc/externalbugtracker-linking-back.txt'
--- lib/lp/bugs/doc/externalbugtracker-linking-back.txt 2012-04-12 11:38:44 +0000
+++ lib/lp/bugs/doc/externalbugtracker-linking-back.txt 2015-07-08 16:13:45 +0000
@@ -5,14 +5,14 @@
easier to users of the external bug tracker to get more information
about the bug.
- >>> from zope.interface import implements
+ >>> from zope.interface import implementer
>>> from lp.bugs.tests.externalbugtracker import (
... TestExternalBugTracker)
>>> from lp.bugs.interfaces.externalbugtracker import (
... ISupportsBackLinking)
- >>> class BackLinkingExternalBugTracker(TestExternalBugTracker):
- ... implements(ISupportsBackLinking)
+ >>> @implementer(ISupportsBackLinking)
+ ... class BackLinkingExternalBugTracker(TestExternalBugTracker):
...
... def __init__(self, baseurl):
... super(BackLinkingExternalBugTracker, self).__init__(baseurl)
=== modified file 'lib/lp/bugs/doc/externalbugtracker.txt'
--- lib/lp/bugs/doc/externalbugtracker.txt 2012-12-26 01:32:19 +0000
+++ lib/lp/bugs/doc/externalbugtracker.txt 2015-07-08 16:13:45 +0000
@@ -396,13 +396,13 @@
comments from it. Bug watches will still be updated, but a warning is
logged saying that comments won't be imported.
- >>> from zope.interface import implements
+ >>> from zope.interface import implementer
>>> from lp.bugs.interfaces.externalbugtracker import (
... ISupportsCommentImport,
... )
- >>> class CommentImportExternalBugTracker(TimeUnknownExternalBugTracker):
+ >>> @implementer(ISupportsCommentImport)
+ ... class CommentImportExternalBugTracker(TimeUnknownExternalBugTracker):
... baseurl = 'http://whatever.com'
- ... implements(ISupportsCommentImport)
... sync_comments = True
>>> checkwatches_master = CheckwatchesMaster(
=== modified file 'lib/lp/bugs/externalbugtracker/base.py'
--- lib/lp/bugs/externalbugtracker/base.py 2013-02-11 03:32:00 +0000
+++ lib/lp/bugs/externalbugtracker/base.py 2015-07-08 16:13:45 +0000
@@ -29,7 +29,7 @@
import urllib2
from urlparse import urlparse
-from zope.interface import implements
+from zope.interface import implementer
from lp.bugs.adapters import treelookup
from lp.bugs.interfaces.bugtask import BugTaskStatus
@@ -134,11 +134,10 @@
"""Raised when a bug is marked private on the remote bugtracker."""
+@implementer(IExternalBugTracker)
class ExternalBugTracker:
"""Base class for an external bug tracker."""
- implements(IExternalBugTracker)
-
batch_size = None
batch_query_threshold = config.checkwatches.batch_query_threshold
timeout = config.checkwatches.default_socket_timeout
=== modified file 'lib/lp/bugs/externalbugtracker/bugzilla.py'
--- lib/lp/bugs/externalbugtracker/bugzilla.py 2015-03-13 19:05:50 +0000
+++ lib/lp/bugs/externalbugtracker/bugzilla.py 2015-07-08 16:13:45 +0000
@@ -22,7 +22,7 @@
import pytz
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from lp.bugs.externalbugtracker.base import (
BugNotFound,
@@ -546,12 +546,11 @@
return decorator
+@implementer(
+ ISupportsBackLinking, ISupportsCommentImport, ISupportsCommentPushing)
class BugzillaAPI(Bugzilla):
"""An `ExternalBugTracker` to handle Bugzillas that offer an API."""
- implements(
- ISupportsBackLinking, ISupportsCommentImport, ISupportsCommentPushing)
-
def __init__(self, baseurl, xmlrpc_transport=None,
internal_xmlrpc_transport=None):
super(BugzillaAPI, self).__init__(baseurl)
@@ -902,13 +901,11 @@
self.xmlrpc_proxy.Bug.update_see_also(request_params)
+@implementer(
+ ISupportsBackLinking, ISupportsCommentImport, ISupportsCommentPushing)
class BugzillaLPPlugin(BugzillaAPI):
"""An `ExternalBugTracker` to handle Bugzillas using the LP Plugin."""
- implements(
- ISupportsBackLinking, ISupportsCommentImport,
- ISupportsCommentPushing)
-
def getExternalBugTrackerToUse(self):
"""The Bugzilla LP Plugin has been chosen, so return self."""
return self
=== modified file 'lib/lp/bugs/externalbugtracker/debbugs.py'
--- lib/lp/bugs/externalbugtracker/debbugs.py 2015-03-13 19:05:50 +0000
+++ lib/lp/bugs/externalbugtracker/debbugs.py 2015-07-08 16:13:45 +0000
@@ -21,7 +21,7 @@
import pytz
import transaction
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from lp.bugs.externalbugtracker import (
BATCH_SIZE_UNLIMITED,
@@ -58,12 +58,11 @@
"""The Debian bug database was not found."""
+@implementer(
+ ISupportsBugImport, ISupportsCommentImport, ISupportsCommentPushing)
class DebBugs(ExternalBugTracker):
"""A class that deals with communications with a debbugs db."""
- implements(
- ISupportsBugImport, ISupportsCommentImport, ISupportsCommentPushing)
-
# We don't support different versions of debbugs.
version = None
debbugs_pl = os.path.join(
=== modified file 'lib/lp/bugs/externalbugtracker/tests/test_externalbugtracker.py'
--- lib/lp/bugs/externalbugtracker/tests/test_externalbugtracker.py 2013-02-11 04:44:28 +0000
+++ lib/lp/bugs/externalbugtracker/tests/test_externalbugtracker.py 2015-07-08 16:13:45 +0000
@@ -8,7 +8,7 @@
from StringIO import StringIO
import urllib2
-from zope.interface import implements
+from zope.interface import implementer
from lp.bugs.externalbugtracker.base import (
BugTrackerConnectError,
@@ -29,16 +29,19 @@
from lp.testing.layers import ZopelessLayer
+@implementer(ISupportsBackLinking)
class BackLinkingExternalBugTracker(ExternalBugTracker):
- implements(ISupportsBackLinking)
-
-
+ pass
+
+
+@implementer(ISupportsCommentImport)
class CommentImportingExternalBugTracker(ExternalBugTracker):
- implements(ISupportsCommentImport)
-
-
+ pass
+
+
+@implementer(ISupportsCommentPushing)
class CommentPushingExternalBugTracker(ExternalBugTracker):
- implements(ISupportsCommentPushing)
+ pass
class TestCheckwatchesConfig(TestCase):
=== modified file 'lib/lp/bugs/externalbugtracker/trac.py'
--- lib/lp/bugs/externalbugtracker/trac.py 2015-03-13 19:05:50 +0000
+++ lib/lp/bugs/externalbugtracker/trac.py 2015-07-08 16:13:45 +0000
@@ -17,7 +17,7 @@
import pytz
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from lp.app.validators.email import valid_email
from lp.bugs.externalbugtracker.base import (
@@ -310,12 +310,11 @@
return decorator
+@implementer(
+ ISupportsBackLinking, ISupportsCommentImport, ISupportsCommentPushing)
class TracLPPlugin(Trac):
"""A Trac instance having the LP plugin installed."""
- implements(
- ISupportsBackLinking, ISupportsCommentImport, ISupportsCommentPushing)
-
def __init__(self, baseurl, xmlrpc_transport=None,
internal_xmlrpc_transport=None, cookie_jar=None):
super(TracLPPlugin, self).__init__(baseurl)
=== modified file 'lib/lp/bugs/interfaces/buglink.py'
--- lib/lp/bugs/interfaces/buglink.py 2013-01-07 02:40:55 +0000
+++ lib/lp/bugs/interfaces/buglink.py 2015-07-08 16:13:45 +0000
@@ -22,7 +22,7 @@
)
from zope.interface import (
Attribute,
- implements,
+ implementer,
Interface,
)
from zope.schema import (
@@ -100,13 +100,12 @@
# code layout policy, this should really be in vocabularies.buglinks but this
# is not possible because of dependencies on interfaces in some vocabularies
# modules.
+@implementer(IContextSourceBinder)
class BugLinksVocabularyFactory:
"""IContextSourceBinder that creates a vocabulary of the linked bugs on
the IBugLinkTarget.
"""
- implements(IContextSourceBinder)
-
def __call__(self, context):
"""See IContextSourceBinder."""
terms = []
=== modified file 'lib/lp/bugs/mail/bugnotificationrecipients.py'
--- lib/lp/bugs/mail/bugnotificationrecipients.py 2012-08-16 00:50:36 +0000
+++ lib/lp/bugs/mail/bugnotificationrecipients.py 2015-07-08 16:13:45 +0000
@@ -8,12 +8,13 @@
'BugNotificationRecipients',
]
-from zope.interface import implements
+from zope.interface import implementer
from lp.services.mail.interfaces import INotificationRecipientSet
from lp.services.mail.notificationrecipientset import NotificationRecipientSet
+@implementer(INotificationRecipientSet)
class BugNotificationRecipients(NotificationRecipientSet):
"""A set of emails and rationales notified for a bug change.
@@ -36,7 +37,6 @@
Instances of this class are meant to be returned by
IBug.getBugNotificationRecipients().
"""
- implements(INotificationRecipientSet)
def __init__(self, duplicateof=None):
"""Constructs a new BugNotificationRecipients instance.
=== modified file 'lib/lp/bugs/mail/commands.py'
--- lib/lp/bugs/mail/commands.py 2012-09-17 16:13:40 +0000
+++ lib/lp/bugs/mail/commands.py 2015-07-08 16:13:45 +0000
@@ -20,7 +20,7 @@
from zope.component import getUtility
from zope.event import notify
from zope.interface import (
- implements,
+ implementer,
providedBy,
)
from zope.schema.interfaces import (
@@ -83,9 +83,9 @@
error_templates = os.path.join(os.path.dirname(__file__), 'errortemplates')
+@implementer(IBugEmailCommand)
class BugEmailCommand(EmailCommand):
"""Creates new bug, or returns an existing one."""
- implements(IBugEmailCommand)
_numberOfArguments = 1
RANK = 0
@@ -153,6 +153,7 @@
return bug, None
+@implementer(IBugEditEmailCommand)
class PrivateEmailCommand(EmailCommand):
"""Marks a bug public or private.
@@ -161,8 +162,6 @@
updating an attribute.
"""
- implements(IBugEditEmailCommand)
-
_numberOfArguments = 1
RANK = 3
@@ -217,11 +216,10 @@
return context, current_event
+@implementer(IBugEditEmailCommand)
class SecurityEmailCommand(EmailCommand):
"""Marks a bug as security related."""
- implements(IBugEditEmailCommand)
-
_numberOfArguments = 1
RANK = 2
@@ -279,10 +277,9 @@
return context, current_event
+@implementer(IBugEditEmailCommand)
class SubscribeEmailCommand(EmailCommand):
"""Subscribes someone to the bug."""
-
- implements(IBugEditEmailCommand)
RANK = 7
def execute(self, bug, current_event):
@@ -327,10 +324,9 @@
return bug, current_event
+@implementer(IBugEditEmailCommand)
class UnsubscribeEmailCommand(EmailCommand):
"""Unsubscribes someone from the bug."""
-
- implements(IBugEditEmailCommand)
RANK = 8
def execute(self, bug, current_event):
@@ -367,10 +363,9 @@
return bug, current_event
+@implementer(IBugEditEmailCommand)
class SummaryEmailCommand(EditEmailCommand):
"""Changes the title of the bug."""
-
- implements(IBugEditEmailCommand)
_numberOfArguments = 1
RANK = 1
case_insensitive_args = False
@@ -403,10 +398,9 @@
return {'title': self.string_args[0]}
+@implementer(IBugEditEmailCommand)
class DuplicateEmailCommand(EmailCommand):
"""Marks a bug as a duplicate of another bug."""
-
- implements(IBugEditEmailCommand)
_numberOfArguments = 1
RANK = 6
@@ -447,11 +441,10 @@
return bug, current_event
+@implementer(IBugEditEmailCommand)
class CVEEmailCommand(EmailCommand):
"""Links a CVE to a bug."""
- implements(IBugEditEmailCommand)
-
_numberOfArguments = 1
RANK = 5
case_insensitive_args = False
@@ -471,10 +464,9 @@
return bug, current_event
+@implementer(IBugTaskEmailCommand)
class AffectsEmailCommand(EmailCommand):
"""Either creates a new task, or edits an existing task."""
-
- implements(IBugTaskEmailCommand)
_numberOfArguments = 1
RANK = 0
@@ -683,11 +675,10 @@
return bug.addTask(user, bug_target)
+@implementer(IBugTaskEditEmailCommand)
class AssigneeEmailCommand(EditEmailCommand):
"""Assigns someone to the bug."""
- implements(IBugTaskEditEmailCommand)
-
_numberOfArguments = 1
RANK = 2
@@ -706,11 +697,10 @@
context.transitionToAssignee(attr_value)
+@implementer(IBugTaskEditEmailCommand)
class MilestoneEmailCommand(EditEmailCommand):
"""Sets the milestone for the bugtask."""
- implements(IBugTaskEditEmailCommand)
-
_numberOfArguments = 1
RANK = 3
@@ -739,6 +729,7 @@
"milestones." % (context.pillar.title,))
+@implementer(IBugTaskEditEmailCommand)
class DBSchemaEditEmailCommand(EditEmailCommand):
"""Helper class for edit DBSchema attributes.
@@ -751,8 +742,6 @@
dbschema = FooDBSchema
"""
- implements(IBugTaskEditEmailCommand)
-
_numberOfArguments = 1
def convertArguments(self, context):
@@ -779,10 +768,9 @@
return {self.name: dbitem}
+@implementer(IBugEditEmailCommand)
class InformationTypeEmailCommand(DBSchemaEditEmailCommand):
"""Change the information type of a bug."""
-
- implements(IBugEditEmailCommand)
dbschema = InformationType
RANK = 3
@@ -824,9 +812,9 @@
RANK = 5
+@implementer(IBugTaskEditEmailCommand)
class ReplacedByImportanceCommand(EmailCommand):
"""This command has been replaced by the 'importance' command."""
- implements(IBugTaskEditEmailCommand)
RANK = 1
def execute(self, context, current_event):
@@ -837,10 +825,9 @@
argument=self.name))
+@implementer(IBugEditEmailCommand)
class TagEmailCommand(EmailCommand):
"""Assigns a tag to or removes a tag from bug."""
-
- implements(IBugEditEmailCommand)
RANK = 4
def execute(self, bug, current_event):
=== modified file 'lib/lp/bugs/mail/handler.py'
--- lib/lp/bugs/mail/handler.py 2013-08-12 23:39:43 +0000
+++ lib/lp/bugs/mail/handler.py 2015-07-08 16:13:45 +0000
@@ -16,7 +16,7 @@
import transaction
from zope.component import getUtility
from zope.event import notify
-from zope.interface import implements
+from zope.interface import implementer
from lp.bugs.interfaces.bug import (
CreateBugParams,
@@ -173,13 +173,13 @@
self._groups.append(command_or_group)
+@implementer(IMailHandler)
class MaloneHandler:
"""Handles emails sent to Malone.
It only handles mail sent to new@... and $bugid@..., where $bugid is a
positive integer.
"""
- implements(IMailHandler)
allow_unknown_users = False
=== modified file 'lib/lp/bugs/model/apportjob.py'
--- lib/lp/bugs/model/apportjob.py 2013-07-04 05:38:43 +0000
+++ lib/lp/bugs/model/apportjob.py 2015-07-08 16:13:45 +0000
@@ -22,8 +22,8 @@
)
from zope.component import getUtility
from zope.interface import (
- classProvides,
- implements,
+ implementer,
+ provider,
)
from lp.bugs.interfaces.apportjob import (
@@ -50,11 +50,10 @@
from lp.services.temporaryblobstorage.model import TemporaryBlobStorage
+@implementer(IApportJob)
class ApportJob(StormBase):
"""Base class for jobs related to Apport BLOBs."""
- implements(IApportJob)
-
__storm_table__ = 'ApportJob'
id = Int(primary=True)
@@ -112,11 +111,11 @@
return ApportJobDerived.makeSubclass(self)
+@provider(IApportJobSource)
class ApportJobDerived(BaseRunnableJob):
"""Intermediate class for deriving from ApportJob."""
__metaclass__ = EnumeratedSubclass
delegates(IApportJob)
- classProvides(IApportJobSource)
def __init__(self, job):
self.context = job
@@ -169,12 +168,12 @@
return vars
+@implementer(IProcessApportBlobJob)
+@provider(IProcessApportBlobJobSource)
class ProcessApportBlobJob(ApportJobDerived):
"""A Job to process an Apport BLOB."""
- implements(IProcessApportBlobJob)
class_job_type = ApportJobType.PROCESS_BLOB
- classProvides(IProcessApportBlobJobSource)
config = config.IProcessApportBlobJobSource
=== modified file 'lib/lp/bugs/model/bug.py'
--- lib/lp/bugs/model/bug.py 2015-03-13 19:05:50 +0000
+++ lib/lp/bugs/model/bug.py 2015-07-08 16:13:45 +0000
@@ -72,7 +72,7 @@
from zope.contenttype import guess_content_type
from zope.event import notify
from zope.interface import (
- implements,
+ implementer,
providedBy,
)
from zope.security.interfaces import Unauthorized
@@ -306,9 +306,9 @@
return tags
+@implementer(IBugBecameQuestionEvent)
class BugBecameQuestionEvent:
"""See `IBugBecameQuestionEvent`."""
- implements(IBugBecameQuestionEvent)
def __init__(self, bug, question, user):
self.bug = bug
@@ -329,11 +329,10 @@
heat_last_updated=UTC_NOW)
+@implementer(IBug, IInformationType)
class Bug(SQLBase, InformationTypeMixin):
"""A bug."""
- implements(IBug, IInformationType)
-
_defaultOrder = '-id'
# db field names
@@ -2322,6 +2321,7 @@
return decorate
+@implementer(IHasBug)
class BugSubscriptionInfo:
"""Represents bug subscription sets.
@@ -2346,8 +2346,6 @@
"""
- implements(IHasBug)
-
def __init__(self, bug, level):
self.bug = bug
self.bugtask = None # Implies all.
@@ -2554,9 +2552,9 @@
self.duplicate_subscribers)
+@implementer(IBugSet)
class BugSet:
"""See BugSet."""
- implements(IBugSet)
valid_bug_name_re = re.compile(r'''^[a-z][a-z0-9\\+\\.\\-]+$''')
@@ -2768,9 +2766,9 @@
__storm_primary__ = "bugID", "personID"
+@implementer(IFileBugData)
class FileBugData:
"""Extra data to be added to the bug."""
- implements(IFileBugData)
def __init__(self, initial_summary=None, initial_tags=None,
private=None, subscribers=None, extra_description=None,
@@ -2801,11 +2799,10 @@
return self.__dict__.copy()
+@implementer(IBugMute)
class BugMute(StormBase):
"""Contains bugs a person has decided to block notifications from."""
- implements(IBugMute)
-
__storm_table__ = "BugMute"
def __init__(self, person=None, bug=None):
=== modified file 'lib/lp/bugs/model/bugactivity.py'
--- lib/lp/bugs/model/bugactivity.py 2013-01-07 02:40:55 +0000
+++ lib/lp/bugs/model/bugactivity.py 2015-07-08 16:13:45 +0000
@@ -11,7 +11,7 @@
StringCol,
)
from storm.store import Store
-from zope.interface import implements
+from zope.interface import implementer
from lp.bugs.adapters.bugchange import (
ATTACHMENT_ADDED,
@@ -36,11 +36,10 @@
from lp.services.database.sqlbase import SQLBase
+@implementer(IBugActivity)
class BugActivity(SQLBase):
"""Bug activity log entry."""
- implements(IBugActivity)
-
_table = 'BugActivity'
bug = ForeignKey(foreignKey='Bug', dbName='bug', notNull=True)
datechanged = UtcDateTimeCol(notNull=True)
@@ -111,11 +110,10 @@
return match.groupdict()['attribute']
+@implementer(IBugActivitySet)
class BugActivitySet:
"""See IBugActivitySet."""
- implements(IBugActivitySet)
-
def new(self, bug, datechanged, person, whatchanged,
oldvalue=None, newvalue=None, message=None):
"""See IBugActivitySet."""
=== modified file 'lib/lp/bugs/model/bugattachment.py'
--- lib/lp/bugs/model/bugattachment.py 2013-01-07 02:40:55 +0000
+++ lib/lp/bugs/model/bugattachment.py 2015-07-08 16:13:45 +0000
@@ -15,7 +15,7 @@
)
from storm.store import Store
from zope.event import notify
-from zope.interface import implements
+from zope.interface import implementer
from lp.app.errors import NotFoundError
from lp.bugs.interfaces.bugattachment import (
@@ -28,11 +28,10 @@
from lp.services.propertycache import cachedproperty
+@implementer(IBugAttachment)
class BugAttachment(SQLBase):
"""A bug attachment."""
- implements(IBugAttachment)
-
_table = 'BugAttachment'
bug = ForeignKey(
@@ -83,11 +82,10 @@
raise NotFoundError(filename)
+@implementer(IBugAttachmentSet)
class BugAttachmentSet:
"""A set for bug attachments."""
- implements(IBugAttachmentSet)
-
def __getitem__(self, attach_id):
"""See IBugAttachmentSet."""
try:
=== modified file 'lib/lp/bugs/model/bugbranch.py'
--- lib/lp/bugs/model/bugbranch.py 2013-06-20 05:50:00 +0000
+++ lib/lp/bugs/model/bugbranch.py 2015-07-08 16:13:45 +0000
@@ -14,7 +14,7 @@
IntCol,
StringCol,
)
-from zope.interface import implements
+from zope.interface import implementer
from lp.bugs.interfaces.bugbranch import (
IBugBranch,
@@ -28,9 +28,9 @@
from lp.services.database.sqlbase import SQLBase
+@implementer(IBugBranch, IHasBranchTarget)
class BugBranch(SQLBase):
"""See `IBugBranch`."""
- implements(IBugBranch, IHasBranchTarget)
datecreated = UtcDateTimeCol(notNull=True, default=UTC_NOW)
bug = ForeignKey(dbName="bug", foreignKey="Bug", notNull=True)
@@ -57,10 +57,9 @@
return task
+@implementer(IBugBranchSet)
class BugBranchSet:
- implements(IBugBranchSet)
-
def getBugBranch(self, bug, branch):
"""See `IBugBranchSet`."""
return BugBranch.selectOneBy(bugID=bug.id, branchID=branch.id)
=== modified file 'lib/lp/bugs/model/bugcve.py'
--- lib/lp/bugs/model/bugcve.py 2013-01-07 02:40:55 +0000
+++ lib/lp/bugs/model/bugcve.py 2015-07-08 16:13:45 +0000
@@ -5,17 +5,16 @@
__all__ = ['BugCve']
from sqlobject import ForeignKey
-from zope.interface import implements
+from zope.interface import implementer
from lp.bugs.interfaces.bugcve import IBugCve
from lp.services.database.sqlbase import SQLBase
+@implementer(IBugCve)
class BugCve(SQLBase):
"""A table linking bugs and CVE entries."""
- implements(IBugCve)
-
_table = 'BugCve'
# db field names
=== modified file 'lib/lp/bugs/model/bugmessage.py'
--- lib/lp/bugs/model/bugmessage.py 2015-03-13 19:05:50 +0000
+++ lib/lp/bugs/model/bugmessage.py 2015-07-08 16:13:45 +0000
@@ -12,7 +12,7 @@
StringCol,
)
from storm.store import Store
-from zope.interface import implements
+from zope.interface import implementer
from lp.bugs.interfaces.bugmessage import (
IBugMessage,
@@ -29,11 +29,10 @@
)
+@implementer(IBugMessage)
class BugMessage(SQLBase):
"""A table linking bugs and messages."""
- implements(IBugMessage)
-
_table = 'BugMessage'
def __init__(self, *args, **kw):
@@ -61,11 +60,10 @@
id(self), self.message, self.index)
+@implementer(IBugMessageSet)
class BugMessageSet:
"""See `IBugMessageSet`."""
- implements(IBugMessageSet)
-
def createMessage(self, subject, bug, owner, content=None):
"""See `IBugMessageSet`."""
msg = Message(
=== modified file 'lib/lp/bugs/model/bugnomination.py'
--- lib/lp/bugs/model/bugnomination.py 2013-01-07 02:40:55 +0000
+++ lib/lp/bugs/model/bugnomination.py 2015-07-08 16:13:45 +0000
@@ -21,7 +21,7 @@
SQLObjectNotFound,
)
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from lp.app.errors import NotFoundError
from lp.bugs.adapters.bugchange import BugTaskAdded
@@ -39,8 +39,8 @@
from lp.services.database.sqlbase import SQLBase
+@implementer(IBugNomination)
class BugNomination(SQLBase):
- implements(IBugNomination)
_table = "BugNomination"
owner = ForeignKey(
@@ -150,9 +150,9 @@
return False
+@implementer(IBugNominationSet)
class BugNominationSet:
"""See IBugNominationSet."""
- implements(IBugNominationSet)
def get(self, id):
"""See IBugNominationSet."""
=== modified file 'lib/lp/bugs/model/bugnotification.py'
--- lib/lp/bugs/model/bugnotification.py 2013-06-20 05:50:00 +0000
+++ lib/lp/bugs/model/bugnotification.py 2015-07-08 16:13:45 +0000
@@ -33,7 +33,7 @@
)
from storm.store import Store
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from lp.bugs.enums import BugNotificationStatus
from lp.bugs.interfaces.bugnotification import (
@@ -59,9 +59,9 @@
from lp.services.messages.model.message import Message
+@implementer(IBugNotification)
class BugNotification(SQLBase):
"""A textual representation about a bug change."""
- implements(IBugNotification)
message = ForeignKey(dbName='message', notNull=True, foreignKey='Message')
activity = ForeignKey(
@@ -90,9 +90,9 @@
BugNotificationFilter.bug_notification == self)
+@implementer(IBugNotificationSet)
class BugNotificationSet:
"""A set of bug notifications."""
- implements(IBugNotificationSet)
def getNotificationsToSend(self):
"""See IBugNotificationSet."""
@@ -307,9 +307,9 @@
return result
+@implementer(IBugNotificationRecipient)
class BugNotificationRecipient(SQLBase):
"""A recipient of a bug notification."""
- implements(IBugNotificationRecipient)
bug_notification = ForeignKey(
dbName='bug_notification', notNull=True, foreignKey='BugNotification')
@@ -319,9 +319,9 @@
reason_body = StringCol(dbName='reason_body', notNull=True)
+@implementer(IBugNotificationFilter)
class BugNotificationFilter(StormBase):
"""See `IBugNotificationFilter`."""
- implements(IBugNotificationFilter)
__storm_table__ = "BugNotificationFilter"
__storm_primary__ = "bug_notification_id", "bug_subscription_filter_id"
=== modified file 'lib/lp/bugs/model/bugsubscription.py'
--- lib/lp/bugs/model/bugsubscription.py 2013-01-07 02:40:55 +0000
+++ lib/lp/bugs/model/bugsubscription.py 2015-07-08 16:13:45 +0000
@@ -10,7 +10,7 @@
Int,
Reference,
)
-from zope.interface import implements
+from zope.interface import implementer
from lp.bugs.enums import BugNotificationLevel
from lp.bugs.interfaces.bugsubscription import IBugSubscription
@@ -21,11 +21,10 @@
from lp.services.database.stormbase import StormBase
+@implementer(IBugSubscription)
class BugSubscription(StormBase):
"""A relationship between a person and a bug."""
- implements(IBugSubscription)
-
__storm_table__ = 'BugSubscription'
id = Int(primary=True)
=== modified file 'lib/lp/bugs/model/bugsubscriptionfilter.py'
--- lib/lp/bugs/model/bugsubscriptionfilter.py 2013-06-20 05:50:00 +0000
+++ lib/lp/bugs/model/bugsubscriptionfilter.py 2015-07-08 16:13:45 +0000
@@ -30,7 +30,7 @@
)
from storm.references import Reference
from storm.store import Store
-from zope.interface import implements
+from zope.interface import implementer
from lp.app.enums import InformationType
from lp.bugs.enums import BugNotificationLevel
@@ -56,11 +56,10 @@
"""Raised when someone tries to mute a filter that can't be muted."""
+@implementer(IBugSubscriptionFilter)
class BugSubscriptionFilter(StormBase):
"""A filter to specialize a *structural* subscription."""
- implements(IBugSubscriptionFilter)
-
__storm_table__ = "BugSubscriptionFilter"
id = Int(primary=True)
@@ -298,11 +297,10 @@
existing_mutes.remove()
+@implementer(IBugSubscriptionFilterMute)
class BugSubscriptionFilterMute(StormBase):
"""Bug subscription filters a person has decided to block emails from."""
- implements(IBugSubscriptionFilterMute)
-
__storm_table__ = "BugSubscriptionFilterMute"
def __init__(self, person=None, filter=None):
=== modified file 'lib/lp/bugs/model/bugsummary.py'
--- lib/lp/bugs/model/bugsummary.py 2012-07-25 05:39:03 +0000
+++ lib/lp/bugs/model/bugsummary.py 2015-07-08 16:13:45 +0000
@@ -24,7 +24,7 @@
Unicode,
)
from storm.references import Reference
-from zope.interface import implements
+from zope.interface import implementer
from zope.security.proxy import removeSecurityProxy
from lp.bugs.interfaces.bugsummary import (
@@ -52,11 +52,10 @@
from lp.services.database.enumcol import EnumCol
+@implementer(IBugSummary)
class BugSummary(Storm):
"""BugSummary Storm database class."""
- implements(IBugSummary)
-
__storm_table__ = 'combinedbugsummary'
id = Int(primary=True)
@@ -95,6 +94,7 @@
has_patch = Bool()
+@implementer(IBugSummaryDimension)
class CombineBugSummaryConstraint:
"""A class to combine two separate bug summary constraints.
@@ -103,8 +103,6 @@
context.
"""
- implements(IBugSummaryDimension)
-
def __init__(self, *dimensions):
self.dimensions = map(
lambda x:
=== modified file 'lib/lp/bugs/model/bugtarget.py'
--- lib/lp/bugs/model/bugtarget.py 2013-06-20 05:50:00 +0000
+++ lib/lp/bugs/model/bugtarget.py 2015-07-08 16:13:45 +0000
@@ -18,7 +18,7 @@
Unicode,
)
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from lp.bugs.interfaces.bug import IBugSet
from lp.bugs.interfaces.bugtarget import IOfficialBugTag
@@ -195,6 +195,7 @@
IStore(OfficialBugTag).remove(tag)
+@implementer(IOfficialBugTag)
class OfficialBugTag(Storm):
"""See `IOfficialBugTag`."""
# XXX Abel Deuring, 2009-03-11: The SQL table OfficialBugTag has
@@ -202,8 +203,6 @@
# or "distribution" must be non-null. Once this is changed, we
# should add the column "project" here. Bug #341203.
- implements(IOfficialBugTag)
-
__storm_table__ = 'OfficialBugTag'
id = Int(primary=True)
=== modified file 'lib/lp/bugs/model/bugtask.py'
--- lib/lp/bugs/model/bugtask.py 2014-06-12 01:04:30 +0000
+++ lib/lp/bugs/model/bugtask.py 2015-07-08 16:13:45 +0000
@@ -61,7 +61,7 @@
from zope.component import getUtility
from zope.event import notify
from zope.interface import (
- implements,
+ implementer,
providedBy,
)
from zope.security.proxy import removeSecurityProxy
@@ -234,11 +234,10 @@
return values
+@implementer(IBugTaskDelta)
class BugTaskDelta:
"""See `IBugTaskDelta`."""
- implements(IBugTaskDelta)
-
def __init__(self, bugtask, status=None, importance=None,
assignee=None, milestone=None, bugwatch=None, target=None):
self.bugtask = bugtask
@@ -397,9 +396,9 @@
check_source_package=check_source_package)
+@implementer(IBugTask)
class BugTask(SQLBase):
"""See `IBugTask`."""
- implements(IBugTask)
_table = "BugTask"
_defaultOrder = ['distribution', 'product', 'productseries',
'distroseries', 'milestone', 'sourcepackagename']
@@ -1327,9 +1326,9 @@
return "<BugTask for bug %s on %r>" % (self.bugID, self.target)
+@implementer(IBugTaskSet)
class BugTaskSet:
"""See `IBugTaskSet`."""
- implements(IBugTaskSet)
title = "A set of bug tasks"
=== modified file 'lib/lp/bugs/model/bugtracker.py'
--- lib/lp/bugs/model/bugtracker.py 2013-06-20 05:50:00 +0000
+++ lib/lp/bugs/model/bugtracker.py 2015-07-08 16:13:45 +0000
@@ -46,7 +46,7 @@
)
from storm.store import Store
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from lp.app.errors import NotFoundError
from lp.app.interfaces.launchpad import ILaunchpadCelebrities
@@ -173,6 +173,7 @@
return base_uri.host + base_uri.path
+@implementer(IBugTrackerComponent)
class BugTrackerComponent(StormBase):
"""The software component in the remote bug tracker.
@@ -180,7 +181,6 @@
they affect. This class provides a mapping of this upstream component
to the corresponding source package in the distro.
"""
- implements(IBugTrackerComponent)
__storm_table__ = 'BugTrackerComponent'
id = Int(primary=True)
@@ -227,13 +227,13 @@
"""The distribution's source package for this component""")
+@implementer(IBugTrackerComponentGroup)
class BugTrackerComponentGroup(StormBase):
"""A collection of components in a remote bug tracker.
Some bug trackers organize sets of components into higher level
groups, such as Bugzilla's 'product'.
"""
- implements(IBugTrackerComponentGroup)
__storm_table__ = 'BugTrackerComponentGroup'
id = Int(primary=True)
@@ -295,6 +295,7 @@
return component
+@implementer(IBugTracker)
class BugTracker(SQLBase):
"""A class to access the BugTracker table in the database.
@@ -303,7 +304,6 @@
BugTracker. bugzilla.mozilla.org and bugzilla.gnome.org are each
distinct BugTrackers.
"""
- implements(IBugTracker)
_table = 'BugTracker'
@@ -726,13 +726,12 @@
return groups, products
+@implementer(IBugTrackerSet)
class BugTrackerSet:
"""Implements IBugTrackerSet for a container or set of BugTrackers,
either the full set in the db, or a subset.
"""
- implements(IBugTrackerSet)
-
table = BugTracker
def __init__(self):
@@ -855,18 +854,18 @@
return results
+@implementer(IBugTrackerAlias)
class BugTrackerAlias(SQLBase):
"""See `IBugTrackerAlias`."""
- implements(IBugTrackerAlias)
bugtracker = ForeignKey(
foreignKey="BugTracker", dbName="bugtracker", notNull=True)
base_url = StringCol(notNull=True)
+@implementer(IBugTrackerAliasSet)
class BugTrackerAliasSet:
"""See `IBugTrackerAliasSet`."""
- implements(IBugTrackerAliasSet)
table = BugTrackerAlias
=== modified file 'lib/lp/bugs/model/bugtrackerperson.py'
--- lib/lp/bugs/model/bugtrackerperson.py 2012-04-16 23:02:44 +0000
+++ lib/lp/bugs/model/bugtrackerperson.py 2015-07-08 16:13:45 +0000
@@ -12,7 +12,7 @@
ForeignKey,
StringCol,
)
-from zope.interface import implements
+from zope.interface import implementer
from lp.bugs.interfaces.bugtrackerperson import IBugTrackerPerson
from lp.services.database.constants import UTC_NOW
@@ -20,11 +20,10 @@
from lp.services.database.sqlbase import SQLBase
+@implementer(IBugTrackerPerson)
class BugTrackerPerson(SQLBase):
"""See `IBugTrackerPerson`."""
- implements(IBugTrackerPerson)
-
bugtracker = ForeignKey(
dbName='bugtracker', foreignKey='BugTracker', notNull=True)
person = ForeignKey(
=== modified file 'lib/lp/bugs/model/bugwatch.py'
--- lib/lp/bugs/model/bugwatch.py 2013-06-20 05:50:00 +0000
+++ lib/lp/bugs/model/bugwatch.py 2015-07-08 16:13:45 +0000
@@ -36,7 +36,7 @@
from zope.component import getUtility
from zope.event import notify
from zope.interface import (
- implements,
+ implementer,
providedBy,
)
@@ -117,9 +117,9 @@
"""Raised when someone attempts to delete a linked watch."""
+@implementer(IBugWatch)
class BugWatch(SQLBase):
"""See `IBugWatch`."""
- implements(IBugWatch)
_table = 'BugWatch'
bug = ForeignKey(dbName='bug', foreignKey='Bug', notNull=True)
bugtracker = ForeignKey(dbName='bugtracker',
@@ -379,11 +379,10 @@
self.remotestatus = None
+@implementer(IBugWatchSet)
class BugWatchSet:
"""A set for BugWatch"""
- implements(IBugWatchSet)
-
def __init__(self, bug=None):
self.bugtracker_parse_functions = {
BugTrackerType.BUGZILLA: self.parseBugzillaURL,
@@ -743,11 +742,10 @@
for bug_watch_id in set(get_bug_watch_ids(references))])
+@implementer(IBugWatchActivity)
class BugWatchActivity(StormBase):
"""See `IBugWatchActivity`."""
- implements(IBugWatchActivity)
-
__storm_table__ = 'BugWatchActivity'
id = Int(primary=True)
=== modified file 'lib/lp/bugs/model/cve.py'
--- lib/lp/bugs/model/cve.py 2014-03-03 19:42:30 +0000
+++ lib/lp/bugs/model/cve.py 2015-07-08 16:13:45 +0000
@@ -18,7 +18,7 @@
from storm.expr import In
from storm.store import Store
# Zope
-from zope.interface import implements
+from zope.interface import implementer
from lp.app.validators.cve import (
CVEREF_PATTERN,
@@ -42,11 +42,10 @@
from lp.services.database.stormexpr import fti_search
+@implementer(ICve, IBugLinkTarget)
class Cve(SQLBase, BugLinkTargetMixin):
"""A CVE database record."""
- implements(ICve, IBugLinkTarget)
-
_table = 'Cve'
sequence = StringCol(notNull=True, alternateID=True)
@@ -94,10 +93,9 @@
return BugCve(cve=self, bug=bug)
+@implementer(ICveSet)
class CveSet:
"""The full set of ICve's."""
-
- implements(ICveSet)
table = Cve
def __init__(self, bug=None):
=== modified file 'lib/lp/bugs/model/cvereference.py'
--- lib/lp/bugs/model/cvereference.py 2013-01-07 02:40:55 +0000
+++ lib/lp/bugs/model/cvereference.py 2015-07-08 16:13:45 +0000
@@ -8,17 +8,16 @@
ForeignKey,
StringCol,
)
-from zope.interface import implements
+from zope.interface import implementer
from lp.bugs.interfaces.cvereference import ICveReference
from lp.services.database.sqlbase import SQLBase
+@implementer(ICveReference)
class CveReference(SQLBase):
"""A CVE reference to some other tracking system."""
- implements(ICveReference)
-
_table = 'CveReference'
# db field names
=== modified file 'lib/lp/bugs/model/personsubscriptioninfo.py'
--- lib/lp/bugs/model/personsubscriptioninfo.py 2012-10-12 11:31:30 +0000
+++ lib/lp/bugs/model/personsubscriptioninfo.py 2015-07-08 16:13:45 +0000
@@ -9,7 +9,7 @@
from storm.expr import SQL
from storm.store import Store
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from zope.proxy import sameProxiedObjects
from lp.bugs.interfaces.personsubscriptioninfo import (
@@ -33,11 +33,10 @@
from lp.services.database.bulk import load_related
+@implementer(IRealSubscriptionInfo)
class RealSubscriptionInfo:
"""See `IRealSubscriptionInfo`"""
- implements(IRealSubscriptionInfo)
-
def __init__(self, principal, bug, subscription):
self.principal = principal
self.bug = bug
@@ -46,11 +45,10 @@
self.bug_supervisor_tasks = []
+@implementer(IVirtualSubscriptionInfo)
class VirtualSubscriptionInfo:
"""See `IVirtualSubscriptionInfo`"""
- implements(IVirtualSubscriptionInfo)
-
def __init__(self, principal, bug, pillar):
self.principal = principal
self.bug = bug
@@ -58,11 +56,10 @@
self.tasks = []
+@implementer(IAbstractSubscriptionInfoCollection)
class AbstractSubscriptionInfoCollection:
"""See `IAbstractSubscriptionInfoCollection`"""
- implements(IAbstractSubscriptionInfoCollection)
-
def __init__(self, person, administrated_team_ids):
self.person = person
self.administrated_team_ids = administrated_team_ids
@@ -87,11 +84,10 @@
raise NotImplementedError('Programmer error: use a subclass')
+@implementer(IVirtualSubscriptionInfoCollection)
class VirtualSubscriptionInfoCollection(AbstractSubscriptionInfoCollection):
"""See `IVirtualSubscriptionInfoCollection`"""
- implements(IVirtualSubscriptionInfoCollection)
-
def __init__(self, person, administrated_team_ids):
super(VirtualSubscriptionInfoCollection, self).__init__(
person, administrated_team_ids)
@@ -108,12 +104,11 @@
info.tasks.append(task)
+@implementer(IRealSubscriptionInfoCollection)
class RealSubscriptionInfoCollection(
AbstractSubscriptionInfoCollection):
"""Core functionality for Duplicate and Direct"""
- implements(IRealSubscriptionInfoCollection)
-
def __init__(self, person, administrated_team_ids):
super(RealSubscriptionInfoCollection, self).__init__(
person, administrated_team_ids)
@@ -147,11 +142,10 @@
info.bug_supervisor_tasks.append(value)
+@implementer(IPersonSubscriptions)
class PersonSubscriptions(object):
"""See `IPersonSubscriptions`."""
- implements(IPersonSubscriptions)
-
def __init__(self, person, bug):
self.loadSubscriptionsFor(person, bug)
=== modified file 'lib/lp/bugs/model/structuralsubscription.py'
--- lib/lp/bugs/model/structuralsubscription.py 2015-01-29 16:28:30 +0000
+++ lib/lp/bugs/model/structuralsubscription.py 2015-07-08 16:13:45 +0000
@@ -41,7 +41,7 @@
adapts,
getUtility,
)
-from zope.interface import implements
+from zope.interface import implementer
from zope.security.proxy import ProxyFactory
from lp.app.interfaces.launchpad import ILaunchpadCelebrities
@@ -90,11 +90,10 @@
from lp.services.propertycache import cachedproperty
+@implementer(IStructuralSubscription)
class StructuralSubscription(Storm):
"""A subscription to a Launchpad structure."""
- implements(IStructuralSubscription)
-
__storm_table__ = 'StructuralSubscription'
id = Int(primary=True)
@@ -187,10 +186,9 @@
Store.of(self).remove(self)
+@implementer(IStructuralSubscriptionTargetHelper)
class DistroSeriesTargetHelper:
"""A helper for `IDistroSeries`s."""
-
- implements(IStructuralSubscriptionTargetHelper)
adapts(IDistroSeries)
target_type_display = 'distribution series'
@@ -203,10 +201,9 @@
self.join = (StructuralSubscription.distroseries == target)
+@implementer(IStructuralSubscriptionTargetHelper)
class ProjectGroupTargetHelper:
"""A helper for `IProjectGroup`s."""
-
- implements(IStructuralSubscriptionTargetHelper)
adapts(IProjectGroup)
target_type_display = 'project group'
@@ -219,10 +216,9 @@
self.join = (StructuralSubscription.projectgroup == target)
+@implementer(IStructuralSubscriptionTargetHelper)
class DistributionSourcePackageTargetHelper:
"""A helper for `IDistributionSourcePackage`s."""
-
- implements(IStructuralSubscriptionTargetHelper)
adapts(IDistributionSourcePackage)
target_type_display = 'package'
@@ -242,10 +238,9 @@
target.sourcepackagename.id))
+@implementer(IStructuralSubscriptionTargetHelper)
class MilestoneTargetHelper:
"""A helper for `IMilestone`s."""
-
- implements(IStructuralSubscriptionTargetHelper)
adapts(IMilestone)
target_type_display = 'milestone'
@@ -258,10 +253,9 @@
self.join = (StructuralSubscription.milestone == target)
+@implementer(IStructuralSubscriptionTargetHelper)
class ProductTargetHelper:
"""A helper for `IProduct`s."""
-
- implements(IStructuralSubscriptionTargetHelper)
adapts(IProduct)
target_type_display = 'project'
@@ -280,10 +274,9 @@
StructuralSubscription.product == target)
+@implementer(IStructuralSubscriptionTargetHelper)
class ProductSeriesTargetHelper:
"""A helper for `IProductSeries`s."""
-
- implements(IStructuralSubscriptionTargetHelper)
adapts(IProductSeries)
target_type_display = 'project series'
@@ -296,10 +289,9 @@
self.join = (StructuralSubscription.productseries == target)
+@implementer(IStructuralSubscriptionTargetHelper)
class DistributionTargetHelper:
"""A helper for `IDistribution`s."""
-
- implements(IStructuralSubscriptionTargetHelper)
adapts(IDistribution)
target_type_display = 'distribution'
=== modified file 'lib/lp/bugs/publisher.py'
--- lib/lp/bugs/publisher.py 2014-11-23 21:37:40 +0000
+++ lib/lp/bugs/publisher.py 2015-07-08 16:13:45 +0000
@@ -12,7 +12,7 @@
]
-from zope.interface import implements
+from zope.interface import implementer
from zope.publisher.interfaces.browser import (
IBrowserRequest,
IDefaultBrowserLayer,
@@ -30,8 +30,8 @@
)
+@implementer(IFacet)
class BugsFacet:
- implements(IFacet)
name = "bugs"
rootsite = "bugs"
@@ -43,9 +43,9 @@
"""The Bugs layer."""
+@implementer(BugsLayer)
class BugsBrowserRequest(LaunchpadBrowserRequest):
"""Instances of BugBrowserRequest provide `BugsLayer`."""
- implements(BugsLayer)
def bugs_request_publication_factory():
=== modified file 'lib/lp/bugs/scripts/bugtasktargetnamecaches.py'
--- lib/lp/bugs/scripts/bugtasktargetnamecaches.py 2013-06-20 05:50:00 +0000
+++ lib/lp/bugs/scripts/bugtasktargetnamecaches.py 2015-07-08 16:13:45 +0000
@@ -8,7 +8,7 @@
from collections import defaultdict
-from zope.interface import implements
+from zope.interface import implementer
from lp.bugs.model.bugtask import (
bug_target_from_key,
@@ -38,11 +38,10 @@
Product, ProductSeries, Distribution, DistroSeries, SourcePackageName)
+@implementer(ITunableLoop)
class BugTaskTargetNameCachesTunableLoop(object):
"""An `ITunableLoop` for updating BugTask targetname caches."""
- implements(ITunableLoop)
-
def __init__(self, transaction, logger, offset=0):
self.transaction = transaction
self.logger = logger
=== modified file 'lib/lp/bugs/scripts/cveimport.py'
--- lib/lp/bugs/scripts/cveimport.py 2012-01-01 02:58:52 +0000
+++ lib/lp/bugs/scripts/cveimport.py 2015-07-08 16:13:45 +0000
@@ -15,7 +15,7 @@
from zope.component import getUtility
from zope.event import notify
-from zope.interface import implements
+from zope.interface import implementer
from zope.lifecycleevent import ObjectModifiedEvent
from lp.bugs.interfaces.cve import (
@@ -141,11 +141,10 @@
return
+@implementer(ITunableLoop)
class CveUpdaterTunableLoop(object):
"""An `ITunableLoop` for updating CVEs."""
- implements(ITunableLoop)
-
total_updated = 0
def __init__(self, cves, transaction, logger, offset=0):
=== modified file 'lib/lp/bugs/scripts/tests/test_bugimport.py'
--- lib/lp/bugs/scripts/tests/test_bugimport.py 2012-10-08 06:13:17 +0000
+++ lib/lp/bugs/scripts/tests/test_bugimport.py 2015-07-08 16:13:45 +0000
@@ -11,7 +11,7 @@
from testtools.content import text_content
import transaction
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from zope.security.proxy import removeSecurityProxy
from lp.bugs.externalbugtracker import ExternalBugTracker
@@ -817,14 +817,13 @@
return False
+@implementer(IBugWatch)
class TestBugWatch:
"""A mock bug watch object for testing `ExternalBugTracker.updateWatches`.
This bug watch is guaranteed to trigger a DB failure when `updateStatus`
is called if its `failing` attribute is True."""
- implements(IBugWatch)
-
lastchecked = None
unpushed_comments = FakeResultSet()
=== modified file 'lib/lp/bugs/scripts/tests/test_bugnotification.py'
--- lib/lp/bugs/scripts/tests/test_bugnotification.py 2013-06-20 05:50:00 +0000
+++ lib/lp/bugs/scripts/tests/test_bugnotification.py 2015-07-08 16:13:45 +0000
@@ -21,7 +21,7 @@
getSiteManager,
getUtility,
)
-from zope.interface import implements
+from zope.interface import implementer
from lp.app.enums import InformationType
from lp.bugs.adapters.bugchange import (
@@ -91,9 +91,9 @@
from lp.testing.matchers import Contains
+@implementer(IBug)
class MockBug:
"""A bug which has only the attributes get_email_notifications() needs."""
- implements(IBug)
duplicateof = None
information_type = InformationType.PUBLIC
@@ -184,11 +184,10 @@
self.activity = None
+@implementer(IBugNotificationSet)
class FakeBugNotificationSetUtility:
"""A notification utility used for testing."""
- implements(IBugNotificationSet)
-
def getRecipientFilterData(self, bug, recipient_to_sources,
notifications):
return dict(
=== modified file 'lib/lp/bugs/vocabularies.py'
--- lib/lp/bugs/vocabularies.py 2014-10-21 18:06:12 +0000
+++ lib/lp/bugs/vocabularies.py 2015-07-08 16:13:45 +0000
@@ -30,7 +30,7 @@
Or,
)
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from zope.schema.interfaces import (
IVocabulary,
IVocabularyTokenized,
@@ -113,11 +113,11 @@
_orderBy = 'id'
+@implementer(IHugeVocabulary)
class BugTrackerVocabulary(SQLObjectVocabularyBase):
"""All web and email based external bug trackers."""
displayname = 'Select a bug tracker'
step_title = 'Search'
- implements(IHugeVocabulary)
_table = BugTracker
_filter = True
_orderBy = 'title'
@@ -210,11 +210,10 @@
return SimpleTerm(watch, watch.id, title)
+@implementer(IVocabulary, IVocabularyTokenized)
class DistributionUsingMaloneVocabulary:
"""All the distributions that uses Malone officially."""
- implements(IVocabulary, IVocabularyTokenized)
-
_orderBy = 'displayname'
def __init__(self, context=None):
@@ -345,6 +344,7 @@
return False
+@implementer(IVocabulary, IVocabularyTokenized)
class BugTaskMilestoneVocabulary:
"""Milestones for a set of bugtasks.
@@ -352,8 +352,6 @@
in order to avoid repeated database queries.
"""
- implements(IVocabulary, IVocabularyTokenized)
-
def __init__(self, default_bugtask=None, milestones=None):
assert default_bugtask is None or IBugTask.providedBy(default_bugtask)
self.default_bugtask = default_bugtask
=== modified file 'lib/lp/bugs/xmlrpc/bug.py'
--- lib/lp/bugs/xmlrpc/bug.py 2012-09-18 18:36:09 +0000
+++ lib/lp/bugs/xmlrpc/bug.py 2015-07-08 16:13:45 +0000
@@ -10,7 +10,7 @@
]
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from lp.app.enums import InformationType
from lp.app.errors import NotFoundError
@@ -119,11 +119,10 @@
return canonical_url(bug)
+@implementer(IExternalBugTrackerTokenAPI)
class ExternalBugTrackerTokenAPI(LaunchpadXMLRPCView):
"""The private XML-RPC API for generating bug tracker login tokens."""
- implements(IExternalBugTrackerTokenAPI)
-
def newBugTrackerToken(self):
"""Generate a new `LoginToken` for a bug tracker and return it.
=== modified file 'lib/lp/buildmaster/doc/buildfarmjobbehaviour.txt'
--- lib/lp/buildmaster/doc/buildfarmjobbehaviour.txt 2014-06-25 09:20:57 +0000
+++ lib/lp/buildmaster/doc/buildfarmjobbehaviour.txt 2015-07-08 16:13:45 +0000
@@ -25,11 +25,11 @@
... IBuildFarmJobBehaviour)
>>> from lp.buildmaster.model.buildfarmjobbehaviour import (
... BuildFarmJobBehaviourBase)
- >>> from zope.interface import implements
+ >>> from zope.interface import implementer
- >>> class MyNewBuildBehaviour(BuildFarmJobBehaviourBase):
+ >>> @implementer(IBuildFarmJobBehaviour)
+ ... class MyNewBuildBehaviour(BuildFarmJobBehaviourBase):
... """A custom build behaviour for building blah."""
- ... implements(IBuildFarmJobBehaviour)
...
... def dispatchBuildToSlave(self, logger):
... print "Did something special to dispatch MySpecialBuild."
@@ -39,8 +39,9 @@
>>> from lp.buildmaster.interfaces.buildfarmjob import IBuildFarmJob
>>> class IMyNewBuildFarmJob(IBuildFarmJob):
... "Normally defines job-type specific database fields."""
- >>> class MyNewBuildFarmJob(object):
- ... implements(IMyNewBuildFarmJob)
+ >>> @implementer(IMyNewBuildFarmJob)
+ ... class MyNewBuildFarmJob(object):
+ ... pass
Custom behaviours are not normally instantiated directly, instead an adapter is
specified for the specific IBuildFarmJob. Normaly we'd add some ZCML to
=== modified file 'lib/lp/buildmaster/model/builder.py'
--- lib/lp/buildmaster/model/builder.py 2015-04-20 09:48:57 +0000
+++ lib/lp/buildmaster/model/builder.py 2015-07-08 16:13:45 +0000
@@ -34,7 +34,7 @@
from storm.store import Store
import transaction
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from zope.security.proxy import removeSecurityProxy
from lp.app.errors import NotFoundError
@@ -87,9 +87,8 @@
)
+@implementer(IBuilder, IHasBuildRecords)
class Builder(SQLBase):
-
- implements(IBuilder, IHasBuildRecords)
_table = 'Builder'
_defaultOrder = ['id']
@@ -304,9 +303,9 @@
processor = Reference(processor_id, Processor.id)
+@implementer(IBuilderSet)
class BuilderSet(object):
"""See IBuilderSet"""
- implements(IBuilderSet)
def __init__(self):
self.title = "The Launchpad build farm"
=== modified file 'lib/lp/buildmaster/model/buildfarmjob.py'
--- lib/lp/buildmaster/model/buildfarmjob.py 2015-03-02 06:06:30 +0000
+++ lib/lp/buildmaster/model/buildfarmjob.py 2015-07-08 16:13:45 +0000
@@ -25,8 +25,8 @@
)
from storm.store import Store
from zope.interface import (
- classProvides,
- implements,
+ implementer,
+ provider,
)
from lp.buildmaster.enums import (
@@ -68,13 +68,12 @@
}
+@implementer(IBuildFarmJob, IBuildFarmJobDB)
+@provider(IBuildFarmJobSource)
class BuildFarmJob(Storm):
"""A base implementation for `IBuildFarmJob` classes."""
__storm_table__ = 'BuildFarmJob'
- implements(IBuildFarmJob, IBuildFarmJobDB)
- classProvides(IBuildFarmJobSource)
-
id = Int(primary=True)
date_created = DateTime(
@@ -258,8 +257,8 @@
return True
+@implementer(IBuildFarmJobSet)
class BuildFarmJobSet:
- implements(IBuildFarmJobSet)
def getBuildsForBuilder(self, builder_id, status=None, user=None):
"""See `IBuildFarmJobSet`."""
=== modified file 'lib/lp/buildmaster/model/buildqueue.py'
--- lib/lp/buildmaster/model/buildqueue.py 2014-06-26 07:16:48 +0000
+++ lib/lp/buildmaster/model/buildqueue.py 2015-07-08 16:13:45 +0000
@@ -31,7 +31,7 @@
getSiteManager,
getUtility,
)
-from zope.interface import implements
+from zope.interface import implementer
from zope.security.proxy import removeSecurityProxy
from lp.buildmaster.enums import (
@@ -81,8 +81,8 @@
return job_sources
+@implementer(IBuildQueue)
class BuildQueue(SQLBase):
- implements(IBuildQueue)
_table = "BuildQueue"
_defaultOrder = "id"
@@ -235,9 +235,9 @@
return datetime.now(pytz.utc)
+@implementer(IBuildQueueSet)
class BuildQueueSet(object):
"""Utility to deal with BuildQueue content class."""
- implements(IBuildQueueSet)
def get(self, buildqueue_id):
"""See `IBuildQueueSet`."""
=== modified file 'lib/lp/buildmaster/model/processor.py'
--- lib/lp/buildmaster/model/processor.py 2015-05-19 00:53:51 +0000
+++ lib/lp/buildmaster/model/processor.py 2015-07-08 16:13:45 +0000
@@ -9,7 +9,7 @@
from sqlobject import StringCol
from storm.locals import Bool
-from zope.interface import implements
+from zope.interface import implementer
from lp.buildmaster.interfaces.processor import (
IProcessor,
@@ -20,8 +20,8 @@
from lp.services.database.sqlbase import SQLBase
+@implementer(IProcessor)
class Processor(SQLBase):
- implements(IProcessor)
_table = 'Processor'
name = StringCol(dbName='name', notNull=True)
@@ -46,9 +46,9 @@
return "<Processor %r>" % self.title
+@implementer(IProcessorSet)
class ProcessorSet:
"""See `IProcessorSet`."""
- implements(IProcessorSet)
def getByName(self, name):
"""See `IProcessorSet`."""
=== modified file 'lib/lp/code/adapters/branch.py'
--- lib/lp/code/adapters/branch.py 2015-04-19 12:56:32 +0000
+++ lib/lp/code/adapters/branch.py 2015-07-08 16:13:45 +0000
@@ -16,7 +16,7 @@
from lazr.lifecycle.event import ObjectModifiedEvent
from lazr.lifecycle.objectdelta import ObjectDelta
from zope.event import notify
-from zope.interface import implements
+from zope.interface import implementer
from lp.code.interfaces.branch import (
IBranch,
@@ -29,11 +29,10 @@
# well as landing target when it is added to the UI
+@implementer(IBranchDelta)
class BranchDelta:
"""See IBranchDelta."""
- implements(IBranchDelta)
-
delta_values = ('name', 'title', 'url', 'lifecycle_status')
new_values = ('summary', 'whiteboard')
=== modified file 'lib/lp/code/adapters/gitrepository.py'
--- lib/lp/code/adapters/gitrepository.py 2015-04-21 23:25:19 +0000
+++ lib/lp/code/adapters/gitrepository.py 2015-07-08 16:13:45 +0000
@@ -9,7 +9,7 @@
]
from lazr.lifecycle.objectdelta import ObjectDelta
-from zope.interface import implements
+from zope.interface import implementer
from lp.code.interfaces.gitrepository import (
IGitRepository,
@@ -17,11 +17,10 @@
)
+@implementer(IGitRepositoryDelta)
class GitRepositoryDelta:
"""See `IGitRepositoryDelta`."""
- implements(IGitRepositoryDelta)
-
delta_values = ('name', 'git_identity')
new_values = ()
=== modified file 'lib/lp/code/browser/branch.py'
--- lib/lp/code/browser/branch.py 2015-06-10 16:41:28 +0000
+++ lib/lp/code/browser/branch.py 2015-07-08 16:13:45 +0000
@@ -51,7 +51,7 @@
from zope.formlib import form
from zope.formlib.widgets import TextAreaWidget
from zope.interface import (
- implements,
+ implementer,
Interface,
providedBy,
)
@@ -160,11 +160,10 @@
)
+@implementer(ICanonicalUrlData)
class BranchURL:
"""Branch URL creation rules."""
- implements(ICanonicalUrlData)
-
rootsite = 'code'
inside = None
=== modified file 'lib/lp/code/browser/branchlisting.py'
--- lib/lp/code/browser/branchlisting.py 2015-06-19 01:10:52 +0000
+++ lib/lp/code/browser/branchlisting.py 2015-07-08 16:13:45 +0000
@@ -42,7 +42,7 @@
from zope.component import getUtility
from zope.formlib import form
from zope.interface import (
- implements,
+ implementer,
Interface,
)
from zope.schema import Choice
@@ -478,10 +478,10 @@
return [self._createItem(branch) for branch in branches]
+@implementer(IBranchBatchNavigator)
class BranchListingBatchNavigator(TableBatchNavigator,
BranchListingItemsMixin):
"""Batch up the branch listings."""
- implements(IBranchBatchNavigator)
def __init__(self, view):
TableBatchNavigator.__init__(
=== modified file 'lib/lp/code/browser/branchmergeproposal.py'
--- lib/lp/code/browser/branchmergeproposal.py 2015-06-12 03:48:40 +0000
+++ lib/lp/code/browser/branchmergeproposal.py 2015-07-08 16:13:45 +0000
@@ -43,7 +43,7 @@
from zope.formlib import form
from zope.formlib.widgets import TextAreaWidget
from zope.interface import (
- implements,
+ implementer,
Interface,
)
from zope.schema import (
@@ -453,11 +453,10 @@
return None
+@implementer(IConversation)
class CodeReviewConversation:
"""A code review conversation."""
- implements(IConversation)
-
def __init__(self, comments):
self.comments = comments
@@ -538,13 +537,13 @@
"""Marker interface used to register views for CodeReviewNewRevisions."""
+@implementer(ICodeReviewNewRevisions)
class CodeReviewNewRevisions:
"""Represents a logical grouping of revisions.
Each object instance represents a number of revisions scanned at a
particular time.
"""
- implements(ICodeReviewNewRevisions)
def __init__(self, revisions, date, branch, diff):
self.revisions = revisions
@@ -580,14 +579,13 @@
return self.context.branch.getCodebrowseUrl()
+@implementer(IBranchMergeProposalActionMenu)
class BranchMergeProposalView(LaunchpadFormView, UnmergedRevisionsMixin,
BranchMergeProposalRevisionIdMixin,
BranchMergeProposalStatusMixin,
DiffRenderingMixin):
"""A basic view used for the index page."""
- implements(IBranchMergeProposalActionMenu)
-
schema = ClaimButton
def initialize(self):
@@ -1391,9 +1389,9 @@
return self.context
+@implementer(Interface)
class PreviewDiffHTMLRepresentation:
adapts(IPreviewDiff, IWebServiceClientRequest)
- implements(Interface)
def __init__(self, diff, request):
self.diff = diff
=== modified file 'lib/lp/code/browser/branchmergeproposallisting.py'
--- lib/lp/code/browser/branchmergeproposallisting.py 2015-05-12 17:30:40 +0000
+++ lib/lp/code/browser/branchmergeproposallisting.py 2015-07-08 16:13:45 +0000
@@ -24,7 +24,7 @@
)
from zope.component import getUtility
from zope.interface import (
- implements,
+ implementer,
Interface,
)
from zope.schema import Choice
@@ -134,9 +134,9 @@
return self.context.date_created
+@implementer(IBranchMergeProposalListingBatchNavigator)
class BranchMergeProposalListingBatchNavigator(TableBatchNavigator):
"""Batch up the branch listings."""
- implements(IBranchMergeProposalListingBatchNavigator)
def __init__(self, view):
super(BranchMergeProposalListingBatchNavigator, self).__init__(
=== modified file 'lib/lp/code/browser/branchref.py'
--- lib/lp/code/browser/branchref.py 2012-01-01 02:58:52 +0000
+++ lib/lp/code/browser/branchref.py 2015-07-08 16:13:45 +0000
@@ -8,7 +8,7 @@
'BranchRef'
]
-from zope.interface import implements
+from zope.interface import implementer
from zope.publisher.interfaces.browser import IBrowserPublisher
from lp.code.interfaces.branchref import IBranchRef
@@ -20,8 +20,8 @@
)
+@implementer(IBranchRef)
class BranchRef:
- implements(IBranchRef)
def __init__(self, branch):
self.branch = branch
@@ -55,8 +55,8 @@
return None
+@implementer(IBrowserPublisher)
class StaticContentView:
- implements(IBrowserPublisher)
def __init__(self, contents):
self.contents = contents
=== modified file 'lib/lp/code/browser/codereviewcomment.py'
--- lib/lp/code/browser/codereviewcomment.py 2014-11-28 22:07:05 +0000
+++ lib/lp/code/browser/codereviewcomment.py 2015-07-08 16:13:45 +0000
@@ -19,7 +19,7 @@
TextWidget,
)
from zope.interface import (
- implements,
+ implementer,
Interface,
)
from zope.schema import Text
@@ -56,6 +56,7 @@
"""Marker interface for displaying code review comments."""
+@implementer(ICodeReviewDisplayComment)
class CodeReviewDisplayComment(MessageComment):
"""A code review comment or activity or both.
@@ -64,8 +65,6 @@
only code in the model itself.
"""
- implements(ICodeReviewDisplayComment)
-
delegates(ICodeReviewComment, 'comment')
def __init__(self, comment, from_superseded=False, limit_length=True):
@@ -140,11 +139,10 @@
return Link('+reply', 'Reply', icon='add', enabled=enabled)
+@implementer(ILibraryFileAlias)
class DiffAttachment:
"""An attachment that we are going to display."""
- implements(ILibraryFileAlias)
-
delegates(ILibraryFileAlias, 'alias')
def __init__(self, alias):
=== modified file 'lib/lp/code/browser/decorations.py'
--- lib/lp/code/browser/decorations.py 2013-02-28 04:22:25 +0000
+++ lib/lp/code/browser/decorations.py 2015-07-08 16:13:45 +0000
@@ -9,7 +9,7 @@
]
from lazr.delegates import delegates
-from zope.interface import implements
+from zope.interface import implementer
from lp.app.interfaces.informationtype import IInformationType
from lp.app.interfaces.launchpad import IPrivacy
@@ -20,12 +20,12 @@
from lp.services.propertycache import cachedproperty
+@implementer(IPrivacy)
class DecoratedBranch(BzrIdentityMixin):
"""Wrap a number of the branch accessors to cache results.
This avoids repeated db queries.
"""
- implements(IPrivacy)
delegates([IBranch, IInformationType], 'branch')
def __init__(self, branch):
=== modified file 'lib/lp/code/browser/gitlisting.py'
--- lib/lp/code/browser/gitlisting.py 2015-06-12 04:04:28 +0000
+++ lib/lp/code/browser/gitlisting.py 2015-07-08 16:13:45 +0000
@@ -13,7 +13,7 @@
from storm.expr import Desc
from zope.component import getUtility
from zope.interface import (
- implements,
+ implementer,
Interface,
)
@@ -42,9 +42,9 @@
pass
+@implementer(IGitRepositoryBatchNavigator)
class GitRepositoryBatchNavigator(TableBatchNavigator):
"""Batch up Git repository listings."""
- implements(IGitRepositoryBatchNavigator)
variable_name_prefix = 'repo'
=== modified file 'lib/lp/code/browser/gitrepository.py'
--- lib/lp/code/browser/gitrepository.py 2015-06-18 20:18:16 +0000
+++ lib/lp/code/browser/gitrepository.py 2015-07-08 16:13:45 +0000
@@ -29,7 +29,7 @@
from zope.event import notify
from zope.formlib import form
from zope.interface import (
- implements,
+ implementer,
Interface,
providedBy,
)
@@ -90,11 +90,10 @@
from lp.services.webapp.interfaces import ICanonicalUrlData
+@implementer(ICanonicalUrlData)
class GitRepositoryURL:
"""Git repository URL creation rules."""
- implements(ICanonicalUrlData)
-
rootsite = "code"
inside = None
@@ -202,9 +201,9 @@
return Link("+edit-information-type", text)
+@implementer(IGitRefBatchNavigator)
class GitRefBatchNavigator(TableBatchNavigator):
"""Batch up the branch listings."""
- implements(IGitRefBatchNavigator)
def __init__(self, view, context):
self.context = context
=== modified file 'lib/lp/code/browser/sourcepackagerecipe.py'
--- lib/lp/code/browser/sourcepackagerecipe.py 2015-04-30 01:45:30 +0000
+++ lib/lp/code/browser/sourcepackagerecipe.py 2015-07-08 16:13:45 +0000
@@ -42,7 +42,6 @@
from zope.formlib.widget import Widget
from zope.interface import (
implementer,
- implements,
Interface,
providedBy,
)
@@ -637,9 +636,9 @@
raise ErrorHandled()
+@implementer(IView)
class RelatedBranchesWidget(Widget):
"""A widget to render the related branches for a recipe."""
- implements(IView)
__call__ = ViewPageTemplateFile(
'../templates/sourcepackagerecipe-related-branches.pt')
=== modified file 'lib/lp/code/browser/widgets/branchtarget.py'
--- lib/lp/code/browser/widgets/branchtarget.py 2013-04-10 08:35:47 +0000
+++ lib/lp/code/browser/widgets/branchtarget.py 2015-07-08 16:13:45 +0000
@@ -21,7 +21,7 @@
InputWidget,
renderElement,
)
-from zope.interface import implements
+from zope.interface import implementer
from zope.schema import Choice
from lp.app.errors import UnexpectedFormData
@@ -35,11 +35,10 @@
)
+@implementer(IAlwaysSubmittedWidget, IMultiLineWidgetLayout, IInputWidget)
class BranchTargetWidget(BrowserWidget, InputWidget):
"""Widget for selecting a personal (+junk) or product branch target."""
- implements(IAlwaysSubmittedWidget, IMultiLineWidgetLayout, IInputWidget)
-
template = ViewPageTemplateFile('templates/branch-target.pt')
default_option = "product"
_widgets_set_up = False
=== modified file 'lib/lp/code/browser/widgets/gitrepositorytarget.py'
--- lib/lp/code/browser/widgets/gitrepositorytarget.py 2015-06-16 13:36:10 +0000
+++ lib/lp/code/browser/widgets/gitrepositorytarget.py 2015-07-08 16:13:45 +0000
@@ -26,7 +26,7 @@
InputWidget,
renderElement,
)
-from zope.interface import implements
+from zope.interface import implementer
from zope.schema import Choice
from lp.app.errors import (
@@ -47,10 +47,9 @@
)
+@implementer(IMultiLineWidgetLayout)
class GitRepositoryTargetWidgetBase(BrowserWidget):
- implements(IMultiLineWidgetLayout)
-
template = ViewPageTemplateFile("templates/gitrepository-target.pt")
default_option = "project"
_widgets_set_up = False
@@ -123,21 +122,19 @@
return self.template()
+@implementer(IDisplayWidget)
class GitRepositoryTargetDisplayWidget(
GitRepositoryTargetWidgetBase, DisplayWidget):
"""Widget for displaying a Git repository target."""
- implements(IDisplayWidget)
-
_sub_widget_interface = IDisplayWidget
_read_only = True
+@implementer(IAlwaysSubmittedWidget, IInputWidget)
class GitRepositoryTargetWidget(GitRepositoryTargetWidgetBase, InputWidget):
"""Widget for selecting a Git repository target."""
- implements(IAlwaysSubmittedWidget, IInputWidget)
-
_sub_widget_interface = IInputWidget
_read_only = False
_widgets_set_up = False
=== modified file 'lib/lp/code/browser/widgets/tests/test_branchpopupwidget.py'
--- lib/lp/code/browser/widgets/tests/test_branchpopupwidget.py 2014-01-30 15:04:06 +0000
+++ lib/lp/code/browser/widgets/tests/test_branchpopupwidget.py 2015-07-08 16:13:45 +0000
@@ -13,7 +13,7 @@
provideUtility,
)
from zope.formlib.interfaces import ConversionError
-from zope.interface import implements
+from zope.interface import implementer
from zope.schema import Choice
from lp import _
@@ -38,11 +38,10 @@
from lp.testing.layers import LaunchpadFunctionalLayer
+@implementer(ILaunchBag)
class DummyLaunchBag:
"""Dummy LaunchBag that we can easily control in our tests."""
- implements(ILaunchBag)
-
def __init__(self, user=None, product=None):
self.user = user
self.product = product
=== modified file 'lib/lp/code/browser/widgets/tests/test_branchtargetwidget.py'
--- lib/lp/code/browser/widgets/tests/test_branchtargetwidget.py 2013-04-10 08:35:47 +0000
+++ lib/lp/code/browser/widgets/tests/test_branchtargetwidget.py 2015-07-08 16:13:45 +0000
@@ -13,7 +13,7 @@
WidgetInputError,
)
from zope.interface import (
- implements,
+ implementer,
Interface,
)
@@ -37,8 +37,8 @@
target = Reference(schema=Interface)
+@implementer(IThing)
class Thing:
- implements(IThing)
target = None
=== modified file 'lib/lp/code/browser/widgets/tests/test_gitrepositorytargetwidget.py'
--- lib/lp/code/browser/widgets/tests/test_gitrepositorytargetwidget.py 2015-06-16 13:36:10 +0000
+++ lib/lp/code/browser/widgets/tests/test_gitrepositorytargetwidget.py 2015-07-08 16:13:45 +0000
@@ -14,7 +14,7 @@
WidgetInputError,
)
from zope.interface import (
- implements,
+ implementer,
Interface,
)
@@ -44,8 +44,8 @@
target = Reference(schema=Interface)
+@implementer(IThing)
class Thing:
- implements(IThing)
owner = None
target = None
=== modified file 'lib/lp/code/event/branchmergeproposal.py'
--- lib/lp/code/event/branchmergeproposal.py 2013-01-07 02:40:55 +0000
+++ lib/lp/code/event/branchmergeproposal.py 2015-07-08 16:13:45 +0000
@@ -13,7 +13,7 @@
]
from zope.component.interfaces import ObjectEvent
-from zope.interface import implements
+from zope.interface import implementer
from lp.code.interfaces.event import (
IBranchMergeProposalNeedsReviewEvent,
@@ -24,11 +24,10 @@
)
+@implementer(IBranchMergeProposalStatusChangeEvent)
class BranchMergeProposalStatusChangeEvent(ObjectEvent):
"""See `IBranchMergeProposalStatusChangeEvent`."""
- implements(IBranchMergeProposalStatusChangeEvent)
-
def __init__(self, proposal, user, from_state, to_state):
ObjectEvent.__init__(self, proposal)
self.user = user
@@ -36,24 +35,24 @@
self.to_state = to_state
+@implementer(INewBranchMergeProposalEvent)
class NewBranchMergeProposalEvent(ObjectEvent):
"""A new merge has been proposed."""
- implements(INewBranchMergeProposalEvent)
-
-
+
+
+@implementer(IBranchMergeProposalNeedsReviewEvent)
class BranchMergeProposalNeedsReviewEvent(ObjectEvent):
"""The merge proposal has moved from work in progress to needs reivew."""
- implements(IBranchMergeProposalNeedsReviewEvent)
-
-
+
+
+@implementer(IReviewerNominatedEvent)
class ReviewerNominatedEvent(ObjectEvent):
"""A reviewer has been nominated."""
- implements(IReviewerNominatedEvent)
-
-
+
+
+@implementer(INewCodeReviewCommentEvent)
class NewCodeReviewCommentEvent(ObjectEvent):
"""A new comment has been added to the merge proposal."""
- implements(INewCodeReviewCommentEvent)
def __init__(self, code_review_comment, original_email):
ObjectEvent.__init__(self, code_review_comment)
=== modified file 'lib/lp/code/event/git.py'
--- lib/lp/code/event/git.py 2015-06-12 17:55:28 +0000
+++ lib/lp/code/event/git.py 2015-07-08 16:13:45 +0000
@@ -9,16 +9,15 @@
]
from zope.component.interfaces import ObjectEvent
-from zope.interface import implements
+from zope.interface import implementer
from lp.code.interfaces.event import IGitRefsUpdatedEvent
+@implementer(IGitRefsUpdatedEvent)
class GitRefsUpdatedEvent(ObjectEvent):
"""See `IGitRefsUpdatedEvent`."""
- implements(IGitRefsUpdatedEvent)
-
def __init__(self, repository, paths, logger):
super(GitRefsUpdatedEvent, self).__init__(repository)
self.paths = paths
=== modified file 'lib/lp/code/feed/branch.py'
--- lib/lp/code/feed/branch.py 2015-04-22 12:03:05 +0000
+++ lib/lp/code/feed/branch.py 2015-07-08 16:13:45 +0000
@@ -21,7 +21,7 @@
)
from z3c.ptcompat import ViewPageTemplateFile
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from zope.security.interfaces import Unauthorized
from lp.code.browser.branch import BranchView
@@ -365,12 +365,12 @@
return getUtility(IRevisionCache).inProjectGroup(self.context)
+@implementer(IFeedPerson)
class RevisionPerson:
"""See `IFeedPerson`.
Uses the `name_without_email` property for the display name.
"""
- implements(IFeedPerson)
def __init__(self, person, rootsite):
=== modified file 'lib/lp/code/mail/codehandler.py'
--- lib/lp/code/mail/codehandler.py 2012-06-29 08:40:05 +0000
+++ lib/lp/code/mail/codehandler.py 2015-07-08 16:13:45 +0000
@@ -11,7 +11,7 @@
from sqlobject import SQLObjectNotFound
import transaction
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from zope.security.interfaces import Unauthorized
from lp.code.enums import CodeReviewVote
@@ -231,9 +231,9 @@
return (reviewer, review_tags)
+@implementer(IMailHandler)
class CodeHandler:
"""Mail handler for the code domain."""
- implements(IMailHandler)
addr_pattern = re.compile(r'(mp\+)([^@]+).*')
allow_unknown_users = False
=== modified file 'lib/lp/code/model/branch.py'
--- lib/lp/code/model/branch.py 2015-05-26 12:18:12 +0000
+++ lib/lp/code/model/branch.py 2015-07-08 16:13:45 +0000
@@ -38,7 +38,7 @@
from storm.store import Store
from zope.component import getUtility
from zope.event import notify
-from zope.interface import implements
+from zope.interface import implementer
from zope.security.interfaces import Unauthorized
from zope.security.proxy import (
ProxyFactory,
@@ -181,10 +181,9 @@
from lp.services.webapp.authorization import check_permission
+@implementer(IBranch, IPrivacy, IInformationType)
class Branch(SQLBase, BzrIdentityMixin):
"""A sequence of ordered revisions in Bazaar."""
-
- implements(IBranch, IPrivacy, IInformationType)
_table = 'Branch'
branch_type = EnumCol(enum=BranchType, notNull=True)
@@ -1516,11 +1515,10 @@
CodeImportSet().delete(self.affected_object)
+@implementer(IBranchSet)
class BranchSet:
"""The set of all branches."""
- implements(IBranchSet)
-
def getRecentlyChangedBranches(
self, branch_count=None,
lifecycle_statuses=DEFAULT_BRANCH_STATUS_IN_LISTING,
=== modified file 'lib/lp/code/model/branchcloud.py'
--- lib/lp/code/model/branchcloud.py 2013-06-20 05:50:00 +0000
+++ lib/lp/code/model/branchcloud.py 2015-07-08 16:13:45 +0000
@@ -25,7 +25,7 @@
Max,
Not,
)
-from zope.interface import classProvides
+from zope.interface import provider
from lp.code.interfaces.branch import IBranchCloud
from lp.code.model.revision import RevisionCache
@@ -33,11 +33,10 @@
from lp.services.database.interfaces import ISlaveStore
+@provider(IBranchCloud)
class BranchCloud:
"""See `IBranchCloud`."""
- classProvides(IBranchCloud)
-
@staticmethod
def getProductsWithInfo(num_products=None):
"""See `IBranchCloud`."""
=== modified file 'lib/lp/code/model/branchcollection.py'
--- lib/lp/code/model/branchcollection.py 2015-02-25 11:21:43 +0000
+++ lib/lp/code/model/branchcollection.py 2015-07-08 16:13:45 +0000
@@ -30,7 +30,7 @@
from storm.info import ClassAlias
from storm.store import EmptyResultSet
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from lp.app.enums import PRIVATE_INFORMATION_TYPES
from lp.bugs.interfaces.bugtask import IBugTaskSet
@@ -79,11 +79,10 @@
from lp.services.searchbuilder import any
+@implementer(IBranchCollection)
class GenericBranchCollection:
"""See `IBranchCollection`."""
- implements(IBranchCollection)
-
def __init__(self, store=None, branch_filter_expressions=None,
tables=None,
asymmetric_filter_expressions=None, asymmetric_tables=None):
=== modified file 'lib/lp/code/model/branchjob.py'
--- lib/lp/code/model/branchjob.py 2015-04-16 04:07:59 +0000
+++ lib/lp/code/model/branchjob.py 2015-07-08 16:13:45 +0000
@@ -52,8 +52,8 @@
import transaction
from zope.component import getUtility
from zope.interface import (
- classProvides,
- implements,
+ implementer,
+ provider,
)
from lp.code.bzr import (
@@ -185,11 +185,10 @@
""")
+@implementer(IBranchJob)
class BranchJob(SQLBase):
"""Base class for jobs related to branches."""
- implements(IBranchJob)
-
_table = 'BranchJob'
job = ForeignKey(foreignKey='Job', notNull=True)
@@ -296,12 +295,10 @@
return [format_address_for_person(self.requester)]
+@implementer(IBranchScanJob)
+@provider(IBranchScanJobSource)
class BranchScanJob(BranchJobDerived):
"""A Job that scans a branch for new revisions."""
-
- implements(IBranchScanJob)
-
- classProvides(IBranchScanJobSource)
class_job_type = BranchJobType.SCAN_BRANCH
memory_limit = 2 * (1024 ** 3)
@@ -339,12 +336,10 @@
% self._cached_branch_name)
+@implementer(IBranchUpgradeJob)
+@provider(IBranchUpgradeJobSource)
class BranchUpgradeJob(BranchJobDerived):
"""A Job that upgrades branches to the current stable format."""
-
- implements(IBranchUpgradeJob)
-
- classProvides(IBranchUpgradeJobSource)
class_job_type = BranchJobType.UPGRADE_BRANCH
user_error_types = (NotBranchError,)
@@ -421,13 +416,11 @@
shutil.rmtree(upgrade_branch_path)
+@implementer(IRevisionMailJob)
+@provider(IRevisionMailJobSource)
class RevisionMailJob(BranchJobDerived):
"""A Job that sends a mail for a scan of a Branch."""
- implements(IRevisionMailJob)
-
- classProvides(IRevisionMailJobSource)
-
class_job_type = BranchJobType.REVISION_MAIL
config = config.IRevisionMailJobSource
@@ -471,9 +464,9 @@
self.getMailer().sendAll()
+@implementer(IRevisionsAddedJob)
class RevisionsAddedJob(BranchJobDerived):
"""A job for sending emails about added revisions."""
- implements(IRevisionsAddedJob)
class_job_type = BranchJobType.REVISIONS_ADDED_MAIL
@@ -727,13 +720,11 @@
return outf.getvalue()
+@implementer(IRosettaUploadJob)
+@provider(IRosettaUploadJobSource)
class RosettaUploadJob(BranchJobDerived):
"""A Job that uploads translation files to Rosetta."""
- implements(IRosettaUploadJob)
-
- classProvides(IRosettaUploadJobSource)
-
class_job_type = BranchJobType.ROSETTA_UPLOAD
task_queue = 'bzrsyncd_job'
@@ -964,13 +955,11 @@
return jobs
+@implementer(IReclaimBranchSpaceJob)
+@provider(IReclaimBranchSpaceJobSource)
class ReclaimBranchSpaceJob(BranchJobDerived, BaseRunnableJobSource):
"""Reclaim the disk space used by a branch that's deleted from the DB."""
- implements(IReclaimBranchSpaceJob)
-
- classProvides(IReclaimBranchSpaceJobSource)
-
class_job_type = BranchJobType.RECLAIM_BRANCH_SPACE
task_queue = 'branch_write_job'
=== modified file 'lib/lp/code/model/branchlistingqueryoptimiser.py'
--- lib/lp/code/model/branchlistingqueryoptimiser.py 2013-06-20 05:50:00 +0000
+++ lib/lp/code/model/branchlistingqueryoptimiser.py 2015-07-08 16:13:45 +0000
@@ -9,7 +9,7 @@
]
-from zope.interface import implements
+from zope.interface import implementer
from lp.code.interfaces.branch import IBranchListingQueryOptimiser
from lp.code.model.seriessourcepackagebranch import SeriesSourcePackageBranch
@@ -21,11 +21,10 @@
from lp.services.database.interfaces import IStore
+@implementer(IBranchListingQueryOptimiser)
class BranchListingQueryOptimiser:
"""Utility object for efficient DB queries for branch listings."""
- implements(IBranchListingQueryOptimiser)
-
@staticmethod
def getProductSeriesForBranches(branch_ids):
"""See `IBranchListingQueryOptimiser`."""
=== modified file 'lib/lp/code/model/branchlookup.py'
--- lib/lp/code/model/branchlookup.py 2015-02-26 13:54:01 +0000
+++ lib/lp/code/model/branchlookup.py 2015-07-08 16:13:45 +0000
@@ -26,7 +26,7 @@
getUtility,
queryMultiAdapter,
)
-from zope.interface import implements
+from zope.interface import implementer
from lp.app.errors import NameLookupFailed
from lp.app.validators.name import valid_name
@@ -83,6 +83,7 @@
return None
+@implementer(ILinkedBranchTraversable)
class RootTraversable:
"""Root traversable for linked branch objects.
@@ -90,8 +91,6 @@
distribution or a product.
"""
- implements(ILinkedBranchTraversable)
-
def traverse(self, name, segments):
"""See `ITraversable`.
@@ -120,6 +119,7 @@
self.context = context
+@implementer(ILinkedBranchTraversable)
class ProductTraversable(_BaseTraversable):
"""Linked branch traversable for products.
@@ -127,7 +127,6 @@
"""
adapts(IProduct)
- implements(ILinkedBranchTraversable)
def traverse(self, name, segments):
"""See `ITraversable`.
@@ -142,6 +141,7 @@
return series
+@implementer(ILinkedBranchTraversable)
class DistributionTraversable(_BaseTraversable):
"""Linked branch traversable for distributions.
@@ -149,7 +149,6 @@
"""
adapts(IDistribution)
- implements(ILinkedBranchTraversable)
def traverse(self, name, segments):
"""See `ITraversable`."""
@@ -165,6 +164,7 @@
return sourcepackage
+@implementer(ILinkedBranchTraversable)
class DistroSeriesTraversable:
"""Linked branch traversable for distribution series.
@@ -172,7 +172,6 @@
"""
adapts(IDistroSeries, DBItem)
- implements(ILinkedBranchTraversable)
def __init__(self, distroseries, pocket):
self.distroseries = distroseries
@@ -186,11 +185,10 @@
return sourcepackage.getSuiteSourcePackage(self.pocket)
+@implementer(ILinkedBranchTraverser)
class LinkedBranchTraverser:
"""Utility for traversing to objects that can have linked branches."""
- implements(ILinkedBranchTraverser)
-
def traverse(self, path):
"""See `ILinkedBranchTraverser`."""
segments = path.split('/')
@@ -204,11 +202,10 @@
return context
+@implementer(IBranchLookup)
class BranchLookup:
"""Utility for looking up branches."""
- implements(IBranchLookup)
-
def get(self, branch_id, default=None):
"""See `IBranchLookup`."""
try:
=== modified file 'lib/lp/code/model/branchmergeproposal.py'
--- lib/lp/code/model/branchmergeproposal.py 2015-06-11 22:55:10 +0000
+++ lib/lp/code/model/branchmergeproposal.py 2015-07-08 16:13:45 +0000
@@ -38,7 +38,7 @@
)
from zope.component import getUtility
from zope.event import notify
-from zope.interface import implements
+from zope.interface import implementer
from lp.app.enums import PRIVATE_INFORMATION_TYPES
from lp.code.enums import (
@@ -172,11 +172,10 @@
return True
+@implementer(IBranchMergeProposal, IHasBranchTarget)
class BranchMergeProposal(SQLBase):
"""A relationship between a person and a branch."""
- implements(IBranchMergeProposal, IHasBranchTarget)
-
_table = 'BranchMergeProposal'
_defaultOrder = ['-date_created', 'id']
@@ -1151,11 +1150,10 @@
GenericGitCollection.preloadDataForRepositories(repositories)
+@implementer(IBranchMergeProposalGetter)
class BranchMergeProposalGetter:
"""See `IBranchMergeProposalGetter`."""
- implements(IBranchMergeProposalGetter)
-
@staticmethod
def get(id):
"""See `IBranchMergeProposalGetter`."""
=== modified file 'lib/lp/code/model/branchmergeproposaljob.py'
--- lib/lp/code/model/branchmergeproposaljob.py 2015-04-30 13:11:12 +0000
+++ lib/lp/code/model/branchmergeproposaljob.py 2015-07-08 16:13:45 +0000
@@ -48,8 +48,8 @@
from storm.store import Store
from zope.component import getUtility
from zope.interface import (
- classProvides,
- implements,
+ implementer,
+ provider,
)
from lp.code.adapters.branch import BranchMergeProposalDelta
@@ -145,11 +145,10 @@
This job generates an incremental diff for a merge proposal.""")
+@implementer(IBranchMergeProposalJob)
class BranchMergeProposalJob(StormBase):
"""Base class for jobs related to branch merge proposals."""
- implements(IBranchMergeProposalJob)
-
__storm_table__ = 'BranchMergeProposalJob'
id = Int(primary=True)
@@ -300,13 +299,11 @@
return vars
+@implementer(IMergeProposalNeedsReviewEmailJob)
+@provider(IMergeProposalNeedsReviewEmailJobSource)
class MergeProposalNeedsReviewEmailJob(BranchMergeProposalJobDerived):
"""See `IMergeProposalNeedsReviewEmailJob`."""
- implements(IMergeProposalNeedsReviewEmailJob)
-
- classProvides(IMergeProposalNeedsReviewEmailJobSource)
-
class_job_type = BranchMergeProposalJobType.MERGE_PROPOSAL_NEEDS_REVIEW
config = config.IBranchMergeProposalJobSource
@@ -326,16 +323,14 @@
self.branch_merge_proposal.merge_target.identity))
+@implementer(IUpdatePreviewDiffJob)
+@provider(IUpdatePreviewDiffJobSource)
class UpdatePreviewDiffJob(BranchMergeProposalJobDerived):
"""A job to update the preview diff for a branch merge proposal.
Provides class methods to create and retrieve such jobs.
"""
- implements(IUpdatePreviewDiffJob)
-
- classProvides(IUpdatePreviewDiffJobSource)
-
class_job_type = BranchMergeProposalJobType.UPDATE_PREVIEW_DIFF
task_queue = 'bzrsyncd_job'
@@ -388,16 +383,14 @@
return format_address_for_person(registrant)
+@implementer(ICodeReviewCommentEmailJob)
+@provider(ICodeReviewCommentEmailJobSource)
class CodeReviewCommentEmailJob(BranchMergeProposalJobDerived):
"""A job to send a code review comment.
Provides class methods to create and retrieve such jobs.
"""
- implements(ICodeReviewCommentEmailJob)
-
- classProvides(ICodeReviewCommentEmailJobSource)
-
class_job_type = BranchMergeProposalJobType.CODE_REVIEW_COMMENT_EMAIL
config = config.IBranchMergeProposalJobSource
@@ -441,16 +434,14 @@
return 'emailing a code review comment'
+@implementer(IReviewRequestedEmailJob)
+@provider(IReviewRequestedEmailJobSource)
class ReviewRequestedEmailJob(BranchMergeProposalJobDerived):
"""Send email to the reviewer telling them to review the proposal.
Provides class methods to create and retrieve such jobs.
"""
- implements(IReviewRequestedEmailJob)
-
- classProvides(IReviewRequestedEmailJobSource)
-
class_job_type = BranchMergeProposalJobType.REVIEW_REQUEST_EMAIL
config = config.IBranchMergeProposalJobSource
@@ -507,6 +498,8 @@
return 'emailing a reviewer requesting a review'
+@implementer(IMergeProposalUpdatedEmailJob)
+@provider(IMergeProposalUpdatedEmailJobSource)
class MergeProposalUpdatedEmailJob(BranchMergeProposalJobDerived):
"""Send email to the subscribers informing them of updated fields.
@@ -514,10 +507,6 @@
subscribers.
"""
- implements(IMergeProposalUpdatedEmailJob)
-
- classProvides(IMergeProposalUpdatedEmailJobSource)
-
class_job_type = BranchMergeProposalJobType.MERGE_PROPOSAL_UPDATED
config = config.IBranchMergeProposalJobSource
@@ -575,16 +564,14 @@
return 'emailing subscribers about merge proposal changes'
+@implementer(IGenerateIncrementalDiffJob)
+@provider(IGenerateIncrementalDiffJobSource)
class GenerateIncrementalDiffJob(BranchMergeProposalJobDerived):
"""A job to generate an incremental diff for a branch merge proposal.
Provides class methods to create and retrieve such jobs.
"""
- implements(IGenerateIncrementalDiffJob)
-
- classProvides(IGenerateIncrementalDiffJobSource)
-
class_job_type = BranchMergeProposalJobType.GENERATE_INCREMENTAL_DIFF
task_queue = 'bzrsyncd_job'
@@ -642,14 +629,13 @@
return format_address_for_person(registrant)
+@provider(IBranchMergeProposalJobSource)
class BranchMergeProposalJobSource(BaseRunnableJobSource):
"""Provide a job source for all merge proposal jobs.
Only one job for any particular merge proposal is returned.
"""
- classProvides(IBranchMergeProposalJobSource)
-
@staticmethod
def get(job_id):
"""Get a job by id.
=== modified file 'lib/lp/code/model/branchnamespace.py'
--- lib/lp/code/model/branchnamespace.py 2015-04-16 14:52:40 +0000
+++ lib/lp/code/model/branchnamespace.py 2015-07-08 16:13:45 +0000
@@ -19,7 +19,7 @@
from storm.locals import And
from zope.component import getUtility
from zope.event import notify
-from zope.interface import implements
+from zope.interface import implementer
from zope.security.proxy import removeSecurityProxy
from lp.app.enums import (
@@ -289,14 +289,13 @@
raise NotImplementedError
+@implementer(IBranchNamespace, IBranchNamespacePolicy)
class PersonalBranchNamespace(_BaseBranchNamespace):
"""A namespace for personal (or 'junk') branches.
Branches in this namespace have names like '~foo/+junk/bar'.
"""
- implements(IBranchNamespace, IBranchNamespacePolicy)
-
def __init__(self, person):
self.owner = person
@@ -337,6 +336,7 @@
return IBranchTarget(self.owner)
+@implementer(IBranchNamespace, IBranchNamespacePolicy)
class ProjectBranchNamespace(_BaseBranchNamespace):
"""A namespace for project branches.
@@ -344,8 +344,6 @@
particular project.
"""
- implements(IBranchNamespace, IBranchNamespacePolicy)
-
def __init__(self, person, product):
self.owner = person
self.product = product
@@ -393,6 +391,7 @@
return default_type
+@implementer(IBranchNamespace, IBranchNamespacePolicy)
class PackageBranchNamespace(_BaseBranchNamespace):
"""A namespace for source package branches.
@@ -400,8 +399,6 @@
particular source package in a particular distroseries.
"""
- implements(IBranchNamespace, IBranchNamespacePolicy)
-
def __init__(self, person, sourcepackage):
self.owner = person
self.sourcepackage = sourcepackage
=== modified file 'lib/lp/code/model/branchpuller.py'
--- lib/lp/code/model/branchpuller.py 2013-06-20 05:50:00 +0000
+++ lib/lp/code/model/branchpuller.py 2015-07-08 16:13:45 +0000
@@ -9,7 +9,7 @@
from datetime import timedelta
-from zope.interface import implements
+from zope.interface import implementer
from lp.code.enums import BranchType
from lp.code.interfaces.branchpuller import IBranchPuller
@@ -18,11 +18,10 @@
from lp.services.database.interfaces import IStore
+@implementer(IBranchPuller)
class BranchPuller:
"""See `IBranchPuller`."""
- implements(IBranchPuller)
-
MAXIMUM_MIRROR_FAILURES = 5
MIRROR_TIME_INCREMENT = timedelta(hours=6)
=== modified file 'lib/lp/code/model/branchrevision.py'
--- lib/lp/code/model/branchrevision.py 2013-01-07 02:40:55 +0000
+++ lib/lp/code/model/branchrevision.py 2015-07-08 16:13:45 +0000
@@ -11,18 +11,17 @@
Reference,
Storm,
)
-from zope.interface import implements
+from zope.interface import implementer
from lp.code.interfaces.branchrevision import IBranchRevision
+@implementer(IBranchRevision)
class BranchRevision(Storm):
"""See `IBranchRevision`."""
__storm_table__ = 'BranchRevision'
__storm_primary__ = ("branch_id", "revision_id")
- implements(IBranchRevision)
-
branch_id = Int(name='branch', allow_none=False)
branch = Reference(branch_id, 'Branch.id')
=== modified file 'lib/lp/code/model/branchsubscription.py'
--- lib/lp/code/model/branchsubscription.py 2015-04-15 13:41:13 +0000
+++ lib/lp/code/model/branchsubscription.py 2015-07-08 16:13:45 +0000
@@ -5,7 +5,7 @@
__all__ = ['BranchSubscription']
from sqlobject import ForeignKey
-from zope.interface import implements
+from zope.interface import implementer
from lp.code.enums import (
BranchSubscriptionDiffSize,
@@ -22,11 +22,10 @@
from lp.services.database.sqlbase import SQLBase
+@implementer(IBranchSubscription, IHasBranchTarget)
class BranchSubscription(SQLBase):
"""A relationship between a person and a branch."""
- implements(IBranchSubscription, IHasBranchTarget)
-
_table = 'BranchSubscription'
person = ForeignKey(
=== modified file 'lib/lp/code/model/branchtarget.py'
--- lib/lp/code/model/branchtarget.py 2015-01-28 16:55:54 +0000
+++ lib/lp/code/model/branchtarget.py 2015-07-08 16:13:45 +0000
@@ -13,7 +13,7 @@
from operator import attrgetter
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from zope.security.proxy import isinstance as zope_isinstance
from lp.code.errors import NoLinkedBranch
@@ -55,8 +55,8 @@
return []
+@implementer(IBranchTarget)
class PackageBranchTarget(_BaseBranchTarget):
- implements(IBranchTarget)
def __init__(self, sourcepackage):
self.sourcepackage = sourcepackage
@@ -188,8 +188,8 @@
return result
+@implementer(IBranchTarget)
class PersonBranchTarget(_BaseBranchTarget):
- implements(IBranchTarget)
name = u'+junk'
default_stacked_on_branch = None
@@ -262,8 +262,8 @@
branch.sourcepackagename = None
+@implementer(IBranchTarget)
class ProductBranchTarget(_BaseBranchTarget):
- implements(IBranchTarget)
def __init__(self, product):
self.product = product
=== modified file 'lib/lp/code/model/codeimport.py'
--- lib/lp/code/model/codeimport.py 2014-02-24 07:19:52 +0000
+++ lib/lp/code/model/codeimport.py 2015-07-08 16:13:45 +0000
@@ -30,7 +30,7 @@
from storm.references import Reference
from zope.component import getUtility
from zope.event import notify
-from zope.interface import implements
+from zope.interface import implementer
from lp.app.errors import NotFoundError
from lp.code.enums import (
@@ -64,10 +64,9 @@
from lp.services.database.sqlbase import SQLBase
+@implementer(ICodeImport)
class CodeImport(SQLBase):
"""See `ICodeImport`."""
-
- implements(ICodeImport)
_table = 'CodeImport'
_defaultOrder = ['id']
@@ -229,11 +228,10 @@
self.import_job, requester)
+@implementer(ICodeImportSet)
class CodeImportSet:
"""See `ICodeImportSet`."""
- implements(ICodeImportSet)
-
def new(self, registrant, target, branch_name, rcs_type,
url=None, cvs_root=None, cvs_module=None, review_status=None,
owner=None):
=== modified file 'lib/lp/code/model/codeimportevent.py'
--- lib/lp/code/model/codeimportevent.py 2014-02-24 07:19:52 +0000
+++ lib/lp/code/model/codeimportevent.py 2015-07-08 16:13:45 +0000
@@ -16,7 +16,7 @@
ForeignKey,
StringCol,
)
-from zope.interface import implements
+from zope.interface import implementer
from lp.code.enums import (
CodeImportEventDataType,
@@ -39,10 +39,9 @@
from lp.services.database.sqlbase import SQLBase
+@implementer(ICodeImportEvent)
class CodeImportEvent(SQLBase):
"""See `ICodeImportEvent`."""
-
- implements(ICodeImportEvent)
_table = 'CodeImportEvent'
date_created = UtcDateTimeCol(notNull=True, default=DEFAULT)
@@ -78,11 +77,10 @@
data_value = StringCol()
+@implementer(ICodeImportEventSet)
class CodeImportEventSet:
"""See `ICodeImportEventSet`."""
- implements(ICodeImportEventSet)
-
def getAll(self):
"""See `ICodeImportEventSet`."""
return CodeImportEvent.select(orderBy=['date_created', 'id'])
@@ -321,10 +319,9 @@
return None
+@implementer(ICodeImportEventToken)
class CodeImportEventToken:
"""See `ICodeImportEventToken`."""
- implements(ICodeImportEventToken)
-
def __init__(self, items):
self.items = items
=== modified file 'lib/lp/code/model/codeimportjob.py'
--- lib/lp/code/model/codeimportjob.py 2013-06-20 05:50:00 +0000
+++ lib/lp/code/model/codeimportjob.py 2015-07-08 16:13:45 +0000
@@ -19,7 +19,7 @@
StringCol,
)
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from zope.security.proxy import removeSecurityProxy
from lp.code.enums import (
@@ -50,11 +50,10 @@
)
+@implementer(ICodeImportJob)
class CodeImportJob(SQLBase):
"""See `ICodeImportJob`."""
- implements(ICodeImportJob)
-
date_created = UtcDateTimeCol(notNull=True, default=UTC_NOW)
code_import = ForeignKey(
@@ -101,11 +100,10 @@
return import_job is not None
+@implementer(ICodeImportJobSet, ICodeImportJobSetPublic)
class CodeImportJobSet(object):
"""See `ICodeImportJobSet`."""
- implements(ICodeImportJobSet, ICodeImportJobSetPublic)
-
# CodeImportJob database objects are created using
# CodeImportJobWorkflow.newJob.
@@ -148,11 +146,10 @@
config.codeimportworker.maximum_heartbeat_interval))
+@implementer(ICodeImportJobWorkflow)
class CodeImportJobWorkflow:
"""See `ICodeImportJobWorkflow`."""
- implements(ICodeImportJobWorkflow)
-
def newJob(self, code_import, interval=None):
"""See `ICodeImportJobWorkflow`."""
assert code_import.review_status == CodeImportReviewStatus.REVIEWED, (
=== modified file 'lib/lp/code/model/codeimportmachine.py'
--- lib/lp/code/model/codeimportmachine.py 2013-01-07 02:40:55 +0000
+++ lib/lp/code/model/codeimportmachine.py 2015-07-08 16:13:45 +0000
@@ -15,7 +15,7 @@
StringCol,
)
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from lp.code.enums import (
CodeImportMachineOfflineReason,
@@ -35,13 +35,12 @@
from lp.services.database.sqlbase import SQLBase
+@implementer(ICodeImportMachine)
class CodeImportMachine(SQLBase):
"""See `ICodeImportMachine`."""
_defaultOrder = ['hostname']
- implements(ICodeImportMachine)
-
date_created = UtcDateTimeCol(notNull=True, default=DEFAULT)
hostname = StringCol(default=None)
@@ -106,11 +105,10 @@
getUtility(ICodeImportEventSet).newQuiesce(self, user, message)
+@implementer(ICodeImportMachineSet)
class CodeImportMachineSet(object):
"""See `ICodeImportMachineSet`."""
- implements(ICodeImportMachineSet)
-
def getAll(self):
"""See `ICodeImportMachineSet`."""
return CodeImportMachine.select()
=== modified file 'lib/lp/code/model/codeimportresult.py'
--- lib/lp/code/model/codeimportresult.py 2011-12-30 06:14:56 +0000
+++ lib/lp/code/model/codeimportresult.py 2015-07-08 16:13:45 +0000
@@ -10,7 +10,7 @@
ForeignKey,
StringCol,
)
-from zope.interface import implements
+from zope.interface import implementer
from lp.code.enums import CodeImportResultStatus
from lp.code.interfaces.codeimportresult import (
@@ -24,11 +24,10 @@
from lp.services.database.sqlbase import SQLBase
+@implementer(ICodeImportResult)
class CodeImportResult(SQLBase):
"""See `ICodeImportResult`."""
- implements(ICodeImportResult)
-
date_created = UtcDateTimeCol(notNull=True, default=UTC_NOW)
code_import = ForeignKey(
@@ -61,11 +60,10 @@
return self.date_job_finished - self.date_job_started
+@implementer(ICodeImportResultSet)
class CodeImportResultSet(object):
"""See `ICodeImportResultSet`."""
- implements(ICodeImportResultSet)
-
def new(self, code_import, machine, requesting_user, log_excerpt,
log_file, status, date_job_started, date_job_finished=None):
"""See `ICodeImportResultSet`."""
=== modified file 'lib/lp/code/model/codereviewcomment.py'
--- lib/lp/code/model/codereviewcomment.py 2015-05-07 13:57:33 +0000
+++ lib/lp/code/model/codereviewcomment.py 2015-07-08 16:13:45 +0000
@@ -14,7 +14,7 @@
ForeignKey,
StringCol,
)
-from zope.interface import implements
+from zope.interface import implementer
from lp.code.enums import CodeReviewVote
from lp.code.interfaces.branchtarget import IHasBranchTarget
@@ -59,15 +59,10 @@
return '\n'.join(result)
+@implementer(ICodeReviewComment, ICodeReviewCommentDeletion, IHasBranchTarget)
class CodeReviewComment(SQLBase):
"""A table linking branch merge proposals and messages."""
- implements(
- ICodeReviewComment,
- ICodeReviewCommentDeletion,
- IHasBranchTarget,
- )
-
_table = 'CodeReviewMessage'
branch_merge_proposal = ForeignKey(
=== modified file 'lib/lp/code/model/codereviewinlinecomment.py'
--- lib/lp/code/model/codereviewinlinecomment.py 2014-05-21 02:41:19 +0000
+++ lib/lp/code/model/codereviewinlinecomment.py 2015-07-08 16:13:45 +0000
@@ -17,7 +17,7 @@
JSON,
)
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from lp.code.interfaces.codereviewinlinecomment import (
ICodeReviewInlineComment,
@@ -30,11 +30,10 @@
from lp.services.database.stormbase import StormBase
+@implementer(ICodeReviewInlineComment)
class CodeReviewInlineComment(StormBase):
__storm_table__ = 'CodeReviewInlineComment'
- implements(ICodeReviewInlineComment)
-
previewdiff_id = Int(name='previewdiff')
previewdiff = Reference(previewdiff_id, 'PreviewDiff.id')
person_id = Int(name='person')
@@ -55,9 +54,9 @@
comments = JSON()
+@implementer(ICodeReviewInlineCommentSet)
class CodeReviewInlineCommentSet:
"""Utility for `CodeReviewInlineComment{,Draft}` handling."""
- implements(ICodeReviewInlineCommentSet)
def _findDraftObject(self, previewdiff, person):
"""Return the base `CodeReviewInlineCommentDraft` lookup."""
=== modified file 'lib/lp/code/model/codereviewvote.py'
--- lib/lp/code/model/codereviewvote.py 2011-12-30 06:14:56 +0000
+++ lib/lp/code/model/codereviewvote.py 2015-07-08 16:13:45 +0000
@@ -12,7 +12,7 @@
ForeignKey,
StringCol,
)
-from zope.interface import implements
+from zope.interface import implementer
from zope.schema import Int
from lp.code.errors import (
@@ -26,11 +26,10 @@
from lp.services.database.sqlbase import SQLBase
+@implementer(ICodeReviewVoteReference)
class CodeReviewVoteReference(SQLBase):
"""See `ICodeReviewVote`"""
- implements(ICodeReviewVoteReference)
-
_table = 'CodeReviewVote'
id = Int()
branch_merge_proposal = ForeignKey(
=== modified file 'lib/lp/code/model/defaultgit.py'
--- lib/lp/code/model/defaultgit.py 2015-02-26 13:38:49 +0000
+++ lib/lp/code/model/defaultgit.py 2015-07-08 16:13:45 +0000
@@ -9,7 +9,7 @@
__all__ = []
from zope.component import adapts
-from zope.interface import implements
+from zope.interface import implementer
from lp.code.interfaces.defaultgit import ICanHasDefaultGitRepository
from lp.registry.interfaces.distributionsourcepackage import (
@@ -39,11 +39,11 @@
return not self == other
+@implementer(ICanHasDefaultGitRepository)
class ProjectDefaultGitRepository(BaseDefaultGitRepository):
"""Implement a default Git repository for a project."""
adapts(IProduct)
- implements(ICanHasDefaultGitRepository)
sort_order = 0
@@ -56,11 +56,11 @@
return self.context.name
+@implementer(ICanHasDefaultGitRepository)
class PackageDefaultGitRepository(BaseDefaultGitRepository):
"""Implement a default Git repository for a distribution source package."""
adapts(IDistributionSourcePackage)
- implements(ICanHasDefaultGitRepository)
sort_order = 0
@@ -75,11 +75,11 @@
self.context.sourcepackagename.name)
+@implementer(ICanHasDefaultGitRepository)
class OwnerProjectDefaultGitRepository(BaseDefaultGitRepository):
"""Implement an owner's default Git repository for a project."""
adapts(IPersonProduct)
- implements(ICanHasDefaultGitRepository)
sort_order = 1
@@ -92,12 +92,12 @@
return "~%s/%s" % (self.context.person.name, self.context.product.name)
+@implementer(ICanHasDefaultGitRepository)
class OwnerPackageDefaultGitRepository(BaseDefaultGitRepository):
"""Implement an owner's default Git repository for a distribution source
package."""
adapts(IPersonDistributionSourcePackage)
- implements(ICanHasDefaultGitRepository)
sort_order = 1
=== modified file 'lib/lp/code/model/diff.py'
--- lib/lp/code/model/diff.py 2015-06-12 16:21:05 +0000
+++ lib/lp/code/model/diff.py 2015-07-08 16:13:45 +0000
@@ -39,7 +39,7 @@
)
from zope.component import getUtility
from zope.error.interfaces import IErrorReportingUtility
-from zope.interface import implements
+from zope.interface import implementer
from lp.app.errors import NotFoundError
from lp.code.interfaces.diff import (
@@ -61,11 +61,10 @@
from lp.services.webapp.adapter import get_request_remaining_seconds
+@implementer(IDiff)
class Diff(SQLBase):
"""See `IDiff`."""
- implements(IDiff)
-
diff_text = ForeignKey(foreignKey='LibraryFileAlias')
diff_lines_count = IntCol()
@@ -323,11 +322,10 @@
return cls.fromFileAtEnd(diff_content)
+@implementer(IIncrementalDiff)
class IncrementalDiff(Storm):
"""See `IIncrementalDiff."""
- implements(IIncrementalDiff)
-
delegates(IDiff, context='diff')
__storm_table__ = 'IncrementalDiff'
@@ -353,9 +351,9 @@
new_revision = Reference(new_revision_id, 'Revision.id')
+@implementer(IPreviewDiff)
class PreviewDiff(Storm):
"""See `IPreviewDiff`."""
- implements(IPreviewDiff)
delegates(IDiff, context='diff')
__storm_table__ = 'PreviewDiff'
=== modified file 'lib/lp/code/model/gitcollection.py'
--- lib/lp/code/model/gitcollection.py 2015-05-12 17:16:56 +0000
+++ lib/lp/code/model/gitcollection.py 2015-07-08 16:13:45 +0000
@@ -29,7 +29,7 @@
from storm.info import ClassAlias
from storm.store import EmptyResultSet
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from lp.app.enums import PRIVATE_INFORMATION_TYPES
from lp.code.interfaces.codehosting import LAUNCHPAD_SERVICES
@@ -61,11 +61,10 @@
from lp.services.propertycache import get_property_cache
+@implementer(IGitCollection)
class GenericGitCollection:
"""See `IGitCollection`."""
- implements(IGitCollection)
-
def __init__(self, store=None, filter_expressions=None, tables=None,
asymmetric_filter_expressions=None, asymmetric_tables=None):
"""Construct a `GenericGitCollection`.
=== modified file 'lib/lp/code/model/githosting.py'
--- lib/lp/code/model/githosting.py 2015-06-15 16:40:13 +0000
+++ lib/lp/code/model/githosting.py 2015-07-08 16:13:45 +0000
@@ -12,7 +12,7 @@
from urlparse import urljoin
import requests
-from zope.interface import implements
+from zope.interface import implementer
from lp.code.errors import (
GitRepositoryCreationFault,
@@ -27,11 +27,10 @@
pass
+@implementer(IGitHostingClient)
class GitHostingClient:
"""A client for the internal API provided by the Git hosting system."""
- implements(IGitHostingClient)
-
def __init__(self):
self.endpoint = config.codehosting.internal_git_api_endpoint
=== modified file 'lib/lp/code/model/gitjob.py'
--- lib/lp/code/model/gitjob.py 2015-06-13 01:45:19 +0000
+++ lib/lp/code/model/gitjob.py 2015-07-08 16:13:45 +0000
@@ -25,8 +25,8 @@
)
from zope.component import getUtility
from zope.interface import (
- classProvides,
- implements,
+ implementer,
+ provider,
)
from zope.security.proxy import removeSecurityProxy
@@ -77,13 +77,12 @@
""")
+@implementer(IGitJob)
class GitJob(StormBase):
"""See `IGitJob`."""
__storm_table__ = 'GitJob'
- implements(IGitJob)
-
job_id = Int(name='job', primary=True, allow_none=False)
job = Reference(job_id, 'Job.id')
@@ -178,12 +177,10 @@
return [format_address_for_person(self.requester)]
+@implementer(IGitRefScanJob)
+@provider(IGitRefScanJobSource)
class GitRefScanJob(GitJobDerived):
"""A Job that scans a Git repository for its current list of references."""
-
- implements(IGitRefScanJob)
-
- classProvides(IGitRefScanJobSource)
class_job_type = GitJobType.REF_SCAN
max_retries = 5
@@ -225,13 +222,11 @@
self._cached_repository_name)
+@implementer(IReclaimGitRepositorySpaceJob)
+@provider(IReclaimGitRepositorySpaceJobSource)
class ReclaimGitRepositorySpaceJob(GitJobDerived):
"""A Job that deletes a repository from storage after it has been
deleted from the database."""
-
- implements(IReclaimGitRepositorySpaceJob)
-
- classProvides(IReclaimGitRepositorySpaceJobSource)
class_job_type = GitJobType.RECLAIM_REPOSITORY_SPACE
config = config.IReclaimGitRepositorySpaceJobSource
=== modified file 'lib/lp/code/model/gitlookup.py'
--- lib/lp/code/model/gitlookup.py 2015-03-30 14:47:22 +0000
+++ lib/lp/code/model/gitlookup.py 2015-07-08 16:13:45 +0000
@@ -17,7 +17,7 @@
getUtility,
queryMultiAdapter,
)
-from zope.interface import implements
+from zope.interface import implementer
from lp.app.errors import NameLookupFailed
from lp.app.validators.name import valid_name
@@ -65,6 +65,7 @@
return None
+@implementer(IGitTraversable)
class RootGitTraversable:
"""Root traversable for Git repository objects.
@@ -72,8 +73,6 @@
project or a distribution, optionally with a person context as well.
"""
- implements(IGitTraversable)
-
# Marker for references to Git URL layouts: ##GITNAMESPACE##
def traverse(self, owner, name, segments):
"""See `IGitTraversable`.
@@ -130,6 +129,7 @@
return owner, self.context, repository
+@implementer(IGitTraversable)
class ProjectGitTraversable(_BaseGitTraversable):
"""Git repository traversable for projects.
@@ -137,12 +137,12 @@
"""
adapts(IProduct)
- implements(IGitTraversable)
def getNamespace(self, owner):
return getUtility(IGitNamespaceSet).get(owner, project=self.context)
+@implementer(IGitTraversable)
class DistributionGitTraversable(_BaseGitTraversable):
"""Git repository traversable for distributions.
@@ -150,7 +150,6 @@
"""
adapts(IDistribution)
- implements(IGitTraversable)
# Marker for references to Git URL layouts: ##GITNAMESPACE##
def traverse(self, owner, name, segments):
@@ -176,6 +175,7 @@
return owner, distro_source_package, None
+@implementer(IGitTraversable)
class DistributionSourcePackageGitTraversable(_BaseGitTraversable):
"""Git repository traversable for distribution source packages.
@@ -183,7 +183,6 @@
"""
adapts(IDistributionSourcePackage)
- implements(IGitTraversable)
def getNamespace(self, owner):
return getUtility(IGitNamespaceSet).get(
@@ -191,6 +190,7 @@
sourcepackagename=self.context.sourcepackagename)
+@implementer(IGitTraversable)
class PersonGitTraversable(_BaseGitTraversable):
"""Git repository traversable for people.
@@ -199,7 +199,6 @@
"""
adapts(IPerson)
- implements(IGitTraversable)
def getNamespace(self, owner):
return getUtility(IGitNamespaceSet).get(owner)
@@ -247,11 +246,10 @@
return segment
+@implementer(IGitTraverser)
class GitTraverser:
"""Utility for traversing to objects that can have Git repositories."""
- implements(IGitTraverser)
-
def traverse(self, segments, owner=None):
"""See `IGitTraverser`."""
repository = None
@@ -293,11 +291,10 @@
return owner, target, repository
+@implementer(IGitLookup)
class GitLookup:
"""Utility for looking up Git repositories."""
- implements(IGitLookup)
-
def get(self, repository_id, default=None):
"""See `IGitLookup`."""
repository = IStore(GitRepository).get(GitRepository, repository_id)
=== modified file 'lib/lp/code/model/gitnamespace.py'
--- lib/lp/code/model/gitnamespace.py 2015-06-03 21:04:13 +0000
+++ lib/lp/code/model/gitnamespace.py 2015-07-08 16:13:45 +0000
@@ -15,7 +15,7 @@
from storm.locals import And
from zope.component import getUtility
from zope.event import notify
-from zope.interface import implements
+from zope.interface import implementer
from zope.security.proxy import (
isinstance as zope_isinstance,
removeSecurityProxy,
@@ -228,14 +228,13 @@
return not self == other
+@implementer(IGitNamespace, IGitNamespacePolicy)
class PersonalGitNamespace(_BaseGitNamespace):
"""A namespace for personal repositories.
Repositories in this namespace have names like "~foo/+git/bar".
"""
- implements(IGitNamespace, IGitNamespacePolicy)
-
has_defaults = False
allow_push_to_set_default = False
supports_merge_proposals = False
@@ -305,6 +304,7 @@
return None
+@implementer(IGitNamespace, IGitNamespacePolicy)
class ProjectGitNamespace(_BaseGitNamespace):
"""A namespace for project repositories.
@@ -312,8 +312,6 @@
in a particular project.
"""
- implements(IGitNamespace, IGitNamespacePolicy)
-
has_defaults = True
allow_push_to_set_default = True
supports_merge_proposals = True
@@ -390,6 +388,7 @@
action_name, product=self.project, datecreated=date_created)
+@implementer(IGitNamespace, IGitNamespacePolicy)
class PackageGitNamespace(_BaseGitNamespace):
"""A namespace for distribution source package repositories.
@@ -397,8 +396,6 @@
in a particular source package in a particular distribution.
"""
- implements(IGitNamespace, IGitNamespacePolicy)
-
has_defaults = True
allow_push_to_set_default = False
supports_merge_proposals = True
@@ -475,11 +472,10 @@
self_dsp.sourcepackagename == other_dsp.sourcepackagename)
+@implementer(IGitNamespaceSet)
class GitNamespaceSet:
"""Only implementation of `IGitNamespaceSet`."""
- implements(IGitNamespaceSet)
-
def get(self, person, project=None, distribution=None,
sourcepackagename=None):
"""See `IGitNamespaceSet`."""
=== modified file 'lib/lp/code/model/gitref.py'
--- lib/lp/code/model/gitref.py 2015-05-26 12:18:12 +0000
+++ lib/lp/code/model/gitref.py 2015-07-08 16:13:45 +0000
@@ -20,7 +20,7 @@
)
from zope.component import getUtility
from zope.event import notify
-from zope.interface import implements
+from zope.interface import implementer
from lp.app.errors import NotFoundError
from lp.code.enums import (
@@ -213,14 +213,13 @@
return self.repository.pending_writes
+@implementer(IGitRef)
class GitRef(StormBase, GitRefMixin):
"""See `IGitRef`."""
__storm_table__ = 'GitRef'
__storm_primary__ = ('repository_id', 'path')
- implements(IGitRef)
-
repository_id = Int(name='repository', allow_none=False)
repository = Reference(repository_id, 'GitRepository.id')
@@ -344,6 +343,7 @@
commit_message=commit_message, review_requests=review_requests)
+@implementer(IGitRef)
class GitRefFrozen(GitRefMixin):
"""A frozen Git reference.
@@ -355,8 +355,6 @@
object, but don't necessarily know that the ref still exists.
"""
- implements(IGitRef)
-
def __init__(self, repository, path, commit_sha1):
self.repository_id = repository.id
self.repository = repository
=== modified file 'lib/lp/code/model/gitrepository.py'
--- lib/lp/code/model/gitrepository.py 2015-06-25 04:42:48 +0000
+++ lib/lp/code/model/gitrepository.py 2015-07-08 16:13:45 +0000
@@ -44,7 +44,7 @@
from storm.store import Store
from zope.component import getUtility
from zope.event import notify
-from zope.interface import implements
+from zope.interface import implementer
from zope.security.interfaces import Unauthorized
from zope.security.proxy import (
ProxyFactory,
@@ -167,13 +167,12 @@
send_git_repository_modified_notifications(repository, event)
+@implementer(IGitRepository, IHasOwner, IPrivacy, IInformationType)
class GitRepository(StormBase, GitIdentityMixin):
"""See `IGitRepository`."""
__storm_table__ = 'GitRepository'
- implements(IGitRepository, IHasOwner, IPrivacy, IInformationType)
-
id = Int(primary=True)
date_created = DateTime(
@@ -1125,11 +1124,10 @@
self.affected_object.prerequisite_git_commit_sha1 = None
+@implementer(IGitRepositorySet)
class GitRepositorySet:
"""See `IGitRepositorySet`."""
- implements(IGitRepositorySet)
-
def new(self, registrant, owner, target, name, information_type=None,
date_created=DEFAULT, description=None):
"""See `IGitRepositorySet`."""
=== modified file 'lib/lp/code/model/gitsubscription.py'
--- lib/lp/code/model/gitsubscription.py 2015-04-15 18:34:25 +0000
+++ lib/lp/code/model/gitsubscription.py 2015-07-08 16:13:45 +0000
@@ -10,7 +10,7 @@
Int,
Reference,
)
-from zope.interface import implements
+from zope.interface import implementer
from lp.code.enums import (
BranchSubscriptionDiffSize,
@@ -26,13 +26,12 @@
from lp.services.database.stormbase import StormBase
+@implementer(IGitSubscription)
class GitSubscription(StormBase):
"""A relationship between a person and a Git repository."""
__storm_table__ = 'GitSubscription'
- implements(IGitSubscription)
-
id = Int(primary=True)
person_id = Int(name='person', allow_none=False, validator=validate_person)
=== modified file 'lib/lp/code/model/linkedbranch.py'
--- lib/lp/code/model/linkedbranch.py 2011-09-19 20:53:38 +0000
+++ lib/lp/code/model/linkedbranch.py 2015-07-08 16:13:45 +0000
@@ -13,7 +13,7 @@
Item,
)
from zope.component import adapts
-from zope.interface import implements
+from zope.interface import implementer
from lp.archivepublisher.debversion import Version
from lp.code.interfaces.linkedbranch import ICanHasLinkedBranch
@@ -45,11 +45,11 @@
return cmp(self.sort_order, other.sort_order)
+@implementer(ICanHasLinkedBranch)
class ProductSeriesLinkedBranch(BaseLinkedBranch):
"""Implement a linked branch for a product series."""
adapts(IProductSeries)
- implements(ICanHasLinkedBranch)
sort_order = LinkedBranchOrder.PRODUCT_SERIES
@@ -91,11 +91,11 @@
self.product_series.branch = branch
+@implementer(ICanHasLinkedBranch)
class ProductLinkedBranch(BaseLinkedBranch):
"""Implement a linked branch for a product."""
adapts(IProduct)
- implements(ICanHasLinkedBranch)
sort_order = LinkedBranchOrder.PRODUCT
@@ -129,11 +129,11 @@
branch, registrant)
+@implementer(ICanHasLinkedBranch)
class PackageLinkedBranch(BaseLinkedBranch):
"""Implement a linked branch for a source package pocket."""
adapts(ISuiteSourcePackage)
- implements(ICanHasLinkedBranch)
sort_order = LinkedBranchOrder.SUITE_SOURCE_PACKAGE
@@ -182,11 +182,11 @@
package.setBranch(pocket, branch, registrant)
+@implementer(ICanHasLinkedBranch)
class DistributionPackageLinkedBranch(BaseLinkedBranch):
"""Implement a linked branch for an `IDistributionSourcePackage`."""
adapts(IDistributionSourcePackage)
- implements(ICanHasLinkedBranch)
sort_order = LinkedBranchOrder.DISTRIBUTION_SOURCE_PACKAGE
=== modified file 'lib/lp/code/model/recipebuilder.py'
--- lib/lp/code/model/recipebuilder.py 2015-05-14 08:50:41 +0000
+++ lib/lp/code/model/recipebuilder.py 2015-07-08 16:13:45 +0000
@@ -11,7 +11,7 @@
import traceback
from zope.component import adapts
-from zope.interface import implements
+from zope.interface import implementer
from zope.security.proxy import removeSecurityProxy
from lp.buildmaster.interfaces.builder import CannotBuild
@@ -31,11 +31,11 @@
)
+@implementer(IBuildFarmJobBehaviour)
class RecipeBuildBehaviour(BuildFarmJobBehaviourBase):
"""How to build a recipe on the build farm."""
adapts(ISourcePackageRecipeBuild)
- implements(IBuildFarmJobBehaviour)
# The list of build status values for which email notifications are
# allowed to be sent. It is up to each callback as to whether it will
=== modified file 'lib/lp/code/model/revision.py'
--- lib/lp/code/model/revision.py 2015-03-13 19:05:50 +0000
+++ lib/lp/code/model/revision.py 2015-07-08 16:13:45 +0000
@@ -42,7 +42,7 @@
)
from storm.store import Store
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from zope.security.proxy import removeSecurityProxy
from lp.app.enums import PUBLIC_INFORMATION_TYPES
@@ -78,11 +78,10 @@
)
+@implementer(IRevision)
class Revision(SQLBase):
"""See IRevision."""
- implements(IRevision)
-
date_created = UtcDateTimeCol(notNull=True, default=DEFAULT)
log_body = StringCol(notNull=True)
gpgkey = ForeignKey(dbName='gpgkey', foreignKey='GPGKey', default=None)
@@ -180,8 +179,8 @@
return result_set.first()
+@implementer(IRevisionAuthor)
class RevisionAuthor(SQLBase):
- implements(IRevisionAuthor)
_table = 'RevisionAuthor'
@@ -218,11 +217,10 @@
return False
+@implementer(IRevisionParent)
class RevisionParent(SQLBase):
"""The association between a revision and its parent."""
- implements(IRevisionParent)
-
_table = 'RevisionParent'
revision = ForeignKey(
@@ -232,11 +230,10 @@
parent_id = StringCol(notNull=True)
+@implementer(IRevisionProperty)
class RevisionProperty(SQLBase):
"""A property on a revision. See IRevisionProperty."""
- implements(IRevisionProperty)
-
_table = 'RevisionProperty'
revision = ForeignKey(
@@ -245,10 +242,9 @@
value = StringCol(notNull=True)
+@implementer(IRevisionSet)
class RevisionSet:
- implements(IRevisionSet)
-
def getByRevisionId(self, revision_id):
return Revision.selectOneBy(revision_id=revision_id)
=== modified file 'lib/lp/code/model/revisioncache.py'
--- lib/lp/code/model/revisioncache.py 2015-01-29 16:28:30 +0000
+++ lib/lp/code/model/revisioncache.py 2015-07-08 16:13:45 +0000
@@ -19,7 +19,7 @@
Func,
SQL,
)
-from zope.interface import implements
+from zope.interface import implementer
from lp.code.interfaces.revisioncache import IRevisionCollection
from lp.code.model.revision import (
@@ -33,11 +33,10 @@
from lp.services.database.interfaces import IStore
+@implementer(IRevisionCollection)
class GenericRevisionCollection:
"""See `IRevisionCollection`."""
- implements(IRevisionCollection)
-
def __init__(self, store=None, filter_expressions=None):
self._store = store
if filter_expressions is None:
=== modified file 'lib/lp/code/model/seriessourcepackagebranch.py'
--- lib/lp/code/model/seriessourcepackagebranch.py 2013-06-20 05:50:00 +0000
+++ lib/lp/code/model/seriessourcepackagebranch.py 2015-07-08 16:13:45 +0000
@@ -18,7 +18,7 @@
Reference,
Storm,
)
-from zope.interface import implements
+from zope.interface import implementer
from lp.code.interfaces.seriessourcepackagebranch import (
IFindOfficialBranchLinks,
@@ -32,11 +32,11 @@
)
+@implementer(ISeriesSourcePackageBranch)
class SeriesSourcePackageBranch(Storm):
"""See `ISeriesSourcePackageBranch`."""
__storm_table__ = 'SeriesSourcePackageBranch'
- implements(ISeriesSourcePackageBranch)
id = Int(primary=True)
distroseriesID = Int('distroseries')
@@ -75,11 +75,10 @@
return self.sourcepackage.getSuiteSourcePackage(self.pocket)
+@implementer(IFindOfficialBranchLinks)
class SeriesSourcePackageBranchSet:
"""See `ISeriesSourcePackageBranchSet`."""
- implements(IFindOfficialBranchLinks)
-
@staticmethod
def new(distroseries, pocket, sourcepackagename, branch, registrant,
date_created=None):
=== modified file 'lib/lp/code/model/sourcepackagerecipe.py'
--- lib/lp/code/model/sourcepackagerecipe.py 2015-04-30 01:45:30 +0000
+++ lib/lp/code/model/sourcepackagerecipe.py 2015-07-08 16:13:45 +0000
@@ -32,8 +32,8 @@
)
from zope.component import getUtility
from zope.interface import (
- classProvides,
- implements,
+ implementer,
+ provider,
)
from lp.buildmaster.enums import BuildStatus
@@ -99,6 +99,8 @@
distroseries = Reference(distroseries_id, 'DistroSeries.id')
+@implementer(ISourcePackageRecipe)
+@provider(ISourcePackageRecipeSource)
class SourcePackageRecipe(Storm):
"""See `ISourcePackageRecipe` and `ISourcePackageRecipeSource`."""
@@ -107,10 +109,7 @@
def __str__(self):
return '%s/%s' % (self.owner.name, self.name)
- implements(ISourcePackageRecipe)
-
- classProvides(ISourcePackageRecipeSource)
-
+
delegates(ISourcePackageRecipeData, context='_recipe_data')
id = Int(primary=True)
=== modified file 'lib/lp/code/model/sourcepackagerecipebuild.py'
--- lib/lp/code/model/sourcepackagerecipebuild.py 2015-05-14 08:50:41 +0000
+++ lib/lp/code/model/sourcepackagerecipebuild.py 2015-07-08 16:13:45 +0000
@@ -27,8 +27,8 @@
)
from zope.component import getUtility
from zope.interface import (
- classProvides,
- implements,
+ implementer,
+ provider,
)
from lp.app.errors import NotFoundError
@@ -71,14 +71,13 @@
from lp.soyuz.model.sourcepackagerelease import SourcePackageRelease
+@implementer(ISourcePackageRecipeBuild)
+@provider(ISourcePackageRecipeBuildSource)
class SourcePackageRecipeBuild(SpecificBuildFarmJobSourceMixin,
PackageBuildMixin, Storm):
__storm_table__ = 'SourcePackageRecipeBuild'
- implements(ISourcePackageRecipeBuild)
- classProvides(ISourcePackageRecipeBuildSource)
-
job_type = BuildFarmJobType.RECIPEBRANCHBUILD
id = Int(primary=True)
=== modified file 'lib/lp/code/model/tests/test_branchmergeproposal.py'
--- lib/lp/code/model/tests/test_branchmergeproposal.py 2015-06-12 02:29:10 +0000
+++ lib/lp/code/model/tests/test_branchmergeproposal.py 2015-07-08 16:13:45 +0000
@@ -1749,7 +1749,7 @@
"--- sample\t2009-01-15 23:44:22 +0000\n"
"+++ sample\t2009-01-29 04:10:57 +0000\n"
"@@ -19,7 +19,7 @@\n"
- " from zope.interface import implements\n"
+ " from zope.interface import implementer\n"
"\n"
" from storm.expr import Desc, Join, LeftJoin\n"
"-from storm.references import Reference\n"
=== modified file 'lib/lp/code/model/tests/test_diff.py'
--- lib/lp/code/model/tests/test_diff.py 2015-06-12 16:21:05 +0000
+++ lib/lp/code/model/tests/test_diff.py 2015-07-08 16:13:45 +0000
@@ -17,7 +17,7 @@
RemoveLine,
)
import transaction
-from zope.interface import implements
+from zope.interface import implementer
from zope.security.proxy import removeSecurityProxy
from lp.app.errors import NotFoundError
@@ -91,9 +91,10 @@
return bmp, source_rev_id, target_rev_id
+@implementer(IGitHostingClient)
class FakeGitHostingClient:
- implements(IGitHostingClient)
+ pass
class DiffTestCase(TestCaseWithFactory):
=== modified file 'lib/lp/code/model/tests/test_gitjob.py'
--- lib/lp/code/model/tests/test_gitjob.py 2015-06-15 10:01:55 +0000
+++ lib/lp/code/model/tests/test_gitjob.py 2015-07-08 16:13:45 +0000
@@ -16,7 +16,7 @@
MatchesSetwise,
MatchesStructure,
)
-from zope.interface import implements
+from zope.interface import implementer
from zope.security.proxy import removeSecurityProxy
from lp.code.enums import GitObjectType
@@ -48,10 +48,9 @@
)
+@implementer(IGitHostingClient)
class FakeGitHostingClient:
- implements(IGitHostingClient)
-
def __init__(self, refs, commits, default_branch=u"refs/heads/master"):
self._refs = refs
self._commits = commits
=== modified file 'lib/lp/code/publisher.py'
--- lib/lp/code/publisher.py 2014-11-23 21:37:40 +0000
+++ lib/lp/code/publisher.py 2015-07-08 16:13:45 +0000
@@ -13,7 +13,7 @@
]
-from zope.interface import implements
+from zope.interface import implementer
from zope.publisher.interfaces.browser import (
IBrowserRequest,
IDefaultBrowserLayer,
@@ -31,8 +31,8 @@
)
+@implementer(IFacet)
class BranchesFacet:
- implements(IFacet)
name = "branches"
rootsite = "code"
@@ -44,9 +44,9 @@
"""The Code layer."""
+@implementer(CodeLayer)
class CodeBrowserRequest(LaunchpadBrowserRequest):
"""Instances of CodeBrowserRequest provide `CodeLayer`."""
- implements(CodeLayer)
def code_request_publication_factory():
=== modified file 'lib/lp/code/vocabularies/branch.py'
--- lib/lp/code/vocabularies/branch.py 2013-02-12 22:30:49 +0000
+++ lib/lp/code/vocabularies/branch.py 2015-07-08 16:13:45 +0000
@@ -12,7 +12,7 @@
]
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from zope.schema.vocabulary import SimpleTerm
from lp.code.enums import BranchType
@@ -30,11 +30,10 @@
)
+@implementer(IHugeVocabulary)
class BranchVocabulary(SQLObjectVocabularyBase):
"""A vocabulary for searching branches."""
- implements(IHugeVocabulary)
-
_table = Branch
_orderBy = ['name', 'id']
displayname = 'Select a branch'
=== modified file 'lib/lp/code/vocabularies/gitrepository.py'
--- lib/lp/code/vocabularies/gitrepository.py 2015-06-24 21:14:20 +0000
+++ lib/lp/code/vocabularies/gitrepository.py 2015-07-08 16:13:45 +0000
@@ -11,7 +11,7 @@
]
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from zope.schema.vocabulary import SimpleTerm
from lp.code.interfaces.gitcollection import IAllGitRepositories
@@ -25,11 +25,10 @@
)
+@implementer(IHugeVocabulary)
class GitRepositoryVocabulary(StormVocabularyBase):
"""A vocabulary for searching Git repositories."""
- implements(IHugeVocabulary)
-
_table = GitRepository
_order_by = ['name', 'id']
displayname = 'Select a Git repository'
=== modified file 'lib/lp/code/vocabularies/sourcepackagerecipe.py'
--- lib/lp/code/vocabularies/sourcepackagerecipe.py 2014-06-30 13:51:15 +0000
+++ lib/lp/code/vocabularies/sourcepackagerecipe.py 2015-07-08 16:13:45 +0000
@@ -10,7 +10,7 @@
]
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from zope.schema.vocabulary import SimpleTerm
from lp.app.interfaces.launchpad import ILaunchpadCelebrities
@@ -26,8 +26,8 @@
from lp.soyuz.interfaces.archive import IArchiveSet
+@implementer(IHugeVocabulary)
class BuildableDistroSeries(SQLObjectVocabularyBase):
- implements(IHugeVocabulary)
_table = DistroSeries
=== modified file 'lib/lp/code/xmlrpc/branch.py'
--- lib/lp/code/xmlrpc/branch.py 2013-01-07 02:40:55 +0000
+++ lib/lp/code/xmlrpc/branch.py 2015-07-08 16:13:45 +0000
@@ -17,7 +17,7 @@
from bzrlib import urlutils
from zope.component import getUtility
from zope.interface import (
- implements,
+ implementer,
Interface,
)
@@ -82,10 +82,9 @@
"""Link the branch to the bug."""
+@implementer(IBranchSetAPI)
class BranchSetAPI(LaunchpadXMLRPCView):
- implements(IBranchSetAPI)
-
def register_branch(self, branch_url, branch_name, branch_title,
branch_description, author_email, product_name,
owner_name=''):
@@ -197,11 +196,10 @@
self.branch_type = None
+@implementer(IPublicCodehostingAPI)
class PublicCodehostingAPI(LaunchpadXMLRPCView):
"""See `IPublicCodehostingAPI`."""
- implements(IPublicCodehostingAPI)
-
def _compose_http_url(unique_name, path, suffix):
return compose_public_url('http', unique_name, suffix)
=== modified file 'lib/lp/code/xmlrpc/codehosting.py'
--- lib/lp/code/xmlrpc/codehosting.py 2015-07-06 14:15:39 +0000
+++ lib/lp/code/xmlrpc/codehosting.py 2015-07-08 16:13:45 +0000
@@ -20,7 +20,7 @@
import pytz
import transaction
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from zope.security.interfaces import Unauthorized
from zope.security.management import endInteraction
from zope.security.proxy import removeSecurityProxy
@@ -128,11 +128,10 @@
endInteraction()
+@implementer(ICodehostingAPI)
class CodehostingAPI(LaunchpadXMLRPCView):
"""See `ICodehostingAPI`."""
- implements(ICodehostingAPI)
-
def acquireBranchToPull(self, branch_type_names):
"""See `ICodehostingAPI`."""
branch_types = []
=== modified file 'lib/lp/code/xmlrpc/codeimportscheduler.py'
--- lib/lp/code/xmlrpc/codeimportscheduler.py 2012-01-01 02:58:52 +0000
+++ lib/lp/code/xmlrpc/codeimportscheduler.py 2015-07-08 16:13:45 +0000
@@ -9,7 +9,7 @@
]
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from zope.security.proxy import removeSecurityProxy
from lp.code.enums import CodeImportResultStatus
@@ -28,11 +28,10 @@
from lp.xmlrpc.helpers import return_fault
+@implementer(ICodeImportScheduler)
class CodeImportSchedulerAPI(LaunchpadXMLRPCView):
"""See `ICodeImportScheduler`."""
- implements(ICodeImportScheduler)
-
def getJobForMachine(self, hostname, worker_limit):
"""See `ICodeImportScheduler`."""
job = getUtility(ICodeImportJobSet).getJobForMachine(
=== modified file 'lib/lp/code/xmlrpc/git.py'
--- lib/lp/code/xmlrpc/git.py 2015-06-12 16:21:05 +0000
+++ lib/lp/code/xmlrpc/git.py 2015-07-08 16:13:45 +0000
@@ -14,7 +14,7 @@
import transaction
from zope.component import getUtility
from zope.error.interfaces import IErrorReportingUtility
-from zope.interface import implements
+from zope.interface import implementer
from zope.security.interfaces import Unauthorized
from zope.security.proxy import removeSecurityProxy
@@ -59,11 +59,10 @@
from lp.xmlrpc.helpers import return_fault
+@implementer(IGitAPI)
class GitAPI(LaunchpadXMLRPCView):
"""See `IGitAPI`."""
- implements(IGitAPI)
-
def __init__(self, *args, **kwargs):
super(GitAPI, self).__init__(*args, **kwargs)
self.repository_set = getUtility(IGitRepositorySet)
=== modified file 'lib/lp/code/xmlrpc/tests/test_git.py'
--- lib/lp/code/xmlrpc/tests/test_git.py 2015-06-12 16:21:05 +0000
+++ lib/lp/code/xmlrpc/tests/test_git.py 2015-07-08 16:13:45 +0000
@@ -6,7 +6,7 @@
__metaclass__ = type
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from zope.security.proxy import removeSecurityProxy
from lp.app.enums import InformationType
@@ -40,11 +40,10 @@
from lp.xmlrpc import faults
+@implementer(IGitHostingClient)
class FakeGitHostingClient:
"""A GitHostingClient lookalike that just logs calls."""
- implements(IGitHostingClient)
-
def __init__(self):
self.calls = []
@@ -52,11 +51,10 @@
self.calls.append(("create", path, clone_from))
+@implementer(IGitHostingClient)
class BrokenGitHostingClient:
"""A GitHostingClient lookalike that pretends the remote end is down."""
- implements(IGitHostingClient)
-
def create(self, path, clone_from=None):
raise GitRepositoryCreationFault("nothing here")
=== modified file 'lib/lp/codehosting/scanner/events.py'
--- lib/lp/codehosting/scanner/events.py 2012-02-21 20:10:43 +0000
+++ lib/lp/codehosting/scanner/events.py 2015-07-08 16:13:45 +0000
@@ -12,10 +12,10 @@
from zope.component.interfaces import (
- implements,
IObjectEvent,
ObjectEvent,
)
+from zope.interface import implementer
class ScannerEvent(ObjectEvent):
@@ -36,11 +36,10 @@
"""A new revision has been found in the branch."""
+@implementer(INewMainlineRevisions)
class NewMainlineRevisions(ScannerEvent):
"""A new revision has been found in the branch."""
- implements(INewMainlineRevisions)
-
def __init__(self, db_branch, bzr_branch, bzr_revisions):
"""Construct a `NewRevisions` event.
@@ -59,9 +58,9 @@
"""The tip of the branch has changed."""
+@implementer(ITipChanged)
class TipChanged(ScannerEvent):
"""The tip of the branch has changed."""
- implements(ITipChanged)
def __init__(self, db_branch, bzr_branch, initial_scan):
"""Construct a `TipChanged` event.
@@ -88,11 +87,10 @@
"""Revisions have been removed from the branch."""
+@implementer(IRevisionsRemoved)
class RevisionsRemoved(ScannerEvent):
"""Revisions have been removed from the branch."""
- implements(IRevisionsRemoved)
-
def __init__(self, db_branch, bzr_branch, removed_history):
"""Construct a `RevisionsRemoved` event.
@@ -109,11 +107,10 @@
"""The scan has been completed and the database is up-to-date."""
+@implementer(IScanCompleted)
class ScanCompleted(ScannerEvent):
"""The scan has been completed and the database is up-to-date."""
- implements(IScanCompleted)
-
def __init__(self, db_branch, bzr_branch, logger, new_ancestry):
"""Construct a `ScanCompleted` event.
=== modified file 'lib/lp/codehosting/sftp.py'
--- lib/lp/codehosting/sftp.py 2015-01-06 12:47:59 +0000
+++ lib/lp/codehosting/sftp.py 2015-07-08 16:13:45 +0000
@@ -39,7 +39,7 @@
from twisted.conch.ssh import filetransfer
from twisted.internet import defer
from twisted.python import util
-from zope.interface import implements
+from zope.interface import implementer
from lp.codehosting.vfs import (
AsyncLaunchpadTransport,
@@ -119,14 +119,13 @@
pass
+@implementer(ISFTPFile)
class TransportSFTPFile:
"""An implementation of `ISFTPFile` that backs onto a Bazaar transport.
The transport must be a Twisted Transport.
"""
- implements(ISFTPFile)
-
def __init__(self, transport, name, flags, server):
self._unescaped_relpath = name
self._escaped_path = urlutils.escape(self._unescaped_relpath)
@@ -251,14 +250,13 @@
return TransportSFTPServer(transport)
+@implementer(ISFTPServer)
class TransportSFTPServer:
"""An implementation of `ISFTPServer` that backs onto a Bazaar transport.
The transport must be a Twisted Transport.
"""
- implements(ISFTPServer)
-
def __init__(self, transport):
self.transport = transport
=== modified file 'lib/lp/codehosting/sshserver/daemon.py'
--- lib/lp/codehosting/sshserver/daemon.py 2015-01-12 18:53:31 +0000
+++ lib/lp/codehosting/sshserver/daemon.py 2015-07-08 16:13:45 +0000
@@ -29,7 +29,7 @@
)
from twisted.python import components
from twisted.web.xmlrpc import Proxy
-from zope.interface import implements
+from zope.interface import implementer
from lp.codehosting import sftp
from lp.codehosting.sshserver.session import launch_smart_server
@@ -62,8 +62,8 @@
sftp.avatar_to_sftp_server, CodehostingAvatar, filetransfer.ISFTPServer)
+@implementer(IRealm)
class Realm:
- implements(IRealm)
def __init__(self, authentication_proxy, codehosting_proxy):
self.authentication_proxy = authentication_proxy
=== modified file 'lib/lp/codehosting/sshserver/session.py'
--- lib/lp/codehosting/sshserver/session.py 2015-01-06 12:47:59 +0000
+++ lib/lp/codehosting/sshserver/session.py 2015-07-08 16:13:45 +0000
@@ -23,7 +23,7 @@
)
from twisted.python import log
from zope.event import notify
-from zope.interface import implements
+from zope.interface import implementer
from lp.codehosting import get_bzr_path
from lp.services.config import config
@@ -76,6 +76,7 @@
self.proc.processEnded(exit_status)
+@implementer(interfaces.IProcessTransport)
class ForkedProcessTransport(process.BaseProcess):
"""Wrap the forked process in a ProcessTransport so we can talk to it.
@@ -83,8 +84,6 @@
reactor.
"""
- implements(interfaces.IProcessTransport)
-
# Design decisions
# [Decision #a]
# Inherit from process.BaseProcess
=== modified file 'lib/lp/codehosting/vfs/branchfs.py'
--- lib/lp/codehosting/vfs/branchfs.py 2015-05-26 12:40:44 +0000
+++ lib/lp/codehosting/vfs/branchfs.py 2015-07-08 16:13:45 +0000
@@ -83,7 +83,7 @@
)
from zope.component import getUtility
from zope.interface import (
- implements,
+ implementer,
Interface,
)
@@ -227,6 +227,7 @@
"""
+@implementer(ITransportDispatch)
class BranchTransportDispatch:
"""Turns BRANCH_TRANSPORT tuples into transports that point to branches.
@@ -236,7 +237,6 @@
This is used directly by our internal services (puller and scanner).
"""
- implements(ITransportDispatch)
def __init__(self, base_transport):
self.base_transport = base_transport
@@ -278,6 +278,7 @@
return transport, trailing_path
+@implementer(ITransportDispatch)
class TransportDispatch:
"""Make transports for hosted branch areas and virtual control dirs.
@@ -287,7 +288,6 @@
This is used for the rich codehosting VFS that we serve publically.
"""
- implements(ITransportDispatch)
def __init__(self, rw_transport):
self._rw_dispatch = BranchTransportDispatch(rw_transport)
=== modified file 'lib/lp/coop/answersbugs/model.py'
--- lib/lp/coop/answersbugs/model.py 2013-01-07 02:40:55 +0000
+++ lib/lp/coop/answersbugs/model.py 2015-07-08 16:13:45 +0000
@@ -8,17 +8,16 @@
__all__ = ['QuestionBug']
from sqlobject import ForeignKey
-from zope.interface import implements
+from zope.interface import implementer
from lp.coop.answersbugs.interfaces import IQuestionBug
from lp.services.database.sqlbase import SQLBase
+@implementer(IQuestionBug)
class QuestionBug(SQLBase):
"""A link between a question and a bug."""
- implements(IQuestionBug)
-
_table = 'QuestionBug'
question = ForeignKey(
=== modified file 'lib/lp/hardwaredb/browser/hwdb.py'
--- lib/lp/hardwaredb/browser/hwdb.py 2012-01-01 02:58:52 +0000
+++ lib/lp/hardwaredb/browser/hwdb.py 2015-07-08 16:13:45 +0000
@@ -15,7 +15,7 @@
from z3c.ptcompat import ViewPageTemplateFile
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from zope.publisher.interfaces.browser import IBrowserPublisher
from lp.app.browser.launchpadform import (
@@ -268,10 +268,9 @@
return getUtility(IHWVendorIDSet).get(id)
+@implementer(IBrowserPublisher)
class HWDBFingerprintSetView(LaunchpadView):
"""View class for lists of HWDB submissions for a system fingerprint."""
-
- implements(IBrowserPublisher)
label = page_title = "Hardware Database submissions for a fingerprint"
template = ViewPageTemplateFile(
=== modified file 'lib/lp/hardwaredb/model/hwdb.py'
--- lib/lp/hardwaredb/model/hwdb.py 2013-06-20 05:50:00 +0000
+++ lib/lp/hardwaredb/model/hwdb.py 2015-07-08 16:13:45 +0000
@@ -49,7 +49,7 @@
)
from storm.store import Store
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from lp.app.interfaces.launchpad import ILaunchpadCelebrities
from lp.app.validators.name import valid_name
@@ -122,11 +122,10 @@
UNKNOWN = 'Unknown'
+@implementer(IHWSubmission)
class HWSubmission(SQLBase):
"""See `IHWSubmission`."""
- implements(IHWSubmission)
-
_table = 'HWSubmission'
date_created = UtcDateTimeCol(notNull=True, default=UTC_NOW)
@@ -153,11 +152,10 @@
return HWSubmissionDeviceSet().getDevices(submission=self)
+@implementer(IHWSubmissionSet)
class HWSubmissionSet:
"""See `IHWSubmissionSet`."""
- implements(IHWSubmissionSet)
-
def createSubmission(self, date_created, format, private, contactable,
submission_key, emailaddress, distroarchseries,
raw_submission, filename, filesize,
@@ -554,21 +552,19 @@
in IStore(HWSubmission).execute(query)]
+@implementer(IHWSystemFingerprint)
class HWSystemFingerprint(SQLBase):
"""Identifiers of a computer system."""
- implements(IHWSystemFingerprint)
-
_table = 'HWSystemFingerprint'
fingerprint = StringCol(notNull=True)
+@implementer(IHWSystemFingerprintSet)
class HWSystemFingerprintSet:
"""A set of identifiers of a computer system."""
- implements(IHWSystemFingerprintSet)
-
def getByName(self, fingerprint):
"""See `IHWSystemFingerprintSet`."""
return HWSystemFingerprint.selectOneBy(fingerprint=fingerprint)
@@ -578,21 +574,19 @@
return HWSystemFingerprint(fingerprint=fingerprint)
+@implementer(IHWVendorName)
class HWVendorName(SQLBase):
"""See `IHWVendorName`."""
- implements(IHWVendorName)
-
_table = 'HWVendorName'
name = StringCol(notNull=True)
+@implementer(IHWVendorNameSet)
class HWVendorNameSet:
"""See `IHWVendorNameSet`."""
- implements(IHWVendorNameSet)
-
def create(self, name):
"""See `IHWVendorNameSet`."""
return HWVendorName(name=name)
@@ -684,11 +678,10 @@
return validProductID[bus].search(id) is not None
+@implementer(IHWVendorID)
class HWVendorID(SQLBase):
"""See `IHWVendorID`."""
- implements(IHWVendorID)
-
_table = 'HWVendorID'
bus = EnumCol(enum=HWBus, notNull=True)
@@ -712,11 +705,10 @@
SQLBase._create(self, id, **kw)
+@implementer(IHWVendorIDSet)
class HWVendorIDSet:
"""See `IHWVendorIDSet`."""
- implements(IHWVendorIDSet)
-
def create(self, bus, vendor_id, vendor_name):
"""See `IHWVendorIDSet`."""
vendor_name = HWVendorName.selectOneBy(name=vendor_name.name)
@@ -741,10 +733,9 @@
HWVendorID.vendor_id_for_bus)
+@implementer(IHWDevice)
class HWDevice(SQLBase):
"""See `IHWDevice.`"""
-
- implements(IHWDevice)
_table = 'HWDevice'
# XXX Abel Deuring 2008-05-02: The columns bus_vendor and
@@ -835,11 +826,10 @@
store.remove(existing_record)
+@implementer(IHWDeviceSet)
class HWDeviceSet:
"""See `IHWDeviceSet`."""
- implements(IHWDeviceSet)
-
def create(self, bus, vendor_id, product_id, product_name, variant=None):
"""See `IHWDeviceSet`."""
vendor_id_record = HWVendorID.selectOneBy(bus=bus,
@@ -901,10 +891,9 @@
HWDevice.id)
+@implementer(IHWDeviceNameVariant)
class HWDeviceNameVariant(SQLBase):
"""See `IHWDeviceNameVariant`."""
-
- implements(IHWDeviceNameVariant)
_table = 'HWDeviceNameVariant'
vendor_name = ForeignKey(dbName='vendor_name', foreignKey='HWVendorName',
@@ -914,11 +903,10 @@
submissions = IntCol(notNull=True)
+@implementer(IHWDeviceNameVariantSet)
class HWDeviceNameVariantSet:
"""See `IHWDeviceNameVariantSet`."""
- implements(IHWDeviceNameVariantSet)
-
def create(self, device, vendor_name, product_name):
"""See `IHWDeviceNameVariantSet`."""
vendor_name_record = HWVendorName.selectOneBy(name=vendor_name)
@@ -930,10 +918,9 @@
submissions=0)
+@implementer(IHWDriver)
class HWDriver(SQLBase):
"""See `IHWDriver`."""
-
- implements(IHWDriver)
_table = 'HWDriver'
# XXX: Abel Deuring 2008-12-10 bug=306265: package_name should
@@ -954,11 +941,10 @@
distroseries=distroseries, architecture=architecture, owner=owner)
+@implementer(IHWDriverSet)
class HWDriverSet:
"""See `IHWDriver`."""
- implements(IHWDriverSet)
-
def create(self, package_name, name, license):
"""See `IHWDriverSet`."""
if package_name is None:
@@ -1025,39 +1011,35 @@
return result
+@implementer(IHWDriverName)
class HWDriverName(SQLBase):
"""See `IHWDriverName`."""
-
- implements(IHWDriverName)
_table = 'HWDriverNames'
name = StringCol(notNull=True)
+@implementer(IHWDriverPackageName)
class HWDriverPackageName(SQLBase):
"""See `IHWDriverPackageName`."""
-
- implements(IHWDriverPackageName)
_table = 'HWDriverPackageNames'
package_name = StringCol(notNull=True)
+@implementer(IHWDeviceDriverLink)
class HWDeviceDriverLink(SQLBase):
"""See `IHWDeviceDriverLink`."""
-
- implements(IHWDeviceDriverLink)
_table = 'HWDeviceDriverLink'
device = ForeignKey(dbName='device', foreignKey='HWDevice', notNull=True)
driver = ForeignKey(dbName='driver', foreignKey='HWDriver', notNull=False)
+@implementer(IHWDeviceDriverLinkSet)
class HWDeviceDriverLinkSet:
"""See `IHWDeviceDriverLinkSet`."""
- implements(IHWDeviceDriverLinkSet)
-
def create(self, device, driver):
"""See `IHWDeviceDriverLinkSet`."""
return HWDeviceDriverLink(device=device, driver=driver)
@@ -1074,9 +1056,9 @@
return device_driver_link
+@implementer(IHWDeviceClass)
class HWDeviceClass(SQLBase):
"""See `IHWDeviceClass`."""
- implements(IHWDeviceClass)
device = ForeignKey(dbName='device', foreignKey='HWDevice', notNull=True)
main_class = IntCol(notNull=True)
@@ -1088,9 +1070,9 @@
store.remove(self)
+@implementer(IHWDeviceClassSet)
class HWDeviceClassSet:
"""See `IHWDeviceClassSet`."""
- implements(IHWDeviceClassSet)
def get(self, id):
"""See `IHWDeviceClassSet`."""
@@ -1098,10 +1080,9 @@
HWDeviceClass, HWDeviceClass.id == id).one()
+@implementer(IHWSubmissionDevice)
class HWSubmissionDevice(SQLBase):
"""See `IHWSubmissionDevice`."""
-
- implements(IHWSubmissionDevice)
_table = 'HWSubmissionDevice'
device_driver_link = ForeignKey(dbName='device_driver_link',
@@ -1125,11 +1106,10 @@
return self.device_driver_link.driver
+@implementer(IHWSubmissionDeviceSet)
class HWSubmissionDeviceSet:
"""See `IHWSubmissionDeviceSet`."""
- implements(IHWSubmissionDeviceSet)
-
def create(self, device_driver_link, submission, parent, hal_device_id):
"""See `IHWSubmissionDeviceSet`."""
return HWSubmissionDevice(device_driver_link=device_driver_link,
@@ -1168,10 +1148,9 @@
return result.get_one()[0]
+@implementer(IHWSubmissionBug)
class HWSubmissionBug(SQLBase):
"""See `IHWSubmissionBug`."""
-
- implements(IHWSubmissionBug)
_table = 'HWSubmissionBug'
submission = ForeignKey(dbName='submission', foreignKey='HWSubmission',
@@ -1179,11 +1158,10 @@
bug = ForeignKey(dbName='bug', foreignKey='Bug', notNull=True)
+@implementer(IHWSubmissionBugSet)
class HWSubmissionBugSet:
"""See `IHWSubmissionBugSet`."""
- implements(IHWSubmissionBugSet)
-
def create(self, submission, bug):
"""See `IHWSubmissionBugSet`."""
store = Store.of(bug)
=== modified file 'lib/lp/hardwaredb/scripts/hwdbsubmissions.py'
--- lib/lp/hardwaredb/scripts/hwdbsubmissions.py 2014-12-07 13:18:18 +0000
+++ lib/lp/hardwaredb/scripts/hwdbsubmissions.py 2015-07-08 16:13:45 +0000
@@ -29,7 +29,7 @@
import pytz
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from zope.security.proxy import removeSecurityProxy
from lp.app.interfaces.launchpad import ILaunchpadCelebrities
@@ -2975,11 +2975,10 @@
return self.udev['id']
+@implementer(ITunableLoop)
class ProcessingLoopBase(object):
"""An `ITunableLoop` for processing HWDB submissions."""
- implements(ITunableLoop)
-
def __init__(self, transaction, logger, max_submissions, record_warnings):
self.transaction = transaction
self.logger = logger
=== modified file 'lib/lp/registry/adapters.py'
--- lib/lp/registry/adapters.py 2012-10-03 18:26:52 +0000
+++ lib/lp/registry/adapters.py 2015-07-08 16:13:45 +0000
@@ -15,7 +15,7 @@
from zope.component import getUtility
from zope.component.interfaces import ComponentLookupError
-from zope.interface import implements
+from zope.interface import implementer
from lp.archivepublisher.interfaces.publisherconfig import IPublisherConfigSet
from lp.registry.interfaces.poll import (
@@ -60,9 +60,9 @@
raise ComponentLookupError
+@implementer(IPollSubset)
class PollSubset:
"""Adapt an `IPoll` to an `IPollSubset`."""
- implements(IPollSubset)
title = 'Team polls'
=== modified file 'lib/lp/registry/browser/announcement.py'
--- lib/lp/registry/browser/announcement.py 2012-10-18 22:11:45 +0000
+++ lib/lp/registry/browser/announcement.py 2015-07-08 16:13:45 +0000
@@ -18,7 +18,7 @@
]
from zope.interface import (
- implements,
+ implementer,
Interface,
)
from zope.schema import (
@@ -279,9 +279,9 @@
self.next_url = canonical_url(self.context.target) + '/+announcements'
+@implementer(IAnnouncementCreateMenu)
class HasAnnouncementsView(LaunchpadView, FeedsMixin):
"""A view class for pillars which have announcements."""
- implements(IAnnouncementCreateMenu)
page_title = 'News and announcements'
batch_size = config.launchpad.announcement_batch_size
=== modified file 'lib/lp/registry/browser/distribution.py'
--- lib/lp/registry/browser/distribution.py 2015-06-26 14:00:41 +0000
+++ lib/lp/registry/browser/distribution.py 2015-07-08 16:13:45 +0000
@@ -45,7 +45,7 @@
from zope.event import notify
from zope.formlib import form
from zope.formlib.boolwidgets import CheckBoxWidget
-from zope.interface import implements
+from zope.interface import implementer
from zope.lifecycleevent import ObjectCreatedEvent
from zope.schema import Bool
from zope.security.checker import canWrite
@@ -786,11 +786,10 @@
'create_account']
+@implementer(IRegistryCollectionNavigationMenu)
class DistributionSetView(LaunchpadView):
"""View for /distros top level collection."""
- implements(IRegistryCollectionNavigationMenu)
-
page_title = 'Distributions registered in Launchpad'
@cachedproperty
@@ -1053,13 +1052,13 @@
return "Change the %s members team" % self.context.displayname
+@implementer(IDistributionMirrorMenuMarker)
class DistributionCountryArchiveMirrorsView(LaunchpadView):
"""A text/plain page that lists the mirrors in the country of the request.
If there are no mirrors located in the country of the request, we fallback
to the main Ubuntu repositories.
"""
- implements(IDistributionMirrorMenuMarker)
def render(self):
request = self.request
@@ -1088,9 +1087,8 @@
return body.encode('utf-8')
+@implementer(IDistributionMirrorMenuMarker)
class DistributionMirrorsView(LaunchpadView):
-
- implements(IDistributionMirrorMenuMarker)
show_freshness = True
show_mirror_type = False
description = None
=== modified file 'lib/lp/registry/browser/distributionmirror.py'
--- lib/lp/registry/browser/distributionmirror.py 2012-01-01 02:58:52 +0000
+++ lib/lp/registry/browser/distributionmirror.py 2015-07-08 16:13:45 +0000
@@ -19,7 +19,7 @@
import pytz
from zope.event import notify
-from zope.interface import implements
+from zope.interface import implementer
from zope.lifecycleevent import ObjectCreatedEvent
from lp import _
@@ -193,9 +193,8 @@
return canonical_url(self.context)
+@implementer(IDistributionMirrorMenuMarker)
class DistributionMirrorAddView(LaunchpadFormView):
-
- implements(IDistributionMirrorMenuMarker)
schema = IDistributionMirror
field_names = ["displayname", "description", "whiteboard", "http_base_url",
"ftp_base_url", "rsync_base_url", "speed", "country",
=== modified file 'lib/lp/registry/browser/distributionsourcepackage.py'
--- lib/lp/registry/browser/distributionsourcepackage.py 2015-06-11 09:02:45 +0000
+++ lib/lp/registry/browser/distributionsourcepackage.py 2015-07-08 16:13:45 +0000
@@ -23,7 +23,7 @@
from lazr.delegates import delegates
from zope.component import getUtility
from zope.interface import (
- implements,
+ implementer,
Interface,
)
@@ -99,9 +99,9 @@
return {'displayname': displayname}
+@implementer(IHeadingBreadcrumb, IMultiFacetedBreadcrumb)
class DistributionSourcePackageBreadcrumb(Breadcrumb):
"""Builds a breadcrumb for an `IDistributionSourcePackage`."""
- implements(IHeadingBreadcrumb, IMultiFacetedBreadcrumb)
@property
def text(self):
@@ -299,10 +299,10 @@
bulk_decorator=decorate)
+@implementer(IDistributionSourcePackageActionMenu)
class DistributionSourcePackageView(DistributionSourcePackageBaseView,
LaunchpadView):
"""View class for DistributionSourcePackage."""
- implements(IDistributionSourcePackageActionMenu)
def initialize(self):
super(DistributionSourcePackageView, self).initialize()
=== modified file 'lib/lp/registry/browser/distroseriesdifference.py'
--- lib/lp/registry/browser/distroseriesdifference.py 2013-04-10 08:01:20 +0000
+++ lib/lp/registry/browser/distroseriesdifference.py 2015-07-08 16:13:45 +0000
@@ -17,7 +17,7 @@
)
from zope.formlib.itemswidgets import RadioWidget
from zope.interface import (
- implements,
+ implementer,
Interface,
)
from zope.schema import Choice
@@ -109,9 +109,8 @@
)))
+@implementer(IConversation)
class DistroSeriesDifferenceView(LaunchpadFormView):
-
- implements(IConversation)
schema = IDistroSeriesDifferenceForm
custom_widget('blacklist_options', RadioWidget)
@@ -248,9 +247,9 @@
"""Marker interface."""
+@implementer(IDistroSeriesDifferenceDisplayComment)
class DistroSeriesDifferenceDisplayComment(MessageComment):
"""Used simply to provide `IComment` for rendering."""
- implements(IDistroSeriesDifferenceDisplayComment)
index = None
@@ -267,10 +266,10 @@
return comment.comment.message
+@implementer(Interface)
class CommentXHTMLRepresentation(LaunchpadView):
"""Render individual comments when requested via the API."""
adapts(IDistroSeriesDifferenceComment, IWebServiceClientRequest)
- implements(Interface)
template = ViewPageTemplateFile(
'../templates/distroseriesdifferencecomment-fragment.pt')
=== modified file 'lib/lp/registry/browser/milestone.py'
--- lib/lp/registry/browser/milestone.py 2014-11-29 01:33:59 +0000
+++ lib/lp/registry/browser/milestone.py 2015-07-08 16:13:45 +0000
@@ -28,7 +28,7 @@
from zope.component import getUtility
from zope.formlib import form
from zope.interface import (
- implements,
+ implementer,
Interface,
)
from zope.schema import (
@@ -352,11 +352,11 @@
return len(self.bugtasks) > 0 or len(self.specifications) > 0
+@implementer(IMilestoneInline)
class MilestoneView(
LaunchpadView, MilestoneViewMixin, ProductDownloadFileMixin,
InformationTypePortletMixin):
"""A View for listing milestones and releases."""
- implements(IMilestoneInline)
show_series_context = False
def __init__(self, context, request):
=== modified file 'lib/lp/registry/browser/nameblacklist.py'
--- lib/lp/registry/browser/nameblacklist.py 2013-04-10 08:09:05 +0000
+++ lib/lp/registry/browser/nameblacklist.py 2015-07-08 16:13:45 +0000
@@ -17,7 +17,7 @@
getUtility,
)
from zope.formlib.widgets import TextWidget
-from zope.interface import implements
+from zope.interface import implementer
from lp.app.browser.launchpadform import (
action,
@@ -157,9 +157,8 @@
@adapter(INameBlacklistSet)
+@implementer(IBreadcrumb)
class NameBlacklistSetBreadcrumb(Breadcrumb):
"""Return a breadcrumb for an `INameBlackListSet`."""
- implements(IBreadcrumb)
-
text = "Name Blacklist"
=== modified file 'lib/lp/registry/browser/person.py'
--- lib/lp/registry/browser/person.py 2015-06-12 08:03:06 +0000
+++ lib/lp/registry/browser/person.py 2015-07-08 16:13:45 +0000
@@ -89,8 +89,7 @@
TextWidget,
)
from zope.interface import (
- classImplements,
- implements,
+ implementer,
Interface,
)
from zope.interface.exceptions import Invalid
@@ -284,8 +283,9 @@
from lp.soyuz.interfaces.sourcepackagerelease import ISourcePackageRelease
+@implementer(IHeadingBreadcrumb, IMultiFacetedBreadcrumb)
class PersonBreadcrumb(DisplaynameBreadcrumb):
- implements(IHeadingBreadcrumb, IMultiFacetedBreadcrumb)
+ pass
class RestrictedMembershipsPersonView(LaunchpadView):
@@ -981,11 +981,10 @@
'request_merge', 'admin_merge_people', 'admin_merge_teams']
+@implementer(IRegistryCollectionNavigationMenu)
class PeopleSearchView(LaunchpadView):
"""Search for people and teams on the /people page."""
- implements(IRegistryCollectionNavigationMenu)
-
page_title = 'People and teams in Launchpad'
def __init__(self, context, request):
@@ -2409,10 +2408,9 @@
jabberset.new(self.context, jabberid)
+@implementer(IPersonEditMenu)
class PersonEditSSHKeysView(LaunchpadView):
- implements(IPersonEditMenu)
-
info_message = None
error_message = None
@@ -2478,6 +2476,7 @@
self.info_message = structured('Key "%s" removed', comment)
+@implementer(IPersonEditMenu)
class PersonGPGView(LaunchpadView):
"""View for the GPG-related actions for a Person
@@ -2486,8 +2485,6 @@
the case you want to give up on importing the key).
"""
- implements(IPersonEditMenu)
-
key = None
fingerprint = None
@@ -2698,6 +2695,7 @@
cancel_url = next_url
+@implementer(IPersonEditMenu)
class PersonEditView(PersonRenameFormMixin, BasePersonEditView):
"""The Person 'Edit' page."""
@@ -2706,8 +2704,6 @@
'selfgenerated_bugnotifications']
custom_widget('mugshot', ImageChangeWidget, ImageChangeWidget.EDIT_STYLE)
- implements(IPersonEditMenu)
-
label = 'Change your personal details'
page_title = label
@@ -2765,6 +2761,7 @@
schema = IPerson
+@implementer(IPersonEditMenu)
class PersonEditEmailsView(LaunchpadFormView):
"""A view for editing a person's email settings.
@@ -2773,8 +2770,6 @@
emails.
"""
- implements(IPersonEditMenu)
-
schema = IEmailAddress
custom_widget('VALIDATED_SELECTED', LaunchpadRadioWidget,
@@ -3100,11 +3095,10 @@
self.next_url = self.action_url
+@implementer(IPersonEditMenu)
class PersonEditMailingListsView(LaunchpadFormView):
"""A view for editing a person's mailing list subscriptions."""
- implements(IPersonEditMenu)
-
schema = IEmailAddress
custom_widget('mailing_list_auto_subscribe_policy',
@@ -3564,23 +3558,21 @@
self.needs_building = needs_building
+@implementer(ISourcePackageRelease)
class SourcePackageReleaseWithStats(BaseWithStats):
"""An ISourcePackageRelease, with extra stats added."""
-
- implements(ISourcePackageRelease)
delegates(ISourcePackageRelease)
+@implementer(ISourcePackagePublishingHistory)
class SourcePackagePublishingHistoryWithStats(BaseWithStats):
"""An ISourcePackagePublishingHistory, with extra stats added."""
-
- implements(ISourcePackagePublishingHistory)
delegates(ISourcePackagePublishingHistory)
+@implementer(IPersonRelatedSoftwareMenu)
class PersonRelatedSoftwareView(LaunchpadView):
"""View for +related-packages."""
- implements(IPersonRelatedSoftwareMenu)
_max_results_key = 'summary_list_size'
@property
@@ -4042,9 +4034,9 @@
raise Invalid('You must provide a subject and a message.')
+@implementer(INotificationRecipientSet)
class ContactViaWebNotificationRecipientSet:
"""A set of notification recipients and rationales from ContactViaWeb."""
- implements(INotificationRecipientSet)
# Primary reason enumerations.
TO_USER = object()
@@ -4394,6 +4386,7 @@
"""A marker interface for the +index navigation menu."""
+@implementer(IPersonIndexMenu)
class PersonIndexMenu(NavigationMenu, PersonMenuMixin):
usedfor = IPersonIndexMenu
facet = 'overview'
@@ -4401,12 +4394,9 @@
links = ('edit', 'administer', 'administer_account', 'branding')
-classImplements(PersonIndexView, IPersonIndexMenu)
-
-
+@implementer(Interface)
class PersonXHTMLRepresentation:
adapts(IPerson, IWebServiceClientRequest)
- implements(Interface)
def __init__(self, person, request):
self.person = person
=== modified file 'lib/lp/registry/browser/persondistributionsourcepackage.py'
--- lib/lp/registry/browser/persondistributionsourcepackage.py 2015-06-11 09:02:45 +0000
+++ lib/lp/registry/browser/persondistributionsourcepackage.py 2015-07-08 16:13:45 +0000
@@ -12,7 +12,7 @@
from zope.component import queryAdapter
-from zope.interface import implements
+from zope.interface import implementer
from zope.traversing.interfaces import IPathAdapter
from lp.app.errors import NotFoundError
@@ -41,9 +41,9 @@
# XXX cjwatson 2015-01-29: Do we need two breadcrumbs, one for the
# distribution and one for the source package?
+@implementer(IMultiFacetedBreadcrumb)
class PersonDistributionSourcePackageBreadcrumb(Breadcrumb):
"""Breadcrumb for an `IPersonDistributionSourcePackage`."""
- implements(IMultiFacetedBreadcrumb)
@property
def text(self):
=== modified file 'lib/lp/registry/browser/personproduct.py'
--- lib/lp/registry/browser/personproduct.py 2015-06-10 10:19:25 +0000
+++ lib/lp/registry/browser/personproduct.py 2015-07-08 16:13:45 +0000
@@ -12,7 +12,7 @@
from zope.component import queryAdapter
-from zope.interface import implements
+from zope.interface import implementer
from zope.traversing.interfaces import IPathAdapter
from lp.app.errors import NotFoundError
@@ -44,9 +44,9 @@
return branch
+@implementer(IMultiFacetedBreadcrumb)
class PersonProductBreadcrumb(Breadcrumb):
"""Breadcrumb for an `IPersonProduct`."""
- implements(IMultiFacetedBreadcrumb)
@property
def text(self):
=== modified file 'lib/lp/registry/browser/pillar.py'
--- lib/lp/registry/browser/pillar.py 2015-04-29 10:25:49 +0000
+++ lib/lp/registry/browser/pillar.py 2015-07-08 16:13:45 +0000
@@ -24,7 +24,7 @@
import simplejson
from zope.component import getUtility
from zope.interface import (
- implements,
+ implementer,
Interface,
)
from zope.schema.vocabulary import (
@@ -82,9 +82,9 @@
)
+@implementer(IHeadingBreadcrumb, IMultiFacetedBreadcrumb)
class PillarBreadcrumb(DisplaynameBreadcrumb):
"""Breadcrumb that uses the displayname or title as appropriate."""
- implements(IHeadingBreadcrumb, IMultiFacetedBreadcrumb)
@property
def detail(self):
@@ -155,9 +155,9 @@
enabled=service_uses_launchpad(self.pillar.blueprints_usage))
+@implementer(IInvolved)
class PillarInvolvementView(LaunchpadView):
"""A view for any `IPillar` implementing the IInvolved interface."""
- implements(IInvolved)
configuration_links = []
visible_disabled_link_names = []
=== modified file 'lib/lp/registry/browser/poll.py'
--- lib/lp/registry/browser/poll.py 2013-04-10 08:09:05 +0000
+++ lib/lp/registry/browser/poll.py 2015-07-08 16:13:45 +0000
@@ -23,7 +23,7 @@
from zope.event import notify
from zope.formlib.widgets import TextWidget
from zope.interface import (
- implements,
+ implementer,
Interface,
)
from zope.lifecycleevent import ObjectCreatedEvent
@@ -215,9 +215,9 @@
"""Breadcrumb for polls."""
+@implementer(IPollActionMenu)
class PollView(BasePollView):
"""A view class to display the results of a poll."""
- implements(IPollActionMenu)
def initialize(self):
super(PollView, self).initialize()
@@ -417,9 +417,8 @@
notify(ObjectCreatedEvent(poll))
+@implementer(IPollEditMenu)
class PollEditView(LaunchpadEditFormView):
-
- implements(IPollEditMenu)
schema = IPoll
label = "Edit poll details"
page_title = 'Edit'
=== modified file 'lib/lp/registry/browser/product.py'
--- lib/lp/registry/browser/product.py 2015-07-07 22:33:29 +0000
+++ lib/lp/registry/browser/product.py 2015-07-08 16:13:45 +0000
@@ -64,7 +64,7 @@
TextWidget,
)
from zope.interface import (
- implements,
+ implementer,
Interface,
)
from zope.lifecycleevent import ObjectCreatedEvent
@@ -913,11 +913,10 @@
return False
+@implementer(IProductActionMenu)
class ProductView(PillarViewMixin, HasAnnouncementsView, SortSeriesMixin,
FeedsMixin, ProductDownloadFileMixin):
- implements(IProductActionMenu)
-
@property
def maintainer_widget(self):
return InlinePersonEditPickerWidget(
@@ -1299,9 +1298,9 @@
release.version in self.milestones[series.name])
+@implementer(IProductEditMenu)
class ProductBrandingView(BrandingChangeView):
"""A view to set branding."""
- implements(IProductEditMenu)
label = "Change branding"
schema = IProduct
@@ -1318,8 +1317,8 @@
return canonical_url(self.context)
+@implementer(IProductEditMenu)
class ProductConfigureBase(ReturnToReferrerMixin, LaunchpadEditFormView):
- implements(IProductEditMenu)
schema = IProduct
usage_fieldname = None
@@ -1376,11 +1375,10 @@
usage_fieldname = 'answers_usage'
+@implementer(IProductEditMenu)
class ProductEditView(ProductLicenseMixin, LaunchpadEditFormView):
"""View class that lets you edit a Product object."""
- implements(IProductEditMenu)
-
label = "Edit details"
schema = IProduct
field_names = [
@@ -2068,11 +2066,10 @@
return Link('+all', 'Show all projects', icon='list')
+@implementer(IRegistryCollectionNavigationMenu)
class ProductSetView(LaunchpadView):
"""View for products index page."""
- implements(IRegistryCollectionNavigationMenu)
-
page_title = 'Projects registered in Launchpad'
max_results_to_display = config.launchpad.default_batch_size
@@ -2578,11 +2575,10 @@
"become the project's new maintainers."))
+@implementer(IProductEditMenu)
class ProductEditPeopleView(LaunchpadEditFormView):
"""Enable editing of important people on the project."""
- implements(IProductEditMenu)
-
label = "Change the roles of people"
schema = IProductEditPeopleSchema
field_names = [
=== modified file 'lib/lp/registry/browser/productseries.py'
--- lib/lp/registry/browser/productseries.py 2015-07-07 04:40:35 +0000
+++ lib/lp/registry/browser/productseries.py 2015-07-08 16:13:45 +0000
@@ -36,7 +36,7 @@
TextWidget,
)
from zope.interface import (
- implements,
+ implementer,
Interface,
)
from zope.schema import Choice
@@ -188,10 +188,9 @@
return self.view.context.product
+@implementer(IProductSeriesInvolved)
class ProductSeriesInvolvementView(PillarInvolvementView):
"""Encourage configuration of involvement links for project series."""
-
- implements(IProductSeriesInvolved)
has_involvement = True
def __init__(self, context, request):
=== modified file 'lib/lp/registry/browser/project.py'
--- lib/lp/registry/browser/project.py 2015-06-26 14:15:12 +0000
+++ lib/lp/registry/browser/project.py 2015-07-08 16:13:45 +0000
@@ -37,7 +37,7 @@
from zope.formlib import form
from zope.formlib.widgets import TextWidget
from zope.interface import (
- implements,
+ implementer,
Interface,
)
from zope.lifecycleevent import ObjectCreatedEvent
@@ -333,10 +333,9 @@
return Link('+filebug', text, icon='add')
+@implementer(IProjectGroupActionMenu)
class ProjectView(PillarViewMixin, HasAnnouncementsView, FeedsMixin):
- implements(IProjectGroupActionMenu)
-
@property
def maintainer_widget(self):
return InlinePersonEditPickerWidget(
@@ -380,9 +379,9 @@
return ProjectGroupMilestoneTag(self.context, [])
+@implementer(IProjectGroupEditMenu)
class ProjectEditView(LaunchpadEditFormView):
"""View class that lets you edit a Project object."""
- implements(IProjectGroupEditMenu)
label = "Change project group details"
page_title = label
schema = IProjectGroup
@@ -540,11 +539,10 @@
return Link('+all', text, icon='list')
+@implementer(IRegistryCollectionNavigationMenu)
class ProjectSetView(LaunchpadView):
"""View for project group index page."""
- implements(IRegistryCollectionNavigationMenu)
-
page_title = "Project groups registered in Launchpad"
def __init__(self, context, request):
=== modified file 'lib/lp/registry/browser/team.py'
--- lib/lp/registry/browser/team.py 2014-11-24 01:20:26 +0000
+++ lib/lp/registry/browser/team.py 2015-07-08 16:13:45 +0000
@@ -55,7 +55,7 @@
from zope.formlib.widgets import TextAreaWidget
from zope.interface import (
classImplements,
- implements,
+ implementer,
Interface,
)
from zope.publisher.interfaces.browser import IBrowserPublisher
@@ -179,11 +179,10 @@
)
+@implementer(IObjectPrivacy)
class TeamPrivacyAdapter:
"""Provides `IObjectPrivacy` for `ITeam`."""
- implements(IObjectPrivacy)
-
def __init__(self, context):
self.context = context
@@ -1248,19 +1247,18 @@
person, self.context)
+@implementer(IHeadingBreadcrumb, IMultiFacetedBreadcrumb)
class TeamBreadcrumb(Breadcrumb):
"""Builds a breadcrumb for an `ITeam`."""
- implements(IHeadingBreadcrumb, IMultiFacetedBreadcrumb)
@property
def text(self):
return smartquote('"%s" team') % self.context.displayname
+@implementer(IBrowserPublisher)
class TeamMembershipSelfRenewalView(LaunchpadFormView):
- implements(IBrowserPublisher)
-
# This is needed for our breadcrumbs, as there's no <browser:page>
# declaration for this view.
__name__ = '+self-renewal'
@@ -1354,11 +1352,10 @@
title=_("Comment"), required=False, readonly=False)
+@implementer(IBrowserPublisher)
class TeamInvitationView(LaunchpadFormView):
"""Where team admins can accept/decline membership invitations."""
- implements(IBrowserPublisher)
-
# This is needed for our breadcrumbs, as there's no <browser:page>
# declaration for this view.
__name__ = '+invitation'
=== modified file 'lib/lp/registry/browser/tests/test_sourcepackage_views.py'
--- lib/lp/registry/browser/tests/test_sourcepackage_views.py 2013-02-07 06:10:38 +0000
+++ lib/lp/registry/browser/tests/test_sourcepackage_views.py 2015-07-08 16:13:45 +0000
@@ -15,7 +15,7 @@
from testtools.matchers import Not
from testtools.testcase import ExpectedException
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from zope.security.proxy import removeSecurityProxy
from lp.app.enums import InformationType
@@ -117,16 +117,19 @@
def __init__(self, **kw):
self.__dict__.update(kw)
+ @implementer(ISourcePackage)
class FakeSourcePackage(Faker):
# Interface necessary for canonical_url() call in
# get_register_upstream_url().
- implements(ISourcePackage)
+ pass
+ @implementer(IDistroSeries)
class FakeDistroSeries(Faker):
- implements(IDistroSeries)
+ pass
+ @implementer(IDistribution)
class FakeDistribution(Faker):
- implements(IDistribution)
+ pass
releases = Faker(sample_binary_packages=[
Faker(summary='summary for foo'),
=== modified file 'lib/lp/registry/doc/hasowner-authorization.txt'
--- lib/lp/registry/doc/hasowner-authorization.txt 2012-01-15 17:43:05 +0000
+++ lib/lp/registry/doc/hasowner-authorization.txt 2015-07-08 16:13:45 +0000
@@ -4,15 +4,15 @@
itself or a Launchpad admin.
# First we define a class which only provides IHasOwner.
- >>> from zope.interface import implements
+ >>> from zope.interface import implementer
>>> from lp.registry.interfaces.person import IPersonSet
>>> from lp.registry.interfaces.role import (
... IHasOwner,
... IPersonRoles,
... )
>>> salgado = getUtility(IPersonSet).getByName('salgado')
- >>> class FooObject:
- ... implements(IHasOwner)
+ >>> @implementer(IHasOwner)
+ ... class FooObject:
... owner = salgado
Salgado is the owner of any FooObject we create, so he can edit it.
=== modified file 'lib/lp/registry/model/accesspolicy.py'
--- lib/lp/registry/model/accesspolicy.py 2015-02-16 13:01:34 +0000
+++ lib/lp/registry/model/accesspolicy.py 2015-07-08 16:13:45 +0000
@@ -32,7 +32,7 @@
from storm.references import Reference
from storm.store import EmptyResultSet
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from lp.app.enums import (
InformationType,
@@ -88,8 +88,8 @@
apasource.delete(existing_links - wanted_links)
+@implementer(IAccessArtifact)
class AccessArtifact(StormBase):
- implements(IAccessArtifact)
__storm_table__ = 'AccessArtifact'
@@ -184,8 +184,8 @@
IStore(abstract).find(cls, cls.id.is_in(ids)).remove()
+@implementer(IAccessPolicy)
class AccessPolicy(StormBase):
- implements(IAccessPolicy)
__storm_table__ = 'AccessPolicy'
@@ -279,8 +279,8 @@
cls.find(pillars_and_types).remove()
+@implementer(IAccessPolicyArtifact)
class AccessPolicyArtifact(StormBase):
- implements(IAccessPolicyArtifact)
__storm_table__ = 'AccessPolicyArtifact'
__storm_primary__ = 'abstract_artifact_id', 'policy_id'
@@ -332,8 +332,8 @@
cls.findByArtifact(artifacts).remove()
+@implementer(IAccessArtifactGrant)
class AccessArtifactGrant(StormBase):
- implements(IAccessArtifactGrant)
__storm_table__ = 'AccessArtifactGrant'
__storm_primary__ = 'abstract_artifact_id', 'grantee_id'
@@ -384,8 +384,8 @@
cls.findByArtifact(artifacts, grantees).remove()
+@implementer(IAccessPolicyGrant)
class AccessPolicyGrant(StormBase):
- implements(IAccessPolicyGrant)
__storm_table__ = 'AccessPolicyGrant'
__storm_primary__ = 'policy_id', 'grantee_id'
=== modified file 'lib/lp/registry/model/announcement.py'
--- lib/lp/registry/model/announcement.py 2015-01-29 16:28:30 +0000
+++ lib/lp/registry/model/announcement.py 2015-07-08 16:13:45 +0000
@@ -17,7 +17,7 @@
SQLObjectNotFound,
StringCol,
)
-from zope.interface import implements
+from zope.interface import implementer
from lp.registry.interfaces.announcement import (
IAnnouncement,
@@ -36,11 +36,11 @@
from lp.services.utils import utc_now
+@implementer(IAnnouncement)
class Announcement(SQLBase):
"""A news item. These allow us to generate lists of recent news for
project groups, products and distributions.
"""
- implements(IAnnouncement)
_defaultOrder = ['-date_announced', '-date_created']
@@ -217,10 +217,9 @@
return announcement
+@implementer(IAnnouncementSet)
class AnnouncementSet(HasAnnouncements):
"""The set of all announcements across all pillars."""
- implements(IAnnouncementSet)
-
displayname = 'Launchpad-hosted'
title = 'Launchpad'
=== modified file 'lib/lp/registry/model/codeofconduct.py'
--- lib/lp/registry/model/codeofconduct.py 2013-01-07 02:40:55 +0000
+++ lib/lp/registry/model/codeofconduct.py 2015-07-08 16:13:45 +0000
@@ -20,7 +20,7 @@
StringCol,
)
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from lp.app.errors import NotFoundError
from lp.registry.interfaces.codeofconduct import (
@@ -50,11 +50,10 @@
from lp.services.webapp import canonical_url
+@implementer(ICodeOfConductConf)
class CodeOfConductConf:
"""Abstract Component to store the current CoC configuration."""
- implements(ICodeOfConductConf)
-
## XXX: cprov 2005-02-17
## Integrate this class with LaunchpadCentral configuration
## in the future.
@@ -68,6 +67,7 @@
datereleased = datetime(2005, 4, 12, tzinfo=pytz.timezone("UTC"))
+@implementer(ICodeOfConduct)
class CodeOfConduct:
"""CoC class model.
@@ -75,8 +75,6 @@
in the filesystem, so it's not a database class.
"""
- implements(ICodeOfConduct)
-
def __init__(self, version):
self.version = version
# verify if the respective file containing the code of conduct exists
@@ -123,11 +121,10 @@
return getUtility(ICodeOfConductConf).datereleased
+@implementer(ICodeOfConductSet)
class CodeOfConductSet:
"""A set of CodeOfConducts."""
- implements(ICodeOfConductSet)
-
title = 'Launchpad Codes of Conduct'
def __getitem__(self, version):
@@ -171,11 +168,10 @@
raise AssertionError("No current code of conduct registered")
+@implementer(ISignedCodeOfConduct)
class SignedCodeOfConduct(SQLBase):
"""Code of Conduct."""
- implements(ISignedCodeOfConduct)
-
_table = 'SignedCodeOfConduct'
owner = ForeignKey(foreignKey="Person", dbName="owner", notNull=True)
@@ -227,11 +223,10 @@
subject, message)
+@implementer(ISignedCodeOfConductSet)
class SignedCodeOfConductSet:
"""A set of CodeOfConducts"""
- implements(ISignedCodeOfConductSet)
-
title = 'Code of Conduct Administrator Page'
def __getitem__(self, id):
=== modified file 'lib/lp/registry/model/commercialsubscription.py'
--- lib/lp/registry/model/commercialsubscription.py 2012-06-08 15:01:33 +0000
+++ lib/lp/registry/model/commercialsubscription.py 2015-07-08 16:13:45 +0000
@@ -13,7 +13,7 @@
ForeignKey,
StringCol,
)
-from zope.interface import implements
+from zope.interface import implementer
from lp.registry.errors import CannotDeleteCommercialSubscription
from lp.registry.interfaces.commercialsubscription import (
@@ -25,8 +25,8 @@
from lp.services.database.sqlbase import SQLBase
+@implementer(ICommercialSubscription)
class CommercialSubscription(SQLBase):
- implements(ICommercialSubscription)
product = ForeignKey(
dbName='product', foreignKey='Product', notNull=True)
=== modified file 'lib/lp/registry/model/distribution.py'
--- lib/lp/registry/model/distribution.py 2015-06-26 14:00:41 +0000
+++ lib/lp/registry/model/distribution.py 2015-07-08 16:13:45 +0000
@@ -34,7 +34,7 @@
from storm.info import ClassAlias
from storm.store import Store
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from lp.answers.enums import QUESTION_STATUS_DEFAULT_SEARCH
from lp.answers.model.faq import (
@@ -185,6 +185,10 @@
from lp.translations.model.translationpolicy import TranslationPolicyMixin
+@implementer(
+ IBugSummaryDimension, IDistribution, IHasBugSupervisor,
+ IHasBuildRecords, IHasIcon, IHasLogo, IHasMugshot,
+ IHasOOPSReferences, ILaunchpadUsage, IServiceUsage)
class Distribution(SQLBase, BugTargetBase, MakesAnnouncements,
HasSpecificationsMixin, HasSprintsMixin, HasAliasMixin,
HasTranslationImportsMixin, KarmaContextMixin,
@@ -192,10 +196,6 @@
StructuralSubscriptionTargetMixin, HasMilestonesMixin,
HasDriversMixin, TranslationPolicyMixin):
"""A distribution of an operating system, e.g. Debian GNU/Linux."""
- implements(
- IBugSummaryDimension, IDistribution, IHasBugSupervisor,
- IHasBuildRecords, IHasIcon, IHasLogo, IHasMugshot,
- IHasOOPSReferences, ILaunchpadUsage, IServiceUsage)
_table = 'Distribution'
_defaultOrder = 'name'
@@ -1412,10 +1412,9 @@
return False
+@implementer(IDistributionSet)
class DistributionSet:
"""This class is to deal with Distribution related stuff"""
-
- implements(IDistributionSet)
title = "Registered Distributions"
def __iter__(self):
=== modified file 'lib/lp/registry/model/distributionmirror.py'
--- lib/lp/registry/model/distributionmirror.py 2015-02-18 18:44:32 +0000
+++ lib/lp/registry/model/distributionmirror.py 2015-07-08 16:13:45 +0000
@@ -32,7 +32,7 @@
)
from storm.store import Store
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from lp.app.interfaces.launchpad import ILaunchpadCelebrities
from lp.archivepublisher.diskpool import poolify
@@ -106,10 +106,9 @@
)
+@implementer(IDistributionMirror)
class DistributionMirror(SQLBase):
"""See IDistributionMirror"""
-
- implements(IDistributionMirror)
_table = 'DistributionMirror'
_defaultOrder = ('-speed', 'name', 'id')
@@ -574,11 +573,10 @@
return paths
+@implementer(IDistributionMirrorSet)
class DistributionMirrorSet:
"""See IDistributionMirrorSet"""
- implements(IDistributionMirrorSet)
-
def __getitem__(self, mirror_id):
"""See IDistributionMirrorSet"""
return DistributionMirror.get(mirror_id)
@@ -781,10 +779,9 @@
return urls
+@implementer(IMirrorCDImageDistroSeries)
class MirrorCDImageDistroSeries(SQLBase):
"""See IMirrorCDImageDistroSeries"""
-
- implements(IMirrorCDImageDistroSeries)
_table = 'MirrorCDImageDistroSeries'
_defaultOrder = 'id'
@@ -796,10 +793,9 @@
flavour = StringCol(notNull=True)
+@implementer(IMirrorDistroArchSeries)
class MirrorDistroArchSeries(SQLBase, _MirrorSeriesMixIn):
"""See IMirrorDistroArchSeries"""
-
- implements(IMirrorDistroArchSeries)
_table = 'MirrorDistroArchSeries'
_defaultOrder = [
'distroarchseries', 'component', 'pocket', 'freshness', 'id']
@@ -868,10 +864,9 @@
return urlappend(base_url, full_path)
+@implementer(IMirrorDistroSeriesSource)
class MirrorDistroSeriesSource(SQLBase, _MirrorSeriesMixIn):
"""See IMirrorDistroSeriesSource"""
-
- implements(IMirrorDistroSeriesSource)
_table = 'MirrorDistroSeriesSource'
_defaultOrder = ['distroseries', 'component', 'pocket', 'freshness', 'id']
@@ -925,10 +920,9 @@
return urlappend(base_url, full_path)
+@implementer(IMirrorProbeRecord)
class MirrorProbeRecord(SQLBase):
"""See IMirrorProbeRecord"""
-
- implements(IMirrorProbeRecord)
_table = 'MirrorProbeRecord'
_defaultOrder = 'id'
=== modified file 'lib/lp/registry/model/distributionsourcepackage.py'
--- lib/lp/registry/model/distributionsourcepackage.py 2015-03-04 19:05:47 +0000
+++ lib/lp/registry/model/distributionsourcepackage.py 2015-07-08 16:13:45 +0000
@@ -32,7 +32,7 @@
Unicode,
)
import transaction
-from zope.interface import implements
+from zope.interface import implementer
from lp.bugs.interfaces.bugsummary import IBugSummaryDimension
from lp.bugs.model.bugtarget import BugTargetBase
@@ -113,6 +113,8 @@
setattr(obj._self_in_database, self.attrname, value)
+@implementer(
+ IBugSummaryDimension, IDistributionSourcePackage, IHasCustomLanguageCodes)
class DistributionSourcePackage(BugTargetBase,
SourcePackageQuestionTargetMixin,
StructuralSubscriptionTargetMixin,
@@ -127,10 +129,6 @@
or current release, etc.
"""
- implements(
- IBugSummaryDimension, IDistributionSourcePackage,
- IHasCustomLanguageCodes)
-
bug_reporting_guidelines = DistributionSourcePackageProperty(
'bug_reporting_guidelines')
bug_reported_acknowledgement = DistributionSourcePackageProperty(
@@ -545,11 +543,10 @@
cls._new(distribution, sourcepackagename, upstream_link_allowed)
+@implementer(transaction.interfaces.ISynchronizer)
class ThreadLocalLRUCache(LRUCache, local):
"""A per-thread LRU cache that can synchronize with a transaction."""
- implements(transaction.interfaces.ISynchronizer)
-
def newTransaction(self, txn):
pass
=== modified file 'lib/lp/registry/model/distroseries.py'
--- lib/lp/registry/model/distroseries.py 2015-04-20 15:59:27 +0000
+++ lib/lp/registry/model/distroseries.py 2015-07-08 16:13:45 +0000
@@ -39,7 +39,7 @@
Store,
)
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from lp.app.enums import service_uses_launchpad
from lp.app.errors import NotFoundError
@@ -201,14 +201,14 @@
]
+@implementer(
+ IBugSummaryDimension, IDistroSeries, IHasBuildRecords, IHasQueueItems,
+ IServiceUsage, ISeriesBugTarget)
class DistroSeries(SQLBase, BugTargetBase, HasSpecificationsMixin,
HasTranslationImportsMixin, HasTranslationTemplatesMixin,
HasMilestonesMixin, SeriesMixin,
StructuralSubscriptionTargetMixin):
"""A particular series of a distribution."""
- implements(
- IBugSummaryDimension, IDistroSeries, IHasBuildRecords, IHasQueueItems,
- IServiceUsage, ISeriesBugTarget)
delegates(ISpecificationTarget, 'distribution')
@@ -1458,8 +1458,8 @@
self, since=since, source_package_name=source_package_name)
+@implementer(IDistroSeriesSet)
class DistroSeriesSet:
- implements(IDistroSeriesSet)
def get(self, distroseriesid):
"""See `IDistroSeriesSet`."""
=== modified file 'lib/lp/registry/model/distroseriesdifference.py'
--- lib/lp/registry/model/distroseriesdifference.py 2014-11-09 11:48:34 +0000
+++ lib/lp/registry/model/distroseriesdifference.py 2015-07-08 16:13:45 +0000
@@ -35,8 +35,8 @@
from storm.zope.interfaces import IResultSet
from zope.component import getUtility
from zope.interface import (
- classProvides,
- implements,
+ implementer,
+ provider,
)
from lp.code.model.sourcepackagerecipebuild import SourcePackageRecipeBuild
@@ -360,10 +360,10 @@
return new_comment
+@implementer(IDistroSeriesDifference)
+@provider(IDistroSeriesDifferenceSource)
class DistroSeriesDifference(StormBase):
"""See `DistroSeriesDifference`."""
- implements(IDistroSeriesDifference)
- classProvides(IDistroSeriesDifferenceSource)
__storm_table__ = 'DistroSeriesDifference'
id = Int(primary=True)
=== modified file 'lib/lp/registry/model/distroseriesdifferencecomment.py'
--- lib/lp/registry/model/distroseriesdifferencecomment.py 2015-03-13 19:05:50 +0000
+++ lib/lp/registry/model/distroseriesdifferencecomment.py 2015-07-08 16:13:45 +0000
@@ -18,8 +18,8 @@
Storm,
)
from zope.interface import (
- classProvides,
- implements,
+ implementer,
+ provider,
)
from lp.registry.interfaces.distroseriesdifferencecomment import (
@@ -37,10 +37,10 @@
)
+@implementer(IDistroSeriesDifferenceComment)
+@provider(IDistroSeriesDifferenceCommentSource)
class DistroSeriesDifferenceComment(Storm):
"""See `IDistroSeriesDifferenceComment`."""
- implements(IDistroSeriesDifferenceComment)
- classProvides(IDistroSeriesDifferenceCommentSource)
__storm_table__ = 'DistroSeriesDifferenceMessage'
id = Int(primary=True)
=== modified file 'lib/lp/registry/model/distroseriesparent.py'
--- lib/lp/registry/model/distroseriesparent.py 2014-07-30 23:48:56 +0000
+++ lib/lp/registry/model/distroseriesparent.py 2015-07-08 16:13:45 +0000
@@ -17,7 +17,7 @@
SQL,
Storm,
)
-from zope.interface import implements
+from zope.interface import implementer
from lp.registry.interfaces.distroseriesparent import (
IDistroSeriesParent,
@@ -31,9 +31,9 @@
)
+@implementer(IDistroSeriesParent)
class DistroSeriesParent(Storm):
"""See `IDistroSeriesParent`."""
- implements(IDistroSeriesParent)
__storm_table__ = 'DistroSeriesParent'
id = Int(primary=True)
@@ -59,9 +59,9 @@
ordering = Int(allow_none=False, default=1)
+@implementer(IDistroSeriesParentSet)
class DistroSeriesParentSet:
"""See `IDistroSeriesParentSet`."""
- implements(IDistroSeriesParentSet)
title = "Cross reference of parent and derived distroseries."
def new(self, derived_series, parent_series, initialized,
=== modified file 'lib/lp/registry/model/featuredproject.py'
--- lib/lp/registry/model/featuredproject.py 2011-12-30 06:14:56 +0000
+++ lib/lp/registry/model/featuredproject.py 2015-07-08 16:13:45 +0000
@@ -9,12 +9,13 @@
]
from sqlobject import IntCol
-from zope.interface import implements
+from zope.interface import implementer
from lp.registry.interfaces.featuredproject import IFeaturedProject
from lp.services.database.sqlbase import SQLBase
+@implementer(IFeaturedProject)
class FeaturedProject(SQLBase):
"""A featured project reference.
@@ -22,7 +23,6 @@
that is currently being "featured" by being listed on the Launchpad home
page.
"""
- implements(IFeaturedProject)
_defaultOrder = ['id']
=== modified file 'lib/lp/registry/model/gpgkey.py'
--- lib/lp/registry/model/gpgkey.py 2013-01-07 02:40:55 +0000
+++ lib/lp/registry/model/gpgkey.py 2015-07-08 16:13:45 +0000
@@ -12,7 +12,7 @@
StringCol,
)
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from lp.registry.interfaces.gpg import (
IGPGKey,
@@ -29,8 +29,8 @@
)
+@implementer(IGPGKey)
class GPGKey(SQLBase):
- implements(IGPGKey)
_table = 'GPGKey'
_defaultOrder = ['owner', 'keyid']
@@ -59,8 +59,8 @@
return '%s%s/%s' % (self.keysize, self.algorithm.title, self.keyid)
+@implementer(IGPGKeySet)
class GPGKeySet:
- implements(IGPGKeySet)
def new(self, ownerID, keyid, fingerprint, keysize,
algorithm, active=True, can_encrypt=False):
=== modified file 'lib/lp/registry/model/karma.py'
--- lib/lp/registry/model/karma.py 2015-01-28 16:10:51 +0000
+++ lib/lp/registry/model/karma.py 2015-07-08 16:13:45 +0000
@@ -22,7 +22,7 @@
StringCol,
)
from storm.expr import Desc
-from zope.interface import implements
+from zope.interface import implementer
from lp.app.errors import NotFoundError
from lp.registry.interfaces.distribution import IDistribution
@@ -48,19 +48,18 @@
)
+@implementer(IKarmaAssignedEvent)
class KarmaAssignedEvent:
"""See `IKarmaAssignedEvent`."""
- implements(IKarmaAssignedEvent)
-
def __init__(self, object, karma):
self.object = object
self.karma = karma
+@implementer(IKarma)
class Karma(SQLBase):
"""See IKarma."""
- implements(IKarma)
_table = 'Karma'
_defaultOrder = ['action', 'id']
@@ -80,9 +79,9 @@
dbName='datecreated', notNull=True, default=UTC_NOW)
+@implementer(IKarmaAction)
class KarmaAction(SQLBase):
"""See IKarmaAction."""
- implements(IKarmaAction)
_table = 'KarmaAction'
sortingColumns = ['category', 'name']
@@ -96,9 +95,9 @@
points = IntCol(dbName='points', notNull=True)
+@implementer(IKarmaActionSet)
class KarmaActionSet:
"""See IKarmaActionSet."""
- implements(IKarmaActionSet)
def __iter__(self):
return iter(KarmaAction.select())
@@ -125,9 +124,9 @@
query, clauseTables=['Karma'], distinct=True, orderBy=orderBy)
+@implementer(IKarmaCache)
class KarmaCache(SQLBase):
"""See IKarmaCache."""
- implements(IKarmaCache)
_table = 'KarmaCache'
_defaultOrder = ['category', 'id']
@@ -149,9 +148,9 @@
notNull=False)
+@implementer(IKarmaCacheManager)
class KarmaCacheManager:
"""See IKarmaCacheManager."""
- implements(IKarmaCacheManager)
def new(self, value, person_id, category_id, product_id=None,
distribution_id=None, sourcepackagename_id=None,
@@ -195,9 +194,9 @@
KarmaCache.sourcepackagenameID == sourcepackagename_id).one()
+@implementer(IKarmaTotalCache)
class KarmaTotalCache(SQLBase):
"""A cached value of the total of a person's karma (all categories)."""
- implements(IKarmaTotalCache)
_table = 'KarmaTotalCache'
_defaultOrder = ['id']
@@ -206,9 +205,9 @@
karma_total = IntCol(dbName='karma_total', notNull=True)
+@implementer(IKarmaCategory)
class KarmaCategory(SQLBase):
"""See IKarmaCategory."""
- implements(IKarmaCategory)
_defaultOrder = ['title', 'id']
@@ -220,6 +219,7 @@
'KarmaAction', joinColumn='category', orderBy='name')
+@implementer(IKarmaContext)
class KarmaContextMixin:
"""A mixin to be used by classes implementing IKarmaContext.
@@ -227,8 +227,6 @@
mixin should be okay for now.
"""
- implements(IKarmaContext)
-
def getTopContributorsGroupedByCategory(self, limit=None):
"""See IKarmaContext."""
contributors_by_category = {}
=== modified file 'lib/lp/registry/model/mailinglist.py'
--- lib/lp/registry/model/mailinglist.py 2015-03-09 11:38:14 +0000
+++ lib/lp/registry/model/mailinglist.py 2015-07-08 16:13:45 +0000
@@ -40,7 +40,7 @@
)
from zope.event import notify
from zope.interface import (
- implements,
+ implementer,
providedBy,
)
from zope.security.proxy import removeSecurityProxy
@@ -107,11 +107,10 @@
MailingListStatus.MOD_FAILED)
+@implementer(IMessageApproval)
class MessageApproval(SQLBase):
"""A held message."""
- implements(IMessageApproval)
-
message = ForeignKey(
dbName='message', foreignKey='Message',
notNull=True)
@@ -178,6 +177,7 @@
self.status)
+@implementer(IMailingList)
class MailingList(SQLBase):
"""The mailing list for a team.
@@ -188,8 +188,6 @@
XMLRPC).
"""
- implements(IMailingList)
-
team = ForeignKey(
dbName='team', foreignKey='Person',
notNull=True)
@@ -480,8 +478,8 @@
raise UnsafeToPurge(self)
+@implementer(IMailingListSet)
class MailingListSet:
- implements(IMailingListSet)
title = _('Team mailing lists')
@@ -714,11 +712,10 @@
(MailingListStatus.CONSTRUCTING, MailingListStatus.UPDATING)))
+@implementer(IMailingListSubscription)
class MailingListSubscription(SQLBase):
"""A mailing list subscription."""
- implements(IMailingListSubscription)
-
person = ForeignKey(
dbName='person', foreignKey='Person',
storm_validator=validate_public_person,
@@ -744,11 +741,10 @@
return self.email_address
+@implementer(IMessageApprovalSet)
class MessageApprovalSet:
"""Sets of held messages."""
- implements(IMessageApprovalSet)
-
def getMessageByMessageID(self, message_id):
"""See `IMessageApprovalSet`."""
return MessageApproval.selectOne("""
@@ -789,11 +785,10 @@
approvals.set(status=next_state)
+@implementer(IHeldMessageDetails)
class HeldMessageDetails:
"""Details about a held message."""
- implements(IHeldMessageDetails)
-
def __init__(self, message_approval):
self.message_approval = message_approval
self.message = message_approval.message
=== modified file 'lib/lp/registry/model/milestone.py'
--- lib/lp/registry/model/milestone.py 2015-01-29 16:28:30 +0000
+++ lib/lp/registry/model/milestone.py 2015-07-08 16:13:45 +0000
@@ -35,7 +35,7 @@
from storm.locals import Store
from storm.zope import IResultSet
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from lp.app.errors import NotFoundError
from lp.blueprints.model.specification import Specification
@@ -93,8 +93,8 @@
return (date, expand_numbers(milestone.name))
+@implementer(IHasMilestones)
class HasMilestonesMixin:
- implements(IHasMilestones)
_milestone_order = (
'milestone_sort_key(Milestone.dateexpected, Milestone.name) DESC')
@@ -147,8 +147,8 @@
super(InvalidTags, self).__init__(msg)
+@implementer(IMilestoneData)
class MilestoneData:
- implements(IMilestoneData)
@property
def displayname(self):
@@ -207,9 +207,9 @@
return non_conjoined_slaves
+@implementer(IHasBugs, IMilestone, IBugSummaryDimension)
class Milestone(SQLBase, MilestoneData, StructuralSubscriptionTargetMixin,
HasBugsBase):
- implements(IHasBugs, IMilestone, IBugSummaryDimension)
active = BoolCol(notNull=True, default=True)
@@ -381,8 +381,8 @@
return self.product.userCanView(user)
+@implementer(IMilestoneSet)
class MilestoneSet:
- implements(IMilestoneSet)
def __iter__(self):
"""See lp.registry.interfaces.milestone.IMilestoneSet."""
@@ -425,6 +425,7 @@
return Milestone.selectBy(active=True, orderBy='id')
+@implementer(IProjectGroupMilestone)
class ProjectMilestone(MilestoneData, HasBugsBase):
"""A virtual milestone implementation for project.
@@ -437,8 +438,6 @@
the `dateexpected` values of the product milestones.
"""
- implements(IProjectGroupMilestone)
-
def __init__(self, target, name, dateexpected, active, product):
self.code_name = None
# The id is necessary for generating a unique memcache key
=== modified file 'lib/lp/registry/model/milestonetag.py'
--- lib/lp/registry/model/milestonetag.py 2015-01-29 16:28:30 +0000
+++ lib/lp/registry/model/milestonetag.py 2015-07-08 16:13:45 +0000
@@ -22,7 +22,7 @@
Unicode,
)
from storm.references import Reference
-from zope.interface import implements
+from zope.interface import implementer
from lp.app.validators.name import valid_name
from lp.registry.interfaces.milestonetag import IProjectGroupMilestoneTag
@@ -54,10 +54,9 @@
self.date_created = date_created
+@implementer(IProjectGroupMilestoneTag)
class ProjectGroupMilestoneTag(MilestoneData):
- implements(IProjectGroupMilestoneTag)
-
def __init__(self, target, tags):
self.target = target
# Tags is a sequence of Unicode strings.
=== modified file 'lib/lp/registry/model/nameblacklist.py'
--- lib/lp/registry/model/nameblacklist.py 2013-06-20 05:50:00 +0000
+++ lib/lp/registry/model/nameblacklist.py 2015-07-08 16:13:45 +0000
@@ -15,7 +15,7 @@
Reference,
Unicode,
)
-from zope.interface import implements
+from zope.interface import implementer
from lp.registry.interfaces.nameblacklist import (
INameBlacklist,
@@ -26,11 +26,10 @@
from lp.services.database.stormbase import StormBase
+@implementer(INameBlacklist)
class NameBlacklist(StormBase):
"""Class for the NameBlacklist table."""
- implements(INameBlacklist)
-
__storm_table__ = 'NameBlacklist'
id = Int(primary=True)
@@ -40,11 +39,10 @@
admin = Reference(admin_id, Person.id)
+@implementer(INameBlacklistSet)
class NameBlacklistSet:
"""Class for creating and retrieving NameBlacklist objects."""
- implements(INameBlacklistSet)
-
def getAll(self):
"""See `INameBlacklistSet`."""
store = IStore(NameBlacklist)
=== modified file 'lib/lp/registry/model/packaging.py'
--- lib/lp/registry/model/packaging.py 2013-01-07 02:40:55 +0000
+++ lib/lp/registry/model/packaging.py 2015-07-08 16:13:45 +0000
@@ -11,7 +11,7 @@
from sqlobject import ForeignKey
from zope.component import getUtility
from zope.event import notify
-from zope.interface import implements
+from zope.interface import implementer
from zope.security.interfaces import Unauthorized
from lp.app.enums import InformationType
@@ -33,12 +33,11 @@
from lp.services.webapp.interfaces import ILaunchBag
+@implementer(IPackaging)
class Packaging(SQLBase):
"""A Packaging relating a SourcePackageName in DistroSeries and a Product.
"""
- implements(IPackaging)
-
_table = 'Packaging'
productseries = ForeignKey(foreignKey="ProductSeries",
@@ -91,9 +90,9 @@
super(Packaging, self).destroySelf()
+@implementer(IPackagingUtil)
class PackagingUtil:
"""Utilities for Packaging."""
- implements(IPackagingUtil)
@classmethod
def createPackaging(cls, productseries, sourcepackagename,
=== modified file 'lib/lp/registry/model/person.py'
--- lib/lp/registry/model/person.py 2015-07-01 13:01:27 +0000
+++ lib/lp/registry/model/person.py 2015-07-08 16:13:45 +0000
@@ -91,7 +91,6 @@
alsoProvides,
classImplements,
implementer,
- implements,
)
from zope.lifecycleevent import ObjectCreatedEvent
from zope.publisher.interfaces import Unauthorized
@@ -333,21 +332,19 @@
"""Raised when an attempt to claim a team that has been claimed."""
+@implementer(IJoinTeamEvent)
class JoinTeamEvent:
"""See `IJoinTeamEvent`."""
- implements(IJoinTeamEvent)
-
def __init__(self, person, team):
self.person = person
self.team = team
+@implementer(ITeamInvitationEvent)
class TeamInvitationEvent:
"""See `IJoinTeamEvent`."""
- implements(ITeamInvitationEvent)
-
def __init__(self, member, team):
self.member = member
self.team = team
@@ -415,11 +412,10 @@
return "%s, %s" % (displayname.strip(), person.name)
+@implementer(IPersonSettings)
class PersonSettings(Storm):
"The relatively rarely used settings for person (not a team)."
- implements(IPersonSettings)
-
__storm_table__ = 'PersonSettings'
personID = Int("person", default=None, primary=True)
@@ -475,14 +471,13 @@
'Teams do not support changing this attribute.', IPersonSettings)
+@implementer(IPerson, IHasIcon, IHasLogo, IHasMugshot)
class Person(
SQLBase, HasBugsBase, HasSpecificationsMixin, HasTranslationImportsMixin,
HasBranchesMixin, HasMergeProposalsMixin, HasRequestedReviewsMixin,
QuestionsPersonMixin):
"""A Person."""
- implements(IPerson, IHasIcon, IHasLogo, IHasMugshot)
-
def __init__(self, *args, **kwargs):
super(Person, self).__init__(*args, **kwargs)
# Initialize our PersonSettings object/record.
@@ -3230,9 +3225,9 @@
getUtility(IAccessPolicyGrantSource).grant(grants)
+@implementer(IPersonSet)
class PersonSet:
"""The set of persons."""
- implements(IPersonSet)
def __init__(self):
self.title = 'People registered with Launchpad'
@@ -3966,8 +3961,8 @@
notNull=True)
+@implementer(ISSHKey)
class SSHKey(SQLBase):
- implements(ISSHKey)
_defaultOrder = ["person", "keytype", "keytext"]
_table = 'SSHKey'
@@ -3986,8 +3981,8 @@
super(SSHKey, self).destroySelf()
+@implementer(ISSHKeySet)
class SSHKeySet:
- implements(ISSHKeySet)
def new(self, person, sshkey):
try:
@@ -4032,8 +4027,8 @@
""" % sqlvalues([person.id for person in people]))
+@implementer(IWikiName)
class WikiName(SQLBase, HasOwnerMixin):
- implements(IWikiName)
_table = 'WikiName'
@@ -4046,8 +4041,8 @@
return self.wiki + self.wikiname
+@implementer(IWikiNameSet)
class WikiNameSet:
- implements(IWikiNameSet)
def getByWikiAndName(self, wiki, wikiname):
"""See `IWikiNameSet`."""
@@ -4065,8 +4060,8 @@
return WikiName(person=person, wiki=wiki, wikiname=wikiname)
+@implementer(IJabberID)
class JabberID(SQLBase, HasOwnerMixin):
- implements(IJabberID)
_table = 'JabberID'
_defaultOrder = ['jabberid']
@@ -4075,8 +4070,8 @@
jabberid = StringCol(dbName='jabberid', notNull=True)
+@implementer(IJabberIDSet)
class JabberIDSet:
- implements(IJabberIDSet)
def new(self, person, jabberid):
"""See `IJabberIDSet`"""
@@ -4091,9 +4086,9 @@
return JabberID.selectBy(person=person)
+@implementer(IIrcID)
class IrcID(SQLBase, HasOwnerMixin):
"""See `IIrcID`"""
- implements(IIrcID)
_table = 'IrcID'
@@ -4102,9 +4097,9 @@
nickname = StringCol(dbName='nickname', notNull=True)
+@implementer(IIrcIDSet)
class IrcIDSet:
"""See `IIrcIDSet`"""
- implements(IIrcIDSet)
def get(self, id):
"""See `IIrcIDSet`"""
=== modified file 'lib/lp/registry/model/persondistributionsourcepackage.py'
--- lib/lp/registry/model/persondistributionsourcepackage.py 2015-02-20 16:15:53 +0000
+++ lib/lp/registry/model/persondistributionsourcepackage.py 2015-07-08 16:13:45 +0000
@@ -9,8 +9,8 @@
]
from zope.interface import (
- classProvides,
- implements,
+ implementer,
+ provider,
)
from lp.registry.interfaces.persondistributionsourcepackage import (
@@ -19,12 +19,10 @@
)
+@implementer(IPersonDistributionSourcePackage)
+@provider(IPersonDistributionSourcePackageFactory)
class PersonDistributionSourcePackage:
- implements(IPersonDistributionSourcePackage)
-
- classProvides(IPersonDistributionSourcePackageFactory)
-
def __init__(self, person, distro_source_package):
self.person = person
self.distro_source_package = distro_source_package
=== modified file 'lib/lp/registry/model/personlocation.py'
--- lib/lp/registry/model/personlocation.py 2011-12-30 06:14:56 +0000
+++ lib/lp/registry/model/personlocation.py 2015-07-08 16:13:45 +0000
@@ -20,7 +20,7 @@
ForeignKey,
StringCol,
)
-from zope.interface import implements
+from zope.interface import implementer
from lp.registry.interfaces.location import IPersonLocation
from lp.registry.interfaces.person import validate_public_person
@@ -29,10 +29,9 @@
from lp.services.database.sqlbase import SQLBase
+@implementer(IPersonLocation)
class PersonLocation(SQLBase):
"""A person's location."""
-
- implements(IPersonLocation)
_defaultOrder = ['id']
=== modified file 'lib/lp/registry/model/personnotification.py'
--- lib/lp/registry/model/personnotification.py 2012-04-12 04:39:58 +0000
+++ lib/lp/registry/model/personnotification.py 2015-07-08 16:13:45 +0000
@@ -16,7 +16,7 @@
ForeignKey,
StringCol,
)
-from zope.interface import implements
+from zope.interface import implementer
from lp.registry.interfaces.personnotification import (
IPersonNotification,
@@ -36,9 +36,9 @@
from lp.services.propertycache import cachedproperty
+@implementer(IPersonNotification)
class PersonNotification(SQLBase):
"""See `IPersonNotification`."""
- implements(IPersonNotification)
person = ForeignKey(dbName='person', notNull=True, foreignKey='Person')
date_created = UtcDateTimeCol(notNull=True, default=UTC_NOW)
@@ -75,9 +75,9 @@
self.date_emailed = datetime.now(pytz.timezone('UTC'))
+@implementer(IPersonNotificationSet)
class PersonNotificationSet:
"""See `IPersonNotificationSet`."""
- implements(IPersonNotificationSet)
def getNotificationsToSend(self):
"""See `IPersonNotificationSet`."""
=== modified file 'lib/lp/registry/model/personproduct.py'
--- lib/lp/registry/model/personproduct.py 2015-02-20 16:15:53 +0000
+++ lib/lp/registry/model/personproduct.py 2015-07-08 16:13:45 +0000
@@ -9,8 +9,8 @@
]
from zope.interface import (
- classProvides,
- implements,
+ implementer,
+ provider,
)
from lp.code.model.hasbranches import HasMergeProposalsMixin
@@ -20,12 +20,10 @@
)
+@implementer(IPersonProduct)
+@provider(IPersonProductFactory)
class PersonProduct(HasMergeProposalsMixin):
- implements(IPersonProduct)
-
- classProvides(IPersonProductFactory)
-
def __init__(self, person, product):
self.person = person
self.product = product
=== modified file 'lib/lp/registry/model/personroles.py'
--- lib/lp/registry/model/personroles.py 2014-06-12 01:04:30 +0000
+++ lib/lp/registry/model/personroles.py 2015-07-08 16:13:45 +0000
@@ -10,7 +10,7 @@
adapts,
getUtility,
)
-from zope.interface import implements
+from zope.interface import implementer
from zope.security.proxy import removeSecurityProxy
from lp.app.interfaces.launchpad import ILaunchpadCelebrities
@@ -22,8 +22,8 @@
)
+@implementer(IPersonRoles)
class PersonRoles:
- implements(IPersonRoles)
adapts(IPerson)
def __init__(self, person):
=== modified file 'lib/lp/registry/model/persontransferjob.py'
--- lib/lp/registry/model/persontransferjob.py 2013-06-20 05:50:00 +0000
+++ lib/lp/registry/model/persontransferjob.py 2015-07-08 16:13:45 +0000
@@ -22,8 +22,8 @@
)
from zope.component import getUtility
from zope.interface import (
- classProvides,
- implements,
+ implementer,
+ provider,
)
from lp.app.interfaces.launchpad import ILaunchpadCelebrities
@@ -75,11 +75,10 @@
from lp.services.webapp import canonical_url
+@implementer(IPersonTransferJob)
class PersonTransferJob(StormBase):
"""Base class for team membership and person merge jobs."""
- implements(IPersonTransferJob)
-
__storm_table__ = 'PersonTransferJob'
id = Int(primary=True)
@@ -128,6 +127,7 @@
return PersonTransferJobDerived.makeSubclass(self)
+@provider(IPersonTransferJobSource)
class PersonTransferJobDerived(BaseRunnableJob):
"""Intermediate class for deriving from PersonTransferJob.
@@ -140,7 +140,6 @@
__metaclass__ = EnumeratedSubclass
delegates(IPersonTransferJob)
- classProvides(IPersonTransferJobSource)
def __init__(self, job):
self.context = job
@@ -184,12 +183,11 @@
return vars
+@implementer(IMembershipNotificationJob)
+@provider(IMembershipNotificationJobSource)
class MembershipNotificationJob(PersonTransferJobDerived):
"""A Job that sends notifications about team membership changes."""
- implements(IMembershipNotificationJob)
- classProvides(IMembershipNotificationJobSource)
-
class_job_type = PersonTransferJobType.MEMBERSHIP_NOTIFICATION
config = config.IMembershipNotificationJobSource
@@ -352,12 +350,11 @@
"status={self.job.status}>").format(self=self)
+@implementer(IPersonMergeJob)
+@provider(IPersonMergeJobSource)
class PersonMergeJob(PersonTransferJobDerived):
"""A Job that merges one person or team into another."""
- implements(IPersonMergeJob)
- classProvides(IPersonMergeJobSource)
-
class_job_type = PersonTransferJobType.MERGE
config = config.IPersonMergeJobSource
@@ -467,12 +464,11 @@
(self.from_person.name, self.to_person.name))
+@implementer(IPersonDeactivateJob)
+@provider(IPersonDeactivateJobSource)
class PersonDeactivateJob(PersonTransferJobDerived):
"""A Job that deactivates a person."""
- implements(IPersonDeactivateJob)
- classProvides(IPersonDeactivateJobSource)
-
class_job_type = PersonTransferJobType.DEACTIVATE
config = config.IPersonMergeJobSource
=== modified file 'lib/lp/registry/model/pillar.py'
--- lib/lp/registry/model/pillar.py 2015-01-29 13:09:37 +0000
+++ lib/lp/registry/model/pillar.py 2015-07-08 16:13:45 +0000
@@ -21,8 +21,8 @@
from storm.store import Store
from zope.component import getUtility
from zope.interface import (
- classProvides,
- implements,
+ implementer,
+ provider,
)
from lp.app.errors import NotFoundError
@@ -79,8 +79,8 @@
return (distribution_name, product_name)
+@implementer(IPillarNameSet)
class PillarNameSet:
- implements(IPillarNameSet)
def __contains__(self, name):
"""See `IPillarNameSet`."""
@@ -271,8 +271,8 @@
query, clauseTables=['FeaturedProject'])]
+@implementer(IPillarName)
class PillarName(SQLBase):
- implements(IPillarName)
_table = 'PillarName'
_defaultOrder = 'name'
@@ -332,12 +332,10 @@
store.remove(pillar_name)
+@implementer(IPillarPerson)
+@provider(IPillarPersonFactory)
class PillarPerson:
- implements(IPillarPerson)
-
- classProvides(IPillarPersonFactory)
-
def __init__(self, pillar, person):
self.pillar = pillar
self.person = person
=== modified file 'lib/lp/registry/model/pillaraffiliation.py'
--- lib/lp/registry/model/pillaraffiliation.py 2012-09-07 20:15:30 +0000
+++ lib/lp/registry/model/pillaraffiliation.py 2015-07-08 16:13:45 +0000
@@ -24,7 +24,7 @@
from zope.component import adapter
from zope.interface import (
- implements,
+ implementer,
Interface,
)
@@ -53,6 +53,7 @@
@adapter(Interface)
+@implementer(IHasAffiliation)
class PillarAffiliation(object):
"""Default affiliation adapter.
@@ -62,8 +63,6 @@
The default is just to use the context object directly.
"""
- implements(IHasAffiliation)
-
# We rank the affiliations from most important to least important.
# Unlisted roles are given a rank of 10.
affiliation_priorities = {
=== modified file 'lib/lp/registry/model/poll.py'
--- lib/lp/registry/model/poll.py 2014-09-01 09:53:18 +0000
+++ lib/lp/registry/model/poll.py 2015-07-08 16:13:45 +0000
@@ -27,7 +27,7 @@
)
from storm.store import Store
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from lp.registry.interfaces.person import validate_public_person
from lp.registry.interfaces.poll import (
@@ -53,10 +53,9 @@
from lp.services.tokens import create_token
+@implementer(IPoll)
class Poll(SQLBase):
"""See IPoll."""
-
- implements(IPoll)
_table = 'Poll'
sortingColumns = ['title', 'id']
_defaultOrder = sortingColumns
@@ -272,11 +271,10 @@
return pairwise_matrix
+@implementer(IPollSet)
class PollSet:
"""See IPollSet."""
- implements(IPollSet)
-
def new(self, team, name, title, proposition, dateopens, datecloses,
secrecy, allowspoilt, poll_type=PollAlgorithm.SIMPLE):
"""See IPollSet."""
@@ -320,10 +318,9 @@
return default
+@implementer(IPollOption)
class PollOption(SQLBase):
"""See IPollOption."""
-
- implements(IPollOption)
_table = 'PollOption'
_defaultOrder = ['title', 'id']
@@ -336,11 +333,10 @@
active = BoolCol(notNull=True, default=False)
+@implementer(IPollOptionSet)
class PollOptionSet:
"""See IPollOptionSet."""
- implements(IPollOptionSet)
-
def new(self, poll, name, title, active=True):
"""See IPollOptionSet."""
return PollOption(poll=poll, name=name, title=title, active=active)
@@ -362,10 +358,9 @@
return default
+@implementer(IVoteCast)
class VoteCast(SQLBase):
"""See IVoteCast."""
-
- implements(IVoteCast)
_table = 'VoteCast'
_defaultOrder = 'id'
@@ -376,20 +371,18 @@
poll = ForeignKey(dbName='poll', foreignKey='Poll', notNull=True)
+@implementer(IVoteCastSet)
class VoteCastSet:
"""See IVoteCastSet."""
- implements(IVoteCastSet)
-
def new(self, poll, person):
"""See IVoteCastSet."""
return VoteCast(poll=poll, person=person)
+@implementer(IVote)
class Vote(SQLBase):
"""See IVote."""
-
- implements(IVote)
_table = 'Vote'
_defaultOrder = ['preference', 'id']
@@ -406,11 +399,10 @@
token = StringCol(dbName='token', notNull=True, unique=True)
+@implementer(IVoteSet)
class VoteSet:
"""See IVoteSet."""
- implements(IVoteSet)
-
def new(self, poll, option, preference, token, person):
"""See IVoteSet."""
return Vote(poll=poll, option=option, preference=preference,
=== modified file 'lib/lp/registry/model/product.py'
--- lib/lp/registry/model/product.py 2015-07-07 22:33:29 +0000
+++ lib/lp/registry/model/product.py 2015-07-08 16:13:45 +0000
@@ -52,7 +52,7 @@
from zope.component import getUtility
from zope.event import notify
from zope.interface import (
- implements,
+ implementer,
providedBy,
)
from zope.security.proxy import removeSecurityProxy
@@ -226,9 +226,9 @@
from lp.translations.model.translationpolicy import TranslationPolicyMixin
+@implementer(ILicensesModifiedEvent)
class LicensesModifiedEvent(ObjectModifiedEvent):
"""See `ILicensesModifiedEvent`."""
- implements(ILicensesModifiedEvent)
def __init__(self, product, user=None):
super(LicensesModifiedEvent, self).__init__(
@@ -356,6 +356,10 @@
}
+@implementer(
+ IBugSummaryDimension, IHasBugSupervisor,
+ IHasCustomLanguageCodes, IHasIcon, IHasLogo, IHasMugshot,
+ IHasOOPSReferences, ILaunchpadUsage, IProduct, IServiceUsage)
class Product(SQLBase, BugTargetBase, MakesAnnouncements,
HasDriversMixin, HasSpecificationsMixin, HasSprintsMixin,
KarmaContextMixin, QuestionTargetMixin,
@@ -367,11 +371,6 @@
TranslationPolicyMixin):
"""A Product."""
- implements(
- IBugSummaryDimension, IHasBugSupervisor,
- IHasCustomLanguageCodes, IHasIcon, IHasLogo, IHasMugshot,
- IHasOOPSReferences, ILaunchpadUsage, IProduct, IServiceUsage)
-
_table = 'Product'
projectgroup = ForeignKey(
@@ -1799,8 +1798,8 @@
return result
+@implementer(IProductSet)
class ProductSet:
- implements(IProductSet)
def __init__(self):
self.title = "Projects in Launchpad"
=== modified file 'lib/lp/registry/model/productjob.py'
--- lib/lp/registry/model/productjob.py 2013-06-20 05:50:00 +0000
+++ lib/lp/registry/model/productjob.py 2015-07-08 16:13:45 +0000
@@ -32,8 +32,8 @@
)
from zope.component import getUtility
from zope.interface import (
- classProvides,
- implements,
+ implementer,
+ provider,
)
from zope.security.proxy import removeSecurityProxy
@@ -122,11 +122,10 @@
return total
+@implementer(IProductJob)
class ProductJob(StormBase):
"""Base class for product jobs."""
- implements(IProductJob)
-
__storm_table__ = 'ProductJob'
id = Int(primary=True)
@@ -160,6 +159,7 @@
self._json_data = json_data.decode('utf-8')
+@provider(IProductJobSource)
class ProductJobDerived(BaseRunnableJob):
"""Intermediate class for deriving from ProductJob.
@@ -171,7 +171,6 @@
"""
delegates(IProductJob)
- classProvides(IProductJobSource)
def __init__(self, job):
self.context = job
@@ -230,11 +229,10 @@
return vars
+@implementer(IProductNotificationJob)
+@provider(IProductNotificationJobSource)
class ProductNotificationJob(ProductJobDerived):
"""A Job that send an email to the product maintainer."""
-
- implements(IProductNotificationJob)
- classProvides(IProductNotificationJobSource)
class_job_type = ProductJobType.REVIEWER_NOTIFICATION
@classmethod
@@ -399,12 +397,11 @@
return data
+@implementer(ISevenDayCommercialExpirationJob)
+@provider(ISevenDayCommercialExpirationJobSource)
class SevenDayCommercialExpirationJob(CommericialExpirationMixin,
ProductNotificationJob):
"""A job that sends an email about an expiring commercial subscription."""
-
- implements(ISevenDayCommercialExpirationJob)
- classProvides(ISevenDayCommercialExpirationJobSource)
class_job_type = ProductJobType.COMMERCIAL_EXPIRATION_7_DAYS
@staticmethod
@@ -415,12 +412,11 @@
return now, in_seven_days, seven_days_ago
+@implementer(IThirtyDayCommercialExpirationJob)
+@provider(IThirtyDayCommercialExpirationJobSource)
class ThirtyDayCommercialExpirationJob(CommericialExpirationMixin,
ProductNotificationJob):
"""A job that sends an email about an expiring commercial subscription."""
-
- implements(IThirtyDayCommercialExpirationJob)
- classProvides(IThirtyDayCommercialExpirationJobSource)
class_job_type = ProductJobType.COMMERCIAL_EXPIRATION_30_DAYS
@staticmethod
@@ -433,11 +429,10 @@
return in_twenty_three_days, in_thirty_days, thirty_days_ago
+@implementer(ICommercialExpiredJob)
+@provider(ICommercialExpiredJobSource)
class CommercialExpiredJob(CommericialExpirationMixin, ProductNotificationJob):
"""A job that sends an email about an expired commercial subscription."""
-
- implements(ICommercialExpiredJob)
- classProvides(ICommercialExpiredJobSource)
class_job_type = ProductJobType.COMMERCIAL_EXPIRED
_email_template_name = '' # email_template_name does not need this.
=== modified file 'lib/lp/registry/model/productlicense.py'
--- lib/lp/registry/model/productlicense.py 2012-05-24 20:25:54 +0000
+++ lib/lp/registry/model/productlicense.py 2015-07-08 16:13:45 +0000
@@ -10,7 +10,7 @@
from sqlobject import ForeignKey
-from zope.interface import implements
+from zope.interface import implementer
from lp.registry.interfaces.product import License
from lp.registry.interfaces.productlicense import IProductLicense
@@ -18,9 +18,9 @@
from lp.services.database.sqlbase import SQLBase
+@implementer(IProductLicense)
class ProductLicense(SQLBase):
"""A product's licence."""
- implements(IProductLicense)
product = ForeignKey(dbName='product', foreignKey='Product', notNull=True)
license = EnumCol(dbName='license', notNull=True, schema=License)
=== modified file 'lib/lp/registry/model/productrelease.py'
--- lib/lp/registry/model/productrelease.py 2014-02-28 11:12:31 +0000
+++ lib/lp/registry/model/productrelease.py 2015-07-08 16:13:45 +0000
@@ -23,7 +23,7 @@
)
from storm.store import EmptyResultSet
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from lp.app.enums import InformationType
from lp.app.errors import NotFoundError
@@ -56,9 +56,9 @@
)
+@implementer(IProductRelease)
class ProductRelease(SQLBase):
"""A release of a product."""
- implements(IProductRelease)
_table = 'ProductRelease'
_defaultOrder = ['-datereleased']
@@ -210,9 +210,9 @@
return False
+@implementer(IProductReleaseFile)
class ProductReleaseFile(SQLBase):
"""A file of a product release."""
- implements(IProductReleaseFile)
_table = 'ProductReleaseFile'
@@ -237,9 +237,9 @@
date_uploaded = UtcDateTimeCol(notNull=True, default=UTC_NOW)
+@implementer(IProductReleaseSet)
class ProductReleaseSet(object):
"""See `IProductReleaseSet`."""
- implements(IProductReleaseSet)
def getBySeriesAndVersion(self, productseries, version, default=None):
"""See `IProductReleaseSet`."""
=== modified file 'lib/lp/registry/model/productseries.py'
--- lib/lp/registry/model/productseries.py 2014-07-07 03:32:50 +0000
+++ lib/lp/registry/model/productseries.py 2015-07-08 16:13:45 +0000
@@ -30,7 +30,7 @@
)
from storm.store import Store
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from lp.app.enums import service_uses_launchpad
from lp.app.errors import NotFoundError
@@ -110,14 +110,13 @@
return date + landmark['name']
+@implementer(
+ IBugSummaryDimension, IProductSeries, IServiceUsage, ISeriesBugTarget)
class ProductSeries(SQLBase, BugTargetBase, HasMilestonesMixin,
HasSpecificationsMixin, HasTranslationImportsMixin,
HasTranslationTemplatesMixin,
StructuralSubscriptionTargetMixin, SeriesMixin):
"""A series of product releases."""
- implements(
- IBugSummaryDimension, IProductSeries, IServiceUsage,
- ISeriesBugTarget)
delegates(ISpecificationTarget, 'product')
@@ -591,9 +590,9 @@
return self.product.userCanView(user)
+@implementer(ITimelineProductSeries)
class TimelineProductSeries:
"""See `ITimelineProductSeries`."""
- implements(ITimelineProductSeries)
def __init__(self, name, status, is_development_focus, uri, landmarks,
product):
@@ -605,11 +604,10 @@
self.product = product
+@implementer(IProductSeriesSet)
class ProductSeriesSet:
"""See IProductSeriesSet."""
- implements(IProductSeriesSet)
-
def __getitem__(self, series_id):
"""See IProductSeriesSet."""
series = self.get(series_id)
=== modified file 'lib/lp/registry/model/projectgroup.py'
--- lib/lp/registry/model/projectgroup.py 2015-06-26 14:15:12 +0000
+++ lib/lp/registry/model/projectgroup.py 2015-07-08 16:13:45 +0000
@@ -25,7 +25,7 @@
)
from storm.store import Store
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from lp.answers.enums import QUESTION_STATUS_DEFAULT_SEARCH
from lp.answers.interfaces.faqcollection import IFAQCollection
@@ -105,6 +105,9 @@
from lp.translations.model.translationpolicy import TranslationPolicyMixin
+@implementer(
+ IBugSummaryDimension, IProjectGroup, IFAQCollection, IHasIcon,
+ IHasLogo, IHasMugshot, ISearchableByQuestionOwner)
class ProjectGroup(SQLBase, BugTargetBase, HasSpecificationsMixin,
MakesAnnouncements, HasSprintsMixin, HasAliasMixin,
KarmaContextMixin, StructuralSubscriptionTargetMixin,
@@ -113,10 +116,6 @@
TranslationPolicyMixin):
"""A ProjectGroup"""
- implements(
- IBugSummaryDimension, IProjectGroup, IFAQCollection, IHasIcon,
- IHasLogo, IHasMugshot, ISearchableByQuestionOwner)
-
_table = "Project"
# db field names
@@ -512,8 +511,8 @@
return False
+@implementer(IProjectGroupSet)
class ProjectGroupSet:
- implements(IProjectGroupSet)
def __init__(self):
self.title = 'Project groups registered in Launchpad'
@@ -612,11 +611,10 @@
query, distinct=True, clauseTables=clauseTables)
+@implementer(IProjectGroupSeries)
class ProjectGroupSeries(HasSpecificationsMixin):
"""See `IProjectGroupSeries`."""
- implements(IProjectGroupSeries)
-
def __init__(self, projectgroup, name):
self.projectgroup = projectgroup
self.name = name
=== modified file 'lib/lp/registry/model/series.py'
--- lib/lp/registry/model/series.py 2012-08-21 04:04:47 +0000
+++ lib/lp/registry/model/series.py 2015-07-08 16:13:45 +0000
@@ -13,7 +13,7 @@
from operator import attrgetter
from sqlobject import StringCol
-from zope.interface import implements
+from zope.interface import implementer
from lp.registry.interfaces.series import (
ISeriesMixin,
@@ -30,11 +30,10 @@
]
+@implementer(ISeriesMixin)
class SeriesMixin(HasDriversMixin):
"""See `ISeriesMixin`."""
- implements(ISeriesMixin)
-
summary = StringCol(notNull=True)
@property
=== modified file 'lib/lp/registry/model/sharingjob.py'
--- lib/lp/registry/model/sharingjob.py 2015-04-15 18:34:25 +0000
+++ lib/lp/registry/model/sharingjob.py 2015-07-08 16:13:45 +0000
@@ -35,8 +35,8 @@
from storm.store import Store
from zope.component import getUtility
from zope.interface import (
- classProvides,
- implements,
+ implementer,
+ provider,
)
from lp.app.enums import InformationType
@@ -113,11 +113,10 @@
""")
+@implementer(ISharingJob)
class SharingJob(StormBase):
"""Base class for jobs related to sharing."""
- implements(ISharingJob)
-
__storm_table__ = 'SharingJob'
id = Int(primary=True)
@@ -170,13 +169,13 @@
return SharingJobDerived.makeSubclass(self)
+@provider(ISharingJobSource)
class SharingJobDerived(BaseRunnableJob):
"""Intermediate class for deriving from SharingJob."""
__metaclass__ = EnumeratedSubclass
delegates(ISharingJob)
- classProvides(ISharingJobSource)
def __init__(self, job):
self.context = job
@@ -253,11 +252,10 @@
return vars
+@implementer(IRemoveArtifactSubscriptionsJob)
+@provider(IRemoveArtifactSubscriptionsJobSource)
class RemoveArtifactSubscriptionsJob(SharingJobDerived):
"""See `IRemoveArtifactSubscriptionsJob`."""
-
- implements(IRemoveArtifactSubscriptionsJob)
- classProvides(IRemoveArtifactSubscriptionsJobSource)
class_job_type = SharingJobType.REMOVE_ARTIFACT_SUBSCRIPTIONS
config = config.IRemoveArtifactSubscriptionsJobSource
=== modified file 'lib/lp/registry/model/sourcepackage.py'
--- lib/lp/registry/model/sourcepackage.py 2014-11-27 20:52:37 +0000
+++ lib/lp/registry/model/sourcepackage.py 2015-07-08 16:13:45 +0000
@@ -20,8 +20,8 @@
)
from zope.component import getUtility
from zope.interface import (
- classProvides,
- implements,
+ implementer,
+ provider,
)
from lp.answers.enums import QUESTION_STATUS_DEFAULT_SEARCH
@@ -184,6 +184,9 @@
return self.distribution.owner
+@implementer(
+ IBugSummaryDimension, ISourcePackage, IHasBuildRecords, ISeriesBugTarget)
+@provider(ISourcePackageFactory)
class SourcePackage(BugTargetBase, HasCodeImportsMixin,
HasTranslationImportsMixin, HasTranslationTemplatesMixin,
HasBranchesMixin, HasMergeProposalsMixin,
@@ -195,12 +198,6 @@
to the relevant database objects.
"""
- implements(
- IBugSummaryDimension, ISourcePackage, IHasBuildRecords,
- ISeriesBugTarget)
-
- classProvides(ISourcePackageFactory)
-
def __init__(self, sourcepackagename, distroseries):
# We store the ID of the sourcepackagename and distroseries
# simply because Storm can break when accessing them
=== modified file 'lib/lp/registry/model/sourcepackagename.py'
--- lib/lp/registry/model/sourcepackagename.py 2013-02-06 08:20:13 +0000
+++ lib/lp/registry/model/sourcepackagename.py 2015-07-08 16:13:45 +0000
@@ -13,7 +13,7 @@
SQLObjectNotFound,
StringCol,
)
-from zope.interface import implements
+from zope.interface import implementer
from lp.app.errors import NotFoundError
from lp.app.validators.name import valid_name
@@ -33,8 +33,8 @@
from lp.services.helpers import ensure_unicode
+@implementer(ISourcePackageName)
class SourcePackageName(SQLBase):
- implements(ISourcePackageName)
_table = 'SourcePackageName'
name = StringCol(dbName='name', notNull=True, unique=True,
@@ -59,8 +59,8 @@
ensure = classmethod(ensure)
+@implementer(ISourcePackageNameSet)
class SourcePackageNameSet:
- implements(ISourcePackageNameSet)
def __getitem__(self, name):
"""See `ISourcePackageNameSet`."""
=== modified file 'lib/lp/registry/model/suitesourcepackage.py'
--- lib/lp/registry/model/suitesourcepackage.py 2009-06-30 16:56:07 +0000
+++ lib/lp/registry/model/suitesourcepackage.py 2015-07-08 16:13:45 +0000
@@ -8,16 +8,15 @@
'SuiteSourcePackage',
]
-from zope.interface import implements
+from zope.interface import implementer
from lp.registry.interfaces.suitesourcepackage import ISuiteSourcePackage
+@implementer(ISuiteSourcePackage)
class SuiteSourcePackage:
"""Implementation of `ISuiteSourcePackage`."""
- implements(ISuiteSourcePackage)
-
def __init__(self, distroseries, pocket, sourcepackagename):
self.distroseries = distroseries
self.pocket = pocket
=== modified file 'lib/lp/registry/model/teammembership.py'
--- lib/lp/registry/model/teammembership.py 2013-06-20 05:50:00 +0000
+++ lib/lp/registry/model/teammembership.py 2015-07-08 16:13:45 +0000
@@ -22,7 +22,7 @@
from storm.info import ClassAlias
from storm.store import Store
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from lp.app.browser.tales import DurationFormatterAPI
from lp.app.interfaces.launchpad import ILaunchpadCelebrities
@@ -75,11 +75,10 @@
from lp.services.webapp import canonical_url
+@implementer(ITeamMembership)
class TeamMembership(SQLBase):
"""See `ITeamMembership`."""
- implements(ITeamMembership)
-
_table = 'TeamMembership'
_defaultOrder = 'id'
@@ -374,11 +373,10 @@
self.last_change_comment)
+@implementer(ITeamMembershipSet)
class TeamMembershipSet:
"""See `ITeamMembershipSet`."""
- implements(ITeamMembershipSet)
-
_defaultOrder = ['Person.displayname', 'Person.name']
def new(self, person, team, status, user, dateexpires=None, comment=None):
@@ -455,8 +453,8 @@
_cleanTeamParticipation(member, team)
+@implementer(ITeamParticipation)
class TeamParticipation(SQLBase):
- implements(ITeamParticipation)
_table = 'TeamParticipation'
=== modified file 'lib/lp/registry/services/sharingservice.py'
--- lib/lp/registry/services/sharingservice.py 2015-06-26 06:32:03 +0000
+++ lib/lp/registry/services/sharingservice.py 2015-07-08 16:13:45 +0000
@@ -27,7 +27,7 @@
)
from storm.store import Store
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from zope.security.interfaces import Unauthorized
from zope.traversing.browser.absoluteurl import absoluteURL
@@ -82,6 +82,7 @@
)
+@implementer(ISharingService)
class SharingService:
"""Service providing operations for adding and removing pillar grantees.
@@ -89,8 +90,6 @@
'/services/sharing?ws.op=...
"""
- implements(ISharingService)
-
@property
def name(self):
"""See `IService`."""
=== modified file 'lib/lp/registry/tests/person_from_principal.txt'
--- lib/lp/registry/tests/person_from_principal.txt 2011-12-24 17:49:30 +0000
+++ lib/lp/registry/tests/person_from_principal.txt 2015-07-08 16:13:45 +0000
@@ -18,11 +18,11 @@
got created, so that we don't have to look up the Person record every
time we adapt.
- >>> from zope.interface import implements
+ >>> from zope.interface import implementer
>>> from lp.services.webapp.interfaces import ILaunchpadPrincipal
>>> cached_person = object()
- >>> class LaunchpadPrincipal:
- ... implements(ILaunchpadPrincipal)
+ >>> @implementer(ILaunchpadPrincipal)
+ ... class LaunchpadPrincipal:
...
... person = cached_person
=== modified file 'lib/lp/registry/tests/test_productjob.py'
--- lib/lp/registry/tests/test_productjob.py 2013-06-20 05:50:00 +0000
+++ lib/lp/registry/tests/test_productjob.py 2015-07-08 16:13:45 +0000
@@ -16,8 +16,8 @@
import transaction
from zope.component import getUtility
from zope.interface import (
- classProvides,
- implements,
+ implementer,
+ provider,
)
from zope.security.proxy import removeSecurityProxy
@@ -199,18 +199,18 @@
"""An interface for testing derived job source classes."""
+@implementer(IProductThingJob)
+@provider(IProductThingJobSource)
class FakeProductJob(ProductJobDerived):
"""A class that reuses other interfaces and types for testing."""
class_job_type = ProductJobType.REVIEWER_NOTIFICATION
- implements(IProductThingJob)
- classProvides(IProductThingJobSource)
-
-
+
+
+@implementer(IProductThingJob)
+@provider(IProductThingJobSource)
class OtherFakeProductJob(ProductJobDerived):
"""A class that reuses other interfaces and types for testing."""
class_job_type = ProductJobType.COMMERCIAL_EXPIRED
- implements(IProductThingJob)
- classProvides(IProductThingJobSource)
class ProductJobDerivedTestCase(TestCaseWithFactory):
=== modified file 'lib/lp/registry/vocabularies.py'
--- lib/lp/registry/vocabularies.py 2015-01-29 13:09:37 +0000
+++ lib/lp/registry/vocabularies.py 2015-07-08 16:13:45 +0000
@@ -82,7 +82,7 @@
)
from storm.info import ClassAlias
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from zope.schema.interfaces import IVocabularyTokenized
from zope.schema.vocabulary import (
SimpleTerm,
@@ -244,9 +244,9 @@
_orderBy = 'name'
+@implementer(IHugeVocabulary)
class ProductVocabulary(SQLObjectVocabularyBase):
"""All `IProduct` objects vocabulary."""
- implements(IHugeVocabulary)
step_title = 'Search'
_table = Product
@@ -308,9 +308,9 @@
return self.emptySelectResults()
+@implementer(IHugeVocabulary)
class ProjectGroupVocabulary(SQLObjectVocabularyBase):
"""All `IProjectGroup` objects vocabulary."""
- implements(IHugeVocabulary)
_table = ProjectGroup
_orderBy = 'displayname'
@@ -402,6 +402,7 @@
raise LookupError(token)
+@implementer(IHugeVocabulary)
class NonMergedPeopleAndTeamsVocabulary(
BasePersonVocabulary, SQLObjectVocabularyBase):
"""The set of all non-merged people and teams.
@@ -410,7 +411,6 @@
the people provided by it know how to deal with people which don't have
a preferred email address, that is, unvalidated person profiles.
"""
- implements(IHugeVocabulary)
_orderBy = ['displayname']
displayname = 'Select a Person or Team'
@@ -434,6 +434,7 @@
return self._select(ensure_unicode(text))
+@implementer(IHugeVocabulary)
class PersonAccountToMergeVocabulary(
BasePersonVocabulary, SQLObjectVocabularyBase):
"""The set of all non-merged people with at least one email address.
@@ -441,7 +442,6 @@
This vocabulary is a very specialized one, meant to be used only to choose
accounts to merge. You *don't* want to use it.
"""
- implements(IHugeVocabulary)
_orderBy = ['displayname']
displayname = 'Select a Person to Merge'
@@ -504,6 +504,7 @@
return [Person.teamownerID != None]
+@implementer(IHugeVocabulary)
class ValidPersonOrTeamVocabulary(
BasePersonVocabulary, SQLObjectVocabularyBase):
"""The set of valid, viewable Persons/Teams in Launchpad.
@@ -517,7 +518,6 @@
ValidMaintainer and ValidOwner, because they have exactly the same
requisites.
"""
- implements(IHugeVocabulary)
displayname = 'Select a Person or Team'
step_title = 'Search'
@@ -877,11 +877,10 @@
tp_alias.personID == user.id))]
+@implementer(IVocabularyTokenized)
class PersonActiveMembershipVocabulary:
"""All the teams the person is an active member of."""
- implements(IVocabularyTokenized)
-
def __init__(self, context):
assert IPerson.providedBy(context)
self.context = context
@@ -949,11 +948,10 @@
super(NewPillarGranteeVocabulary, self).extra_clause)
+@implementer(IHugeVocabulary)
class ActiveMailingListVocabulary(FilteredVocabularyBase):
"""The set of all active mailing lists."""
- implements(IHugeVocabulary)
-
displayname = 'Select an active mailing list.'
step_title = 'Search'
@@ -1106,9 +1104,9 @@
return SimpleTerm(obj, obj.name, obj.displayname)
+@implementer(IHugeVocabulary)
class ProductReleaseVocabulary(SQLObjectVocabularyBase):
"""All `IProductRelease` objects vocabulary."""
- implements(IHugeVocabulary)
displayname = 'Select a Product Release'
step_title = 'Search'
@@ -1174,9 +1172,9 @@
return objs
+@implementer(IHugeVocabulary)
class ProductSeriesVocabulary(SQLObjectVocabularyBase):
"""All `IProductSeries` objects vocabulary."""
- implements(IHugeVocabulary)
displayname = 'Select a Release Series'
step_title = 'Search'
@@ -1399,6 +1397,7 @@
return term
+@implementer(IHugeVocabulary)
class CommercialProjectsVocabulary(NamedSQLObjectVocabulary):
"""List all commercial projects.
@@ -1408,8 +1407,6 @@
if the user is a registry expert.
"""
- implements(IHugeVocabulary)
-
_table = Product
_orderBy = 'displayname'
step_title = 'Search'
@@ -1560,6 +1557,7 @@
return objs
+@implementer(IHugeVocabulary)
class DistroSeriesDerivationVocabulary(FilteredVocabularyBase):
"""A vocabulary source for series to derive from.
@@ -1578,8 +1576,6 @@
series at the same time.
"""
- implements(IHugeVocabulary)
-
displayname = "Add a parent series"
step_title = 'Search'
@@ -1682,14 +1678,13 @@
return self.find_terms(where)
+@implementer(IHugeVocabulary)
class DistroSeriesDifferencesVocabulary(FilteredVocabularyBase):
"""A vocabulary source for differences relating to a series.
Specifically, all `DistroSeriesDifference`s relating to a derived series.
"""
- implements(IHugeVocabulary)
-
displayname = "Choose a difference"
step_title = 'Search'
=== modified file 'lib/lp/registry/xmlrpc/canonicalsso.py'
--- lib/lp/registry/xmlrpc/canonicalsso.py 2012-02-16 20:37:55 +0000
+++ lib/lp/registry/xmlrpc/canonicalsso.py 2015-07-08 16:13:45 +0000
@@ -11,7 +11,7 @@
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from zope.security.proxy import removeSecurityProxy
from lp.registry.interfaces.person import (
@@ -23,11 +23,10 @@
from lp.services.webapp import LaunchpadXMLRPCView
+@implementer(ICanonicalSSOAPI)
class CanonicalSSOAPI(LaunchpadXMLRPCView):
"""See `ICanonicalSSOAPI`."""
- implements(ICanonicalSSOAPI)
-
def getPersonDetailsByOpenIDIdentifier(self, openid_identifier):
try:
account = getUtility(IAccountSet).getByOpenIDIdentifier(
@@ -49,8 +48,8 @@
}
+@implementer(ICanonicalSSOApplication)
class CanonicalSSOApplication:
"""Canonical SSO end-point."""
- implements(ICanonicalSSOApplication)
title = "Canonical SSO API"
=== modified file 'lib/lp/registry/xmlrpc/mailinglist.py'
--- lib/lp/registry/xmlrpc/mailinglist.py 2013-01-03 17:17:29 +0000
+++ lib/lp/registry/xmlrpc/mailinglist.py 2015-07-08 16:13:45 +0000
@@ -12,7 +12,7 @@
import xmlrpclib
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from zope.security.proxy import removeSecurityProxy
from lp.registry.enums import PersonVisibility
@@ -48,11 +48,10 @@
BYUSER = 2
+@implementer(IMailingListAPIView)
class MailingListAPIView(LaunchpadXMLRPCView):
"""The XMLRPC API that Mailman polls for mailing list actions."""
- implements(IMailingListAPIView)
-
def getPendingActions(self):
"""See `IMailingListAPIView`."""
list_set = getUtility(IMailingListSet)
=== modified file 'lib/lp/services/apachelogparser/model/parsedapachelog.py'
--- lib/lp/services/apachelogparser/model/parsedapachelog.py 2013-06-20 05:50:00 +0000
+++ lib/lp/services/apachelogparser/model/parsedapachelog.py 2015-07-08 16:13:45 +0000
@@ -9,7 +9,7 @@
Storm,
Unicode,
)
-from zope.interface import implements
+from zope.interface import implementer
from lp.services.apachelogparser.interfaces.parsedapachelog import (
IParsedApacheLog,
@@ -19,10 +19,9 @@
from lp.services.database.interfaces import IStore
+@implementer(IParsedApacheLog)
class ParsedApacheLog(Storm):
"""See `IParsedApacheLog`"""
-
- implements(IParsedApacheLog)
__storm_table__ = 'ParsedApacheLog'
id = Int(primary=True)
=== modified file 'lib/lp/services/authserver/xmlrpc.py'
--- lib/lp/services/authserver/xmlrpc.py 2012-01-01 02:58:52 +0000
+++ lib/lp/services/authserver/xmlrpc.py 2015-07-08 16:13:45 +0000
@@ -11,7 +11,7 @@
]
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from lp.registry.interfaces.person import IPersonSet
from lp.services.authserver.interfaces import (
@@ -22,11 +22,10 @@
from lp.xmlrpc import faults
+@implementer(IAuthServer)
class AuthServerAPIView(LaunchpadXMLRPCView):
"""See `IAuthServer`."""
- implements(IAuthServer)
-
def getUserAndSSHKeys(self, name):
"""See `IAuthServer.getUserAndSSHKeys`."""
person = getUtility(IPersonSet).getByName(name)
@@ -40,9 +39,9 @@
}
+@implementer(IAuthServerApplication)
class AuthServerApplication:
"""AuthServer End-Point."""
- implements(IAuthServerApplication)
title = "Auth Server"
=== modified file 'lib/lp/services/database/multitablecopy.py'
--- lib/lp/services/database/multitablecopy.py 2012-04-06 17:28:25 +0000
+++ lib/lp/services/database/multitablecopy.py 2015-07-08 16:13:45 +0000
@@ -9,7 +9,7 @@
import re
import time
-from zope.interface import implements
+from zope.interface import implementer
from lp.services.database import postgresql
from lp.services.database.sqlbase import (
@@ -23,12 +23,12 @@
)
+@implementer(ITunableLoop)
class PouringLoop:
"""Loop body to pour data from holding tables back into source tables.
Used by MultiTableCopy internally to tell DBLoopTuner what to do.
"""
- implements(ITunableLoop)
def __init__(self, from_table, to_table, transaction_manager, logger,
batch_pouring_callback=None):
=== modified file 'lib/lp/services/database/policy.py'
--- lib/lp/services/database/policy.py 2014-01-30 15:04:06 +0000
+++ lib/lp/services/database/policy.py 2015-07-08 16:13:45 +0000
@@ -29,7 +29,7 @@
from zope.component import getUtility
from zope.interface import (
alsoProvides,
- implements,
+ implementer,
)
from zope.session.interfaces import (
IClientIdManager,
@@ -103,9 +103,9 @@
raise DisconnectionError(str(exc))
+@implementer(IDatabasePolicy)
class BaseDatabasePolicy:
"""Base class for database policies."""
- implements(IDatabasePolicy)
# The default flavor to use.
default_flavor = MASTER_FLAVOR
=== modified file 'lib/lp/services/database/sqlbase.py'
--- lib/lp/services/database/sqlbase.py 2015-03-07 02:04:04 +0000
+++ lib/lp/services/database/sqlbase.py 2015-07-08 16:13:45 +0000
@@ -52,7 +52,7 @@
from storm.zope.interfaces import IZStorm
from twisted.python.util import mergeFunctionMetadata
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from zope.security.proxy import removeSecurityProxy
from lp.services.config import dbconfig
@@ -156,10 +156,10 @@
return table.__str__()
+@implementer(ISQLBase)
class SQLBase(storm.sqlobject.SQLObjectBase):
"""Base class emulating SQLObject for legacy database classes.
"""
- implements(ISQLBase)
_style = LaunchpadStyle()
# Silence warnings in linter script, which complains about all
=== modified file 'lib/lp/services/doc/looptuner.txt'
--- lib/lp/services/doc/looptuner.txt 2013-03-22 00:14:47 +0000
+++ lib/lp/services/doc/looptuner.txt 2015-07-08 16:13:45 +0000
@@ -19,7 +19,7 @@
adjust themselves dynamically to actual performance.
>>> import math
- >>> from zope.interface import implements
+ >>> from zope.interface import implementer
>>> from lp.services.looptuner import ITunableLoop
>>> from lp.services.looptuner import LoopTuner
@@ -63,8 +63,8 @@
... order_of_magnitude = math.log10(ratio)
... print "%s (%.1f)" % (change, order_of_magnitude)
- >>> class PlannedLoop:
- ... implements(ITunableLoop)
+ >>> @implementer(ITunableLoop)
+ ... class PlannedLoop:
... def __init__(self, timings):
... self.last_chunk_size = None
... self.iteration = 0
@@ -185,8 +185,8 @@
This variant of the LoopTuner simulates an overridable cost function:
- >>> class CostedLoop:
- ... implements(ITunableLoop)
+ >>> @implementer(ITunableLoop)
+ ... class CostedLoop:
... def __init__(self, cost_function, counter):
... self.last_chunk_size = None
... self.iteration = 0
@@ -391,8 +391,8 @@
SimpleLoop is a loop that does a constant number of iterations, regardless
of the actual run-time.
- >>> class SimpleLoop:
- ... implements(ITunableLoop)
+ >>> @implementer(ITunableLoop)
+ ... class SimpleLoop:
... def __init__(self, iterations):
... self.total_iterations = iterations
... self.iteration = 0
=== modified file 'lib/lp/services/features/xmlrpc.py'
--- lib/lp/services/features/xmlrpc.py 2012-01-01 02:58:52 +0000
+++ lib/lp/services/features/xmlrpc.py 2015-07-08 16:13:45 +0000
@@ -10,7 +10,7 @@
]
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from lp.registry.interfaces.person import IPersonSet
from lp.services.features.flags import FeatureController
@@ -39,10 +39,9 @@
"""
+@implementer(IFeatureFlagApplication)
class FeatureFlagApplication:
- implements(IFeatureFlagApplication)
-
def getFeatureFlag(self, flag_name, active_scopes=()):
scopes = list(default_scopes)
for scope_name in active_scopes:
=== modified file 'lib/lp/services/feeds/browser.py'
--- lib/lp/services/feeds/browser.py 2011-12-30 07:32:58 +0000
+++ lib/lp/services/feeds/browser.py 2015-07-08 16:13:45 +0000
@@ -24,7 +24,7 @@
]
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from zope.publisher.interfaces import NotFound
from zope.security.interfaces import Unauthorized
@@ -65,11 +65,10 @@
from lp.services.webapp.vhosts import allvhosts
+@implementer(ICanonicalUrlData)
class FeedsRootUrlData:
"""`ICanonicalUrlData` for Feeds."""
- implements(ICanonicalUrlData)
-
path = ''
inside = None
rootsite = 'feeds'
=== modified file 'lib/lp/services/feeds/feed.py'
--- lib/lp/services/feeds/feed.py 2012-11-29 06:35:35 +0000
+++ lib/lp/services/feeds/feed.py 2015-07-08 16:13:45 +0000
@@ -26,7 +26,7 @@
from z3c.ptcompat import ViewPageTemplateFile
from zope.component import getUtility
from zope.datetime import rfc1123_date
-from zope.interface import implements
+from zope.interface import implementer
from lp.services.config import config
from lp.services.feeds.interfaces.feed import (
@@ -53,14 +53,13 @@
MINUTES = 60 # Seconds in a minute.
+@implementer(IFeed)
class FeedBase(LaunchpadView):
"""See `IFeed`.
Base class for feeds.
"""
- implements(IFeed)
-
# convert to seconds
max_age = config.launchpad.max_feed_cache_minutes * MINUTES
quantity = 25
@@ -221,14 +220,13 @@
return ViewPageTemplateFile(self.template_files['html'])(self)
+@implementer(IFeedEntry)
class FeedEntry:
"""See `IFeedEntry`.
An individual entry for a feed.
"""
- implements(IFeedEntry)
-
def __init__(self,
title,
link_alternate,
@@ -272,11 +270,10 @@
url_path)
+@implementer(IFeedTypedData)
class FeedTypedData:
"""Data for a feed that includes its type."""
- implements(IFeedTypedData)
-
content_types = ['text', 'html', 'xhtml']
def __init__(self, content, content_type='text', root_url=None):
@@ -312,6 +309,7 @@
return altered_content
+@implementer(IFeedPerson)
class FeedPerson:
"""See `IFeedPerson`.
@@ -319,8 +317,6 @@
addresses.
"""
- implements(IFeedPerson)
-
def __init__(self, person, rootsite):
self.name = person.displayname
# We don't want to disclose email addresses in public feeds.
=== modified file 'lib/lp/services/feeds/tests/helper.py'
--- lib/lp/services/feeds/tests/helper.py 2012-03-22 23:21:24 +0000
+++ lib/lp/services/feeds/tests/helper.py 2015-07-08 16:13:45 +0000
@@ -28,7 +28,7 @@
from zope.interface import (
Attribute,
- implements,
+ implementer,
Interface,
)
from BeautifulSoup import BeautifulStoneSoup as BSS
@@ -41,8 +41,8 @@
value = Attribute('the value of the thing')
+@implementer(IThing)
class Thing(object):
- implements(IThing)
def __init__(self, value):
self.value = value
=== modified file 'lib/lp/services/fields/__init__.py'
--- lib/lp/services/fields/__init__.py 2015-01-29 13:09:37 +0000
+++ lib/lp/services/fields/__init__.py 2015-07-08 16:13:45 +0000
@@ -68,7 +68,7 @@
URI,
)
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from zope.schema import (
Bool,
Bytes,
@@ -231,8 +231,8 @@
"""
+@implementer(IStrippedTextLine)
class StrippedTextLine(TextLine):
- implements(IStrippedTextLine)
def set(self, object, value):
"""Strip the value and pass up."""
@@ -241,15 +241,17 @@
super(StrippedTextLine, self).set(object, value)
+@implementer(INoneableTextLine)
class NoneableTextLine(StrippedTextLine):
- implements(INoneableTextLine)
+ pass
# Title
# A field to capture a launchpad object title
+@implementer(ITitle)
class Title(StrippedTextLine):
- implements(ITitle)
+ pass
class StrippableText(Text):
@@ -283,35 +285,39 @@
# Summary
# A field capture a Launchpad object summary
+@implementer(ISummary)
class Summary(StrippableText):
- implements(ISummary)
+ pass
# Description
# A field capture a Launchpad object description
+@implementer(IDescription)
class Description(StrippableText):
- implements(IDescription)
-
-
+ pass
+
+
+@implementer(INoneableDescription)
class NoneableDescription(Description):
- implements(INoneableDescription)
+ pass
# Whiteboard
# A field capture a Launchpad object whiteboard
+@implementer(IWhiteboard)
class Whiteboard(StrippableText):
- implements(IWhiteboard)
-
-
+ pass
+
+
+@implementer(IDate)
class FormattableDate(Date):
"""A datetime field that checks for compatibility with Python's strformat.
From the user's perspective this is a date entry field; it converts to and
from datetime because that's what the db is expecting.
"""
- implements(IDate)
def _validate(self, value):
error_msg = ("Date could not be formatted. Provide a date formatted "
@@ -327,16 +333,17 @@
raise LaunchpadValidationError(error_msg)
+@implementer(IDatetime)
class AnnouncementDate(Datetime):
- implements(IDatetime)
+ pass
# TimeInterval
# A field to capture an interval in time, such as X days, Y hours, Z
# minutes.
+@implementer(ITimeInterval)
class TimeInterval(TextLine):
- implements(ITimeInterval)
def _validate(self, value):
if 'mon' in value:
@@ -344,8 +351,8 @@
return 1
+@implementer(IBugField)
class BugField(Reference):
- implements(IBugField)
def __init__(self, *args, **kwargs):
"""The schema will always be `IBug`."""
@@ -391,10 +398,9 @@
return True
+@implementer(ITag)
class Tag(TextLine):
- implements(ITag)
-
def constraint(self, value):
"""Make sure that the value is a valid name."""
super_constraint = TextLine.constraint(self, value)
@@ -566,6 +572,7 @@
return " ".join(object.aliases)
+@implementer(IReferenceChoice)
class ProductBugTracker(Choice):
"""A bug tracker used by a Product.
@@ -574,7 +581,6 @@
This field uses two attributes on the Product to model its state:
'official_malone' and 'bugtracker'
"""
- implements(IReferenceChoice)
malone_marker = object()
@property
@@ -600,8 +606,8 @@
setattr(ob, self.__name__, value)
+@implementer(IURIField)
class URIField(TextLine):
- implements(IURIField)
def __init__(self, allowed_schemes=(), allow_userinfo=True,
allow_port=True, allow_query=True, allow_fragment=True,
@@ -673,6 +679,7 @@
"""The field is not bound to any object."""
+@implementer(IBaseImageUpload)
class BaseImageUpload(Bytes):
"""Base class for ImageUpload fields.
@@ -683,8 +690,6 @@
- max_size: the maximum size of the image, in bytes.
"""
- implements(IBaseImageUpload)
-
exact_dimensions = True
dimensions = ()
max_size = 0
@@ -776,11 +781,10 @@
max_size = 100 * 1024
+@implementer(ILocationField)
class LocationField(Field):
"""A Location field."""
- implements(ILocationField)
-
@property
def latitude(self):
return self.value.latitude
@@ -843,13 +847,13 @@
"""A marker for a choice among people."""
+@implementer(IPersonChoice)
class PersonChoice(Choice):
"""A person or team.
This is useful as a superclass and provides a clearer error message than
"Constraint not satisfied".
"""
- implements(IPersonChoice)
schema = IObject # Will be set to IPerson once IPerson is defined.
=== modified file 'lib/lp/services/fields/doc/uri-field.txt'
--- lib/lp/services/fields/doc/uri-field.txt 2013-04-10 08:35:47 +0000
+++ lib/lp/services/fields/doc/uri-field.txt 2015-07-08 16:13:45 +0000
@@ -13,7 +13,7 @@
To demonstrate, we'll create a sample interface:
- >>> from zope.interface import Interface, implements
+ >>> from zope.interface import Interface, implementer
>>> from lp.services.fields import URIField
>>> class IURIFieldTest(Interface):
... field = URIField()
@@ -181,8 +181,8 @@
>>> from lp.app.widgets.textwidgets import URIWidget
>>> from lp.services.webapp.servers import LaunchpadTestRequest
- >>> class URIFieldTest(object):
- ... implements(IURIFieldTest)
+ >>> @implementer(IURIFieldTest)
+ ... class URIFieldTest(object):
... field = None
>>> context = URIFieldTest()
=== modified file 'lib/lp/services/geoip/model.py'
--- lib/lp/services/geoip/model.py 2011-12-29 05:29:36 +0000
+++ lib/lp/services/geoip/model.py 2015-07-08 16:13:45 +0000
@@ -13,7 +13,7 @@
import GeoIP as libGeoIP
from zope.component import getUtility
from zope.i18n.interfaces import IUserPreferredLanguages
-from zope.interface import implements
+from zope.interface import implementer
from lp.services.config import config
from lp.services.geoip.helpers import ipaddress_from_request
@@ -28,9 +28,9 @@
from lp.services.worlddata.interfaces.language import ILanguageSet
+@implementer(IGeoIP)
class GeoIP:
"""See `IGeoIP`."""
- implements(IGeoIP)
@cachedproperty
def _gi(self):
@@ -68,9 +68,9 @@
return country
+@implementer(IGeoIPRecord)
class GeoIPRequest:
"""An adapter for a BrowserRequest into an IGeoIPRecord."""
- implements(IGeoIPRecord)
def __init__(self, request):
self.request = request
@@ -106,10 +106,9 @@
return self.geoip_record['time_zone']
+@implementer(IRequestLocalLanguages)
class RequestLocalLanguages(object):
- implements(IRequestLocalLanguages)
-
def __init__(self, request):
self.request = request
@@ -130,10 +129,9 @@
return sorted(languages, key=lambda x: x.englishname)
+@implementer(IRequestPreferredLanguages)
class RequestPreferredLanguages(object):
- implements(IRequestPreferredLanguages)
-
def __init__(self, request):
self.request = request
=== modified file 'lib/lp/services/googlesearch/__init__.py'
--- lib/lp/services/googlesearch/__init__.py 2013-01-07 02:40:55 +0000
+++ lib/lp/services/googlesearch/__init__.py 2015-07-08 16:13:45 +0000
@@ -21,7 +21,7 @@
from lazr.restful.utils import get_current_browser_request
from lazr.uri import URI
-from zope.interface import implements
+from zope.interface import implementer
from lp.services.config import config
from lp.services.googlesearch.interfaces import (
@@ -36,12 +36,12 @@
from lp.services.webapp import urlparse
+@implementer(ISearchResult)
class PageMatch:
"""See `ISearchResult`.
A search result that represents a web page.
"""
- implements(ISearchResult)
@property
def url_rewrite_exceptions(self):
@@ -124,12 +124,12 @@
return self._strip_trailing_slash(url)
+@implementer(ISearchResults)
class PageMatches:
"""See `ISearchResults`.
A collection of PageMatches.
"""
- implements(ISearchResults)
def __init__(self, matches, start, total):
"""initialize a PageMatches.
@@ -156,12 +156,12 @@
return iter(self._matches)
+@implementer(ISearchService)
class GoogleSearchService:
"""See `ISearchService`.
A search service that search Google for launchpad.net pages.
"""
- implements(ISearchService)
_default_values = {
'client': 'google-csbe',
=== modified file 'lib/lp/services/gpg/handler.py'
--- lib/lp/services/gpg/handler.py 2015-06-24 00:17:11 +0000
+++ lib/lp/services/gpg/handler.py 2015-07-08 16:13:45 +0000
@@ -24,7 +24,7 @@
import gpgme
from lazr.restful.utils import get_current_browser_request
-from zope.interface import implements
+from zope.interface import implementer
from lp.app.validators.email import valid_email
from lp.services.config import config
@@ -64,11 +64,10 @@
"""
+@implementer(IGPGHandler)
class GPGHandler:
"""See IGPGHandler."""
- implements(IGPGHandler)
-
def __init__(self):
"""Initialize environment variable."""
self._setNewHome()
@@ -514,9 +513,9 @@
return urlfetch(url)
+@implementer(IPymeSignature)
class PymeSignature(object):
"""See IPymeSignature."""
- implements(IPymeSignature)
def __init__(self, fingerprint=None, plain_data=None, timestamp=None):
"""Initialized a signature container."""
@@ -525,9 +524,9 @@
self.timestamp = timestamp
+@implementer(IPymeKey)
class PymeKey:
"""See IPymeKey."""
- implements(IPymeKey)
fingerprint = None
exists_in_local_keyring = False
@@ -601,9 +600,9 @@
return keydata.getvalue()
+@implementer(IPymeUserId)
class PymeUserId:
"""See IPymeUserId"""
- implements(IPymeUserId)
def __init__(self, uid):
self.revoked = uid.revoked
=== modified file 'lib/lp/services/identity/model/account.py'
--- lib/lp/services/identity/model/account.py 2015-01-07 00:35:53 +0000
+++ lib/lp/services/identity/model/account.py 2015-07-08 16:13:45 +0000
@@ -13,7 +13,7 @@
from sqlobject import StringCol
from storm.locals import ReferenceSet
-from zope.interface import implements
+from zope.interface import implementer
from lp.services.database.constants import UTC_NOW
from lp.services.database.datetimecol import UtcDateTimeCol
@@ -41,11 +41,10 @@
super(AccountStatusEnumCol, self).__set__(obj, value)
+@implementer(IAccount)
class Account(SQLBase):
"""An Account."""
- implements(IAccount)
-
date_created = UtcDateTimeCol(notNull=True, default=UTC_NOW)
displayname = StringCol(dbName='displayname', notNull=True)
@@ -89,9 +88,9 @@
self.setStatus(AccountStatus.ACTIVE, None, comment)
+@implementer(IAccountSet)
class AccountSet:
"""See `IAccountSet`."""
- implements(IAccountSet)
def new(self, rationale, displayname, openid_identifier=None):
"""See `IAccountSet`."""
=== modified file 'lib/lp/services/identity/model/emailaddress.py'
--- lib/lp/services/identity/model/emailaddress.py 2013-01-07 02:40:55 +0000
+++ lib/lp/services/identity/model/emailaddress.py 2015-07-08 16:13:45 +0000
@@ -17,7 +17,7 @@
ForeignKey,
StringCol,
)
-from zope.interface import implements
+from zope.interface import implementer
from lp.app.validators.email import valid_email
from lp.services.database.enumcol import EnumCol
@@ -44,8 +44,8 @@
owner = property(operator.attrgetter('person'))
+@implementer(IEmailAddress)
class EmailAddress(SQLBase, HasOwnerMixin):
- implements(IEmailAddress)
_table = 'EmailAddress'
_defaultOrder = ['email']
@@ -91,8 +91,8 @@
return hashlib.sha1('mailto:' + self.email).hexdigest().upper()
+@implementer(IEmailAddressSet)
class EmailAddressSet:
- implements(IEmailAddressSet)
def getByPerson(self, person):
"""See `IEmailAddressSet`."""
=== modified file 'lib/lp/services/job/model/job.py'
--- lib/lp/services/job/model/job.py 2013-07-04 05:59:33 +0000
+++ lib/lp/services/job/model/job.py 2015-07-08 16:13:45 +0000
@@ -30,7 +30,7 @@
Reference,
)
import transaction
-from zope.interface import implements
+from zope.interface import implementer
from lp.services.database import bulk
from lp.services.database.constants import UTC_NOW
@@ -57,11 +57,10 @@
(current_status, requested_status))
+@implementer(IJob)
class Job(SQLBase):
"""See `IJob`."""
- implements(IJob)
-
@property
def job_id(self):
return self.id
=== modified file 'lib/lp/services/job/tests/test_retry_jobs_with_celery.py'
--- lib/lp/services/job/tests/test_retry_jobs_with_celery.py 2013-06-20 05:50:00 +0000
+++ lib/lp/services/job/tests/test_retry_jobs_with_celery.py 2015-07-08 16:13:45 +0000
@@ -9,7 +9,7 @@
from lazr.delegates import delegates
import transaction
-from zope.interface import implements
+from zope.interface import implementer
from lp.services.config import config
from lp.services.database.interfaces import IStore
@@ -26,10 +26,9 @@
from lp.testing.layers import CeleryJobLayer
+@implementer(IRunnableJob)
class TestJob(BaseRunnableJob):
"""A dummy job."""
-
- implements(IRunnableJob)
delegates(IJob, 'job')
config = config.launchpad
=== modified file 'lib/lp/services/job/tests/test_runner.py'
--- lib/lp/services/job/tests/test_runner.py 2013-07-23 10:40:22 +0000
+++ lib/lp/services/job/tests/test_runner.py 2015-07-08 16:13:45 +0000
@@ -16,7 +16,7 @@
from testtools.matchers import MatchesRegex
from testtools.testcase import ExpectedException
import transaction
-from zope.interface import implements
+from zope.interface import implementer
from lp.services.config import config
from lp.services.features.testing import FeatureFixture
@@ -42,11 +42,10 @@
from lp.testing.mail_helpers import pop_notifications
+@implementer(IRunnableJob)
class NullJob(BaseRunnableJob):
"""A job that does nothing but append a string to a list."""
- implements(IRunnableJob)
-
JOB_COMPLETIONS = []
def __init__(self, completion_message, oops_recipients=None,
@@ -292,8 +291,9 @@
runner = JobRunner([object()])
self.assertRaises(TypeError, runner.runAll)
+ @implementer(IRunnableJob)
class Runnable:
- implements(IRunnableJob)
+ pass
runner = JobRunner([Runnable()])
self.assertRaises(AttributeError, runner.runAll)
@@ -398,9 +398,9 @@
return cls(index, *args)
+@implementer(IRunnableJob)
class StuckJob(StaticJobSource):
"""Simulation of a job that stalls."""
- implements(IRunnableJob)
done = False
@@ -440,10 +440,9 @@
]
+@implementer(IRunnableJob)
class InitialFailureJob(StaticJobSource):
- implements(IRunnableJob)
-
jobs = [(True,), (False,)]
has_failed = False
@@ -464,10 +463,9 @@
raise ValueError('Previous failure.')
+@implementer(IRunnableJob)
class ProcessSharingJob(StaticJobSource):
- implements(IRunnableJob)
-
jobs = [(True,), (False,)]
initial_job_was_here = False
@@ -487,10 +485,9 @@
raise ValueError('Different process.')
+@implementer(IRunnableJob)
class MemoryHogJob(StaticJobSource):
- implements(IRunnableJob)
-
jobs = [()]
done = False
@@ -512,10 +509,9 @@
jobs = []
+@implementer(IRunnableJob)
class LeaseHeldJob(StaticJobSource):
- implements(IRunnableJob)
-
jobs = [()]
done = False
=== modified file 'lib/lp/services/librarian/client.py'
--- lib/lp/services/librarian/client.py 2013-06-20 05:50:00 +0000
+++ lib/lp/services/librarian/client.py 2015-07-08 16:13:45 +0000
@@ -32,7 +32,7 @@
from lazr.restful.utils import get_current_browser_request
from storm.store import Store
-from zope.interface import implements
+from zope.interface import implementer
from lp.services.config import (
config,
@@ -502,9 +502,9 @@
raise
+@implementer(ILibrarianClient)
class LibrarianClient(FileUploadClient, FileDownloadClient):
"""See `ILibrarianClient`."""
- implements(ILibrarianClient)
restricted = False
@@ -529,9 +529,9 @@
)
+@implementer(IRestrictedLibrarianClient)
class RestrictedLibrarianClient(LibrarianClient):
"""See `IRestrictedLibrarianClient`."""
- implements(IRestrictedLibrarianClient)
restricted = True
=== modified file 'lib/lp/services/librarian/model.py'
--- lib/lp/services/librarian/model.py 2015-02-15 23:36:11 +0000
+++ lib/lp/services/librarian/model.py 2015-07-08 16:13:45 +0000
@@ -37,7 +37,7 @@
getUtility,
)
from zope.interface import (
- implements,
+ implementer,
Interface,
)
@@ -70,11 +70,10 @@
from lp.services.tokens import create_token
+@implementer(ILibraryFileContent)
class LibraryFileContent(SQLBase):
"""A pointer to file content in the librarian."""
- implements(ILibraryFileContent)
-
_table = 'LibraryFileContent'
datecreated = UtcDateTimeCol(notNull=True, default=UTC_NOW)
@@ -84,11 +83,10 @@
md5 = StringCol(notNull=True)
+@implementer(ILibraryFileAlias)
class LibraryFileAlias(SQLBase):
"""A filename and mimetype that we can serve some given content with."""
- implements(ILibraryFileAlias)
-
_table = 'LibraryFileAlias'
date_created = UtcDateTimeCol(notNull=False, default=DEFAULT)
content = ForeignKey(
@@ -227,11 +225,11 @@
self.close()
+@implementer(ILibraryFileAliasWithParent)
class LibraryFileAliasWithParent:
"""A LibraryFileAlias variant that has a parent."""
adapts(ILibraryFileAlias, Interface)
- implements(ILibraryFileAliasWithParent)
delegates(ILibraryFileAlias)
def __init__(self, libraryfile, parent):
@@ -243,11 +241,10 @@
return TimeLimitedToken.allocate(self.private_url)
+@implementer(ILibraryFileAliasSet)
class LibraryFileAliasSet(object):
"""Create and find LibraryFileAliases."""
- implements(ILibraryFileAliasSet)
-
def create(self, name, size, file, contentType, expires=None,
debugID=None, restricted=False):
"""See `ILibraryFileAliasSet`"""
@@ -275,10 +272,9 @@
""" % sha1, clauseTables=['LibraryFileContent'])
+@implementer(ILibraryFileDownloadCount)
class LibraryFileDownloadCount(SQLBase):
"""See `ILibraryFileDownloadCount`"""
-
- implements(ILibraryFileDownloadCount)
__storm_table__ = 'LibraryFileDownloadCount'
id = Int(primary=True)
=== modified file 'lib/lp/services/librarianserver/librariangc.py'
--- lib/lp/services/librarianserver/librariangc.py 2015-01-16 16:44:27 +0000
+++ lib/lp/services/librarianserver/librariangc.py 2015-07-08 16:13:45 +0000
@@ -17,7 +17,7 @@
import iso8601
from swiftclient import client as swiftclient
-from zope.interface import implements
+from zope.interface import implementer
from lp.services.config import config
from lp.services.database.postgresql import (
@@ -290,13 +290,13 @@
con.commit()
+@implementer(ITunableLoop)
class ExpireAliases:
"""Expire expired LibraryFileAlias records.
This simply involves setting the LibraryFileAlias.content to NULL.
Unreferenced LibraryFileContent records are cleaned up elsewhere.
"""
- implements(ITunableLoop)
def __init__(self, con):
self.con = con
@@ -339,6 +339,7 @@
loop_tuner.run()
+@implementer(ITunableLoop)
class UnreferencedLibraryFileAliasPruner:
"""Delete unreferenced LibraryFileAliases.
@@ -350,7 +351,6 @@
in the database and delete them, if they are expired (expiry in the past
or NULL).
"""
- implements(ITunableLoop)
def __init__(self, con):
self.con = con # Database connection to use
@@ -467,6 +467,7 @@
loop_tuner.run()
+@implementer(ITunableLoop)
class UnreferencedContentPruner:
"""Delete LibraryFileContent entries and their disk files that are
not referenced by any LibraryFileAlias entries.
@@ -474,7 +475,6 @@
Note that a LibraryFileContent can only be accessed through a
LibraryFileAlias, so all entries in this state are garbage.
"""
- implements(ITunableLoop)
def __init__(self, con):
self.swift_enabled = getFeatureFlag(
=== modified file 'lib/lp/services/librarianserver/testing/fake.py'
--- lib/lp/services/librarianserver/testing/fake.py 2013-06-14 04:51:40 +0000
+++ lib/lp/services/librarianserver/testing/fake.py 2015-07-08 16:13:45 +0000
@@ -23,7 +23,7 @@
import transaction
from transaction.interfaces import ISynchronizer
import zope.component
-from zope.interface import implements
+from zope.interface import implementer
from lp.services.config import config
from lp.services.librarian.client import get_libraryfilealias_download_path
@@ -59,14 +59,16 @@
return self._datafile.read(chunksize)
+_fake_librarian_provided_utilities = [ILibrarianClient, ILibraryFileAliasSet]
+
+
+@implementer(ISynchronizer, *_fake_librarian_provided_utilities)
class FakeLibrarian(Fixture):
"""A test double Librarian which works in-process.
This takes the role of both the librarian client and the LibraryFileAlias
utility.
"""
- provided_utilities = [ILibrarianClient, ILibraryFileAliasSet]
- implements(ISynchronizer, *provided_utilities)
def setUp(self):
"""Fixture API: install as the librarian."""
@@ -77,7 +79,7 @@
self.addCleanup(transaction.manager.unregisterSynch, self)
site_manager = zope.component.getGlobalSiteManager()
- for utility in self.provided_utilities:
+ for utility in _fake_librarian_provided_utilities:
original = zope.component.getUtility(utility)
if site_manager.unregisterUtility(original, utility):
# We really disabled a utility, restore it later.
=== modified file 'lib/lp/services/longpoll/adapters/subscriber.py'
--- lib/lp/services/longpoll/adapters/subscriber.py 2011-12-29 05:29:36 +0000
+++ lib/lp/services/longpoll/adapters/subscriber.py 2015-07-08 16:13:45 +0000
@@ -16,7 +16,7 @@
adapts,
getUtility,
)
-from zope.interface import implements
+from zope.interface import implementer
from zope.publisher.interfaces import IApplicationRequest
from lp.services.config import config
@@ -29,10 +29,10 @@
return "longpoll.subscribe.%s" % uuid4()
+@implementer(ILongPollSubscriber)
class LongPollApplicationRequestSubscriber:
adapts(IApplicationRequest)
- implements(ILongPollSubscriber)
def __init__(self, request):
self.request = request
=== modified file 'lib/lp/services/longpoll/adapters/tests/test_event.py'
--- lib/lp/services/longpoll/adapters/tests/test_event.py 2012-01-01 02:58:52 +0000
+++ lib/lp/services/longpoll/adapters/tests/test_event.py 2015-07-08 16:13:45 +0000
@@ -5,7 +5,7 @@
__metaclass__ = type
-from zope.interface import implements
+from zope.interface import implementer
from lp.services.longpoll.adapters.event import (
generate_event_key,
@@ -21,10 +21,9 @@
from lp.testing.matchers import Contains
+@implementer(ILongPollEvent)
class FakeEvent(LongPollEvent):
- implements(ILongPollEvent)
-
@property
def event_key(self):
return "event-key-%s" % self.source
=== modified file 'lib/lp/services/longpoll/adapters/tests/test_subscriber.py'
--- lib/lp/services/longpoll/adapters/tests/test_subscriber.py 2012-01-01 02:58:52 +0000
+++ lib/lp/services/longpoll/adapters/tests/test_subscriber.py 2015-07-08 16:13:45 +0000
@@ -13,7 +13,7 @@
StartsWith,
)
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from lp.services.longpoll.adapters.subscriber import (
generate_subscribe_key,
@@ -30,10 +30,9 @@
from lp.testing.matchers import Contains
+@implementer(ILongPollEvent)
class FakeEvent:
- implements(ILongPollEvent)
-
event_key_indexes = count(1)
def __init__(self):
=== modified file 'lib/lp/services/looptuner.py'
--- lib/lp/services/looptuner.py 2014-01-15 10:46:59 +0000
+++ lib/lp/services/looptuner.py 2015-07-08 16:13:45 +0000
@@ -17,7 +17,7 @@
import transaction
from zope.interface import (
- implements,
+ implementer,
Interface,
)
@@ -354,9 +354,9 @@
return self._time()
+@implementer(ITunableLoop)
class TunableLoop:
"""A base implementation of `ITunableLoop`."""
- implements(ITunableLoop)
# DBLoopTuner blocks on replication lag and long transactions. If a
# subclass wants to ignore them, it can override this to be a normal
=== modified file 'lib/lp/services/mail/mailbox.py'
--- lib/lp/services/mail/mailbox.py 2012-06-29 08:40:05 +0000
+++ lib/lp/services/mail/mailbox.py 2015-07-08 16:13:45 +0000
@@ -17,7 +17,7 @@
import threading
from zope.interface import (
- implements,
+ implementer,
Interface,
)
@@ -56,12 +56,12 @@
"""Closes the mailbox."""
+@implementer(IMailBox)
class TestMailBox:
"""Mail box used for testing.
It operates on stub.test_emails.
"""
- implements(IMailBox)
def __init__(self):
self._lock = threading.Lock()
@@ -98,9 +98,9 @@
self._lock.release()
+@implementer(IMailBox)
class POP3MailBox:
"""Mail box which talks to a POP3 server."""
- implements(IMailBox)
def __init__(self, host, user, password, ssl=False):
self._host = host
@@ -150,9 +150,9 @@
self._popbox.quit()
+@implementer(IMailBox)
class DirectoryMailBox:
"""Mail box which reads files from a directory."""
- implements(IMailBox)
def __init__(self, directory):
self.mail_dir = os.path.abspath(directory)
=== modified file 'lib/lp/services/mail/mbox.py'
--- lib/lp/services/mail/mbox.py 2015-03-13 19:05:50 +0000
+++ lib/lp/services/mail/mbox.py 2015-07-08 16:13:45 +0000
@@ -12,19 +12,19 @@
from logging import getLogger
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from zope.sendmail.interfaces import IMailer
COMMASPACE = ', '
+@implementer(IMailer)
class MboxMailer:
"""
Stores the message in a Unix mailbox file. This will be so much cooler
when we can use Python 2.5's mailbox module.
"""
- implements(IMailer)
def __init__(self, filename, overwrite, mailer=None):
self.filename = filename
=== modified file 'lib/lp/services/mail/notificationrecipientset.py'
--- lib/lp/services/mail/notificationrecipientset.py 2012-02-28 18:39:55 +0000
+++ lib/lp/services/mail/notificationrecipientset.py 2015-07-08 16:13:45 +0000
@@ -11,7 +11,7 @@
from operator import attrgetter
-from zope.interface import implements
+from zope.interface import implementer
from zope.security.proxy import isinstance as zope_isinstance
from lp.registry.interfaces.person import IPerson
@@ -21,11 +21,10 @@
)
+@implementer(INotificationRecipientSet)
class NotificationRecipientSet:
"""Set of recipients along the rationale for being in the set."""
- implements(INotificationRecipientSet)
-
def __init__(self):
"""Create a new empty set."""
# We maintain a mapping of person to rationale, as well as a
=== modified file 'lib/lp/services/mail/signedmessage.py'
--- lib/lp/services/mail/signedmessage.py 2015-03-13 21:06:48 +0000
+++ lib/lp/services/mail/signedmessage.py 2015-07-08 16:13:45 +0000
@@ -15,7 +15,7 @@
from email.message import Message
import re
-from zope.interface import implements
+from zope.interface import implementer
from lp.services.mail.interfaces import ISignedMessage
@@ -47,9 +47,9 @@
return msg
+@implementer(ISignedMessage)
class SignedMessage(Message):
"""Provides easy access to signed content and the signature"""
- implements(ISignedMessage)
parsed_string = None
=== modified file 'lib/lp/services/mail/stub.py'
--- lib/lp/services/mail/stub.py 2013-04-09 08:22:58 +0000
+++ lib/lp/services/mail/stub.py 2015-07-08 16:13:45 +0000
@@ -9,16 +9,16 @@
from logging import getLogger
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from zope.sendmail.interfaces import IMailer
+@implementer(IMailer)
class StubMailer:
"""
Overrides the from_addr and to_addrs arguments and passes the
email on to the IMailer
"""
- implements(IMailer)
def __init__(self, from_addr, to_addrs, mailer, rewrite=False):
self.from_addr = from_addr
@@ -54,6 +54,7 @@
test_emails = []
+@implementer(IMailer)
class TestMailer:
"""
Stores (from_addr, to_addrs, message) in the test_emails module global list
@@ -61,7 +62,6 @@
Tests or their harnesses will need to clear out the test_emails list.
"""
- implements(IMailer)
def send(self, from_addr, to_addrs, message):
test_emails.append((from_addr, to_addrs, message))
=== modified file 'lib/lp/services/mail/tests/incomingmail.txt'
--- lib/lp/services/mail/tests/incomingmail.txt 2012-06-13 21:01:11 +0000
+++ lib/lp/services/mail/tests/incomingmail.txt 2015-07-08 16:13:45 +0000
@@ -26,10 +26,10 @@
Let's create some utilities which keep track of which mails they
handle, and register them for some domains:
- >>> from zope.interface import implements
+ >>> from zope.interface import implementer
>>> from lp.services.mail.interfaces import IMailHandler
- >>> class MockHandler:
- ... implements(IMailHandler)
+ >>> @implementer(IMailHandler)
+ ... class MockHandler:
... def __init__(self, allow_unknown_users=False):
... self.allow_unknown_users = allow_unknown_users
... self.handledMails = []
@@ -234,8 +234,8 @@
>>> class TestOopsException(Exception):
... pass
- >>> class OopsHandler:
- ... implements(IMailHandler)
+ >>> @implementer(IMailHandler)
+ ... class OopsHandler:
... def process(self, mail, to_addr, filealias):
... raise TestOopsException()
>>> mail_handlers.add('oops.com', OopsHandler())
@@ -285,8 +285,8 @@
reporting in the web interface, are not ignored in the email interface.
>>> from twisted.cred.error import Unauthorized
- >>> class UnauthorizedOopsHandler:
- ... implements(IMailHandler)
+ >>> @implementer(IMailHandler)
+ ... class UnauthorizedOopsHandler:
... def process(self, mail, to_addr, filealias):
... raise Unauthorized()
>>> mail_handlers.add('unauthorized.com', UnauthorizedOopsHandler())
@@ -337,8 +337,8 @@
Let's create and register a handler which raises a SQL error:
>>> from lp.services.database.sqlbase import cursor
- >>> class DBExceptionRaiser:
- ... implements(IMailHandler)
+ >>> @implementer(IMailHandler)
+ ... class DBExceptionRaiser:
... def process(self, mail, to_addr, filealias):
... cur = cursor()
... cur.execute('SELECT 1/0')
=== modified file 'lib/lp/services/mail/tests/test_incoming.py'
--- lib/lp/services/mail/tests/test_incoming.py 2012-12-26 01:04:05 +0000
+++ lib/lp/services/mail/tests/test_incoming.py 2015-07-08 16:13:45 +0000
@@ -13,7 +13,7 @@
Is,
)
import transaction
-from zope.interface import implements
+from zope.interface import implementer
from zope.security.management import setSecurityPolicy
from lp.services.config import config
@@ -40,8 +40,8 @@
from lp.testing.systemdocs import LayeredDocFileSuite
+@implementer(IMailHandler)
class FakeHandler:
- implements(IMailHandler)
def __init__(self, allow_unknown_users=True):
self.allow_unknown_users = allow_unknown_users
=== modified file 'lib/lp/services/mail/tests/test_sendmail.py'
--- lib/lp/services/mail/tests/test_sendmail.py 2015-03-13 19:05:50 +0000
+++ lib/lp/services/mail/tests/test_sendmail.py 2015-07-08 16:13:45 +0000
@@ -8,7 +8,7 @@
from email.message import Message
import unittest
-from zope.interface import implements
+from zope.interface import implementer
from zope.sendmail.interfaces import IMailDelivery
from lp.services.encoding import is_ascii_only
@@ -303,10 +303,9 @@
self.assertIsInstance(a0.detail, basestring)
+@implementer(IMailDelivery)
class RecordingMailer(object):
- implements(IMailDelivery)
-
def send(self, from_addr, to_addr, raw_message):
self.from_addr = from_addr
self.to_addr = to_addr
=== modified file 'lib/lp/services/messages/browser/message.py'
--- lib/lp/services/messages/browser/message.py 2012-09-26 22:21:41 +0000
+++ lib/lp/services/messages/browser/message.py 2015-07-08 16:13:45 +0000
@@ -5,15 +5,15 @@
__metaclass__ = type
-from zope.interface import implements
+from zope.interface import implementer
from lp.services.messages.interfaces.message import IIndexedMessage
from lp.services.webapp.interfaces import ICanonicalUrlData
+@implementer(ICanonicalUrlData)
class QuestionMessageCanonicalUrlData:
"""Question messages have a canonical_url within the question."""
- implements(ICanonicalUrlData)
rootsite = 'answers'
def __init__(self, question, message):
@@ -21,9 +21,9 @@
self.path = "messages/%d" % list(question.messages).index(message)
+@implementer(ICanonicalUrlData)
class BugMessageCanonicalUrlData:
"""Bug messages have a canonical_url within the primary bugtask."""
- implements(ICanonicalUrlData)
rootsite = 'bugs'
def __init__(self, bug, message):
@@ -31,13 +31,13 @@
self.path = "comments/%d" % list(bug.messages).index(message)
+@implementer(ICanonicalUrlData)
class IndexedBugMessageCanonicalUrlData:
"""An optimized bug message canonical_url implementation.
This implementation relies on the message being decorated with
its index and context.
"""
- implements(ICanonicalUrlData)
rootsite = 'bugs'
def __init__(self, message):
=== modified file 'lib/lp/services/messages/interfaces/message.py'
--- lib/lp/services/messages/interfaces/message.py 2015-03-13 19:05:50 +0000
+++ lib/lp/services/messages/interfaces/message.py 2015-07-08 16:13:45 +0000
@@ -33,7 +33,7 @@
)
from zope.interface import (
Attribute,
- implements,
+ implementer,
Interface,
)
from zope.schema import (
@@ -198,10 +198,10 @@
"of messages in its context."))
+@implementer(IIndexedMessage)
class IndexedMessage:
"""Adds the `inside` and `index` attributes to an IMessage."""
delegates(IMessage)
- implements(IIndexedMessage)
def __init__(self, context, inside, index, parent=None):
self.context = context
=== modified file 'lib/lp/services/messages/model/message.py'
--- lib/lp/services/messages/model/message.py 2015-03-13 19:05:50 +0000
+++ lib/lp/services/messages/model/message.py 2015-07-08 16:13:45 +0000
@@ -47,7 +47,7 @@
Unicode,
)
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from zope.security.proxy import isinstance as zisinstance
from lp.app.errors import NotFoundError
@@ -91,13 +91,12 @@
raise InvalidEmailMessage('Invalid date %s' % field_value)
+@implementer(IMessage)
class Message(SQLBase):
"""A message. This is an RFC822-style message, typically it would be
coming into the bug system, or coming in from a mailing list.
"""
- implements(IMessage)
-
_table = 'Message'
_defaultOrder = '-id'
datecreated = UtcDateTimeCol(notNull=True, default=UTC_NOW)
@@ -191,8 +190,8 @@
return []
+@implementer(IMessageSet)
class MessageSet:
- implements(IMessageSet)
extra_encoding_aliases = {
'macintosh': 'mac_roman',
@@ -521,9 +520,9 @@
yield depth, message
+@implementer(IMessageChunk)
class MessageChunk(SQLBase):
"""One part of a possibly multipart Message"""
- implements(IMessageChunk)
_table = 'MessageChunk'
_defaultOrder = 'sequence'
@@ -555,11 +554,10 @@
"URL: %s" % (blob.filename, blob.mimetype, blob.url))
+@implementer(IUserToUserEmail)
class UserToUserEmail(Storm):
"""See `IUserToUserEmail`."""
- implements(IUserToUserEmail)
-
__storm_table__ = 'UserToUserEmail'
id = Int(primary=True)
@@ -622,11 +620,10 @@
Store.of(sender).add(self)
+@implementer(IDirectEmailAuthorization)
class DirectEmailAuthorization:
"""See `IDirectEmailAuthorization`."""
- implements(IDirectEmailAuthorization)
-
def __init__(self, sender):
"""Create a `UserContactBy` instance.
=== modified file 'lib/lp/services/messaging/rabbit.py'
--- lib/lp/services/messaging/rabbit.py 2012-11-26 08:33:03 +0000
+++ lib/lp/services/messaging/rabbit.py 2015-07-08 16:13:45 +0000
@@ -22,7 +22,7 @@
from amqplib import client_0_8 as amqp
import transaction
from transaction._transaction import Status as TransactionStatus
-from zope.interface import implements
+from zope.interface import implementer
from lp.services.config import config
from lp.services.messaging.interfaces import (
@@ -38,10 +38,9 @@
LAUNCHPAD_EXCHANGE = "launchpad-exchange"
+@implementer(transaction.interfaces.ISynchronizer)
class RabbitSessionTransactionSync:
- implements(transaction.interfaces.ISynchronizer)
-
def __init__(self, session):
self.session = session
@@ -80,10 +79,9 @@
virtual_host=config.rabbitmq.virtual_host, insist=False)
+@implementer(IMessageSession)
class RabbitSession(threading.local):
- implements(IMessageSession)
-
exchange = LAUNCHPAD_EXCHANGE
def __init__(self):
@@ -221,11 +219,10 @@
return self._channel
+@implementer(IMessageProducer)
class RabbitRoutingKey(RabbitMessageBase):
"""A RabbitMQ data origination point."""
- implements(IMessageProducer)
-
def __init__(self, session, routing_key):
super(RabbitRoutingKey, self).__init__(session)
self.key = routing_key
@@ -258,11 +255,10 @@
routing_key=self.key, msg=msg)
+@implementer(IMessageConsumer)
class RabbitQueue(RabbitMessageBase):
"""A RabbitMQ Queue."""
- implements(IMessageConsumer)
-
def __init__(self, session, name):
super(RabbitQueue, self).__init__(session)
self.name = name
=== modified file 'lib/lp/services/oauth/model.py'
--- lib/lp/services/oauth/model.py 2015-01-29 11:58:57 +0000
+++ lib/lp/services/oauth/model.py 2015-07-08 16:13:45 +0000
@@ -24,7 +24,7 @@
ForeignKey,
StringCol,
)
-from zope.interface import implements
+from zope.interface import implementer
from lp.registry.interfaces.distribution import IDistribution
from lp.registry.interfaces.distributionsourcepackage import (
@@ -76,9 +76,9 @@
getStore = _get_store
+@implementer(IOAuthConsumer)
class OAuthConsumer(OAuthBase, SQLBase):
"""See `IOAuthConsumer`."""
- implements(IOAuthConsumer)
date_created = UtcDateTimeCol(default=UTC_NOW, notNull=True)
disabled = BoolCol(notNull=True, default=False)
@@ -165,9 +165,9 @@
return OAuthRequestToken.selectOneBy(key=key, consumer=self)
+@implementer(IOAuthConsumerSet)
class OAuthConsumerSet:
"""See `IOAuthConsumerSet`."""
- implements(IOAuthConsumerSet)
def new(self, key, secret=''):
"""See `IOAuthConsumerSet`."""
@@ -180,9 +180,9 @@
return OAuthConsumer.selectOneBy(key=key)
+@implementer(IOAuthAccessToken)
class OAuthAccessToken(OAuthBase, SQLBase):
"""See `IOAuthAccessToken`."""
- implements(IOAuthAccessToken)
consumer = ForeignKey(
dbName='consumer', foreignKey='OAuthConsumer', notNull=True)
@@ -243,9 +243,9 @@
return hashlib.sha256(secret).hexdigest() == self._secret
+@implementer(IOAuthRequestToken)
class OAuthRequestToken(OAuthBase, SQLBase):
"""See `IOAuthRequestToken`."""
- implements(IOAuthRequestToken)
consumer = ForeignKey(
dbName='consumer', foreignKey='OAuthConsumer', notNull=True)
@@ -370,9 +370,9 @@
return self.date_reviewed is not None
+@implementer(IOAuthRequestTokenSet)
class OAuthRequestTokenSet:
"""See `IOAuthRequestTokenSet`."""
- implements(IOAuthRequestTokenSet)
def getByKey(self, key):
"""See `IOAuthRequestTokenSet`."""
=== modified file 'lib/lp/services/openid/adapters/openid.py'
--- lib/lp/services/openid/adapters/openid.py 2014-01-15 08:26:05 +0000
+++ lib/lp/services/openid/adapters/openid.py 2015-07-08 16:13:45 +0000
@@ -14,10 +14,7 @@
adapter,
adapts,
)
-from zope.interface import (
- implementer,
- implements,
- )
+from zope.interface import implementer
from lp.registry.interfaces.person import IPerson
from lp.services.config import config
@@ -36,11 +33,11 @@
return config.launchpad.openid_provider_root + '+openid'
+@implementer(IOpenIDPersistentIdentity)
class OpenIDPersistentIdentity:
"""A persistent OpenID identifier for a user."""
adapts(IAccount)
- implements(IOpenIDPersistentIdentity)
def __init__(self, account):
self.account = account
=== modified file 'lib/lp/services/openid/model/openidconsumer.py'
--- lib/lp/services/openid/model/openidconsumer.py 2011-12-09 02:19:10 +0000
+++ lib/lp/services/openid/model/openidconsumer.py 2015-07-08 16:13:45 +0000
@@ -6,7 +6,7 @@
__metaclass__ = type
__all__ = ['OpenIDConsumerNonce']
-from zope.interface import implements
+from zope.interface import implementer
from lp.services.openid.interfaces.openidconsumer import IOpenIDConsumerStore
from lp.services.openid.model.baseopenidstore import (
@@ -24,9 +24,9 @@
__storm_table__ = 'OpenIDConsumerNonce'
+@implementer(IOpenIDConsumerStore)
class OpenIDConsumerStore(BaseStormOpenIDStore):
"""An OpenID association and nonce store for Launchpad."""
- implements(IOpenIDConsumerStore)
Association = OpenIDConsumerAssociation
Nonce = OpenIDConsumerNonce
=== modified file 'lib/lp/services/propertycache.py'
--- lib/lp/services/propertycache.py 2011-11-22 22:21:46 +0000
+++ lib/lp/services/propertycache.py 2015-07-08 16:13:45 +0000
@@ -18,7 +18,7 @@
from functools import partial
from zope.interface import (
- implements,
+ implementer,
Interface,
)
from zope.security.proxy import removeSecurityProxy
@@ -48,11 +48,10 @@
"""Iterate over the cached names."""
+@implementer(IPropertyCache)
class DefaultPropertyCache:
"""A simple cache."""
- implements(IPropertyCache)
-
# __getattr__ -- well, __getattribute__ -- and __setattr__ are inherited
# from object.
=== modified file 'lib/lp/services/salesforce/proxy.py'
--- lib/lp/services/salesforce/proxy.py 2012-10-22 02:30:44 +0000
+++ lib/lp/services/salesforce/proxy.py 2015-07-08 16:13:45 +0000
@@ -18,7 +18,7 @@
)
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from lp.registry.interfaces.product import IProductSet
from lp.services.config import config
@@ -54,11 +54,10 @@
return decorator
+@implementer(ISalesforceVoucher)
class Voucher:
"""A Commercial Subscription voucher."""
- implements(ISalesforceVoucher)
-
def __init__(self, values):
"""Initialize using the values as returned from the SF proxy.
:param values['voucher_id']: voucher id.
@@ -88,10 +87,9 @@
project_name)
+@implementer(ISalesforceVoucherProxy)
class SalesforceVoucherProxy:
- implements(ISalesforceVoucherProxy)
-
def __init__(self):
self.xmlrpc_transport = SafeTransportWithTimeout(
config.commercial.voucher_proxy_timeout / 1000.0)
=== modified file 'lib/lp/services/salesforce/tests/proxy.py'
--- lib/lp/services/salesforce/tests/proxy.py 2013-01-07 02:40:55 +0000
+++ lib/lp/services/salesforce/tests/proxy.py 2015-07-08 16:13:45 +0000
@@ -19,7 +19,7 @@
Transport,
)
-from zope.interface import implements
+from zope.interface import implementer
from lp.services.salesforce.interfaces import ISalesforceVoucherProxy
from lp.services.salesforce.proxy import SalesforceVoucherProxy
@@ -73,9 +73,9 @@
project_id=self.project_id)
+@implementer(ISalesforceVoucherProxy)
class TestSalesforceVoucherProxy(SalesforceVoucherProxy):
"""Test version of the SalesforceVoucherProxy using the test transport."""
- implements(ISalesforceVoucherProxy)
def __init__(self):
self.xmlrpc_transport = SalesforceXMLRPCTestTransport()
=== modified file 'lib/lp/services/scripts/model/scriptactivity.py'
--- lib/lp/services/scripts/model/scriptactivity.py 2013-01-07 02:40:55 +0000
+++ lib/lp/services/scripts/model/scriptactivity.py 2015-07-08 16:13:45 +0000
@@ -11,7 +11,7 @@
import socket
from sqlobject import StringCol
-from zope.interface import implements
+from zope.interface import implementer
from lp.services.database.datetimecol import UtcDateTimeCol
from lp.services.database.sqlbase import SQLBase
@@ -21,20 +21,18 @@
)
+@implementer(IScriptActivity)
class ScriptActivity(SQLBase):
- implements(IScriptActivity)
-
name = StringCol(notNull=True)
hostname = StringCol(notNull=True)
date_started = UtcDateTimeCol(notNull=True)
date_completed = UtcDateTimeCol(notNull=True)
+@implementer(IScriptActivitySet)
class ScriptActivitySet:
- implements(IScriptActivitySet)
-
def recordSuccess(self, name, date_started, date_completed,
hostname=None):
"""See IScriptActivitySet"""
=== modified file 'lib/lp/services/session/model.py'
--- lib/lp/services/session/model.py 2011-12-30 06:14:56 +0000
+++ lib/lp/services/session/model.py 2015-07-08 16:13:45 +0000
@@ -12,32 +12,30 @@
Unicode,
)
from zope.interface import (
- classProvides,
- implements,
+ implementer,
+ provider,
)
from lp.services.database.datetimecol import UtcDateTimeCol
from lp.services.session.interfaces import IUseSessionStore
+@implementer(IUseSessionStore)
+@provider(IUseSessionStore)
class SessionData(Storm):
"""A user's Session."""
- classProvides(IUseSessionStore)
- implements(IUseSessionStore)
-
__storm_table__ = 'SessionData'
client_id = Unicode(primary=True)
created = UtcDateTimeCol()
last_accessed = UtcDateTimeCol()
+@implementer(IUseSessionStore)
+@provider(IUseSessionStore)
class SessionPkgData(Storm):
"""Data storage for a Session."""
- classProvides(IUseSessionStore)
- implements(IUseSessionStore)
-
__storm_table__ = 'SessionPkgData'
__storm_primary__ = 'client_id', 'product_id', 'key'
=== modified file 'lib/lp/services/statistics/model/statistics.py'
--- lib/lp/services/statistics/model/statistics.py 2013-05-01 21:23:16 +0000
+++ lib/lp/services/statistics/model/statistics.py 2015-07-08 16:13:45 +0000
@@ -15,7 +15,7 @@
StringCol,
)
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from lp.answers.enums import QuestionStatus
from lp.answers.model.question import Question
@@ -41,11 +41,10 @@
from lp.translations.model.potemplate import POTemplate
+@implementer(ILaunchpadStatistic)
class LaunchpadStatistic(SQLBase):
"""A table of Launchpad Statistics."""
- implements(ILaunchpadStatistic)
-
_table = 'LaunchpadStatistic'
_defaultOrder = 'name'
@@ -55,11 +54,10 @@
dateupdated = UtcDateTimeCol(notNull=True, default=UTC_NOW)
+@implementer(ILaunchpadStatisticSet)
class LaunchpadStatisticSet:
"""See`ILaunchpadStatisticSet`."""
- implements(ILaunchpadStatisticSet)
-
def __iter__(self):
"""See ILaunchpadStatisticSet."""
return iter(LaunchpadStatistic.select(orderBy='name'))
=== modified file 'lib/lp/services/temporaryblobstorage/browser.py'
--- lib/lp/services/temporaryblobstorage/browser.py 2012-06-29 08:40:05 +0000
+++ lib/lp/services/temporaryblobstorage/browser.py 2015-07-08 16:13:45 +0000
@@ -11,7 +11,7 @@
]
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from lp.app.browser.launchpadform import (
action,
@@ -74,9 +74,9 @@
return uuid
+@implementer(ICanonicalUrlData)
class TemporaryBlobStorageURL:
"""Bug URL creation rules."""
- implements(ICanonicalUrlData)
inside = None
rootsite = None
=== modified file 'lib/lp/services/temporaryblobstorage/model.py'
--- lib/lp/services/temporaryblobstorage/model.py 2013-01-07 02:40:55 +0000
+++ lib/lp/services/temporaryblobstorage/model.py 2015-07-08 16:13:45 +0000
@@ -19,7 +19,7 @@
StringCol,
)
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from lp.services.config import config
from lp.services.database.constants import DEFAULT
@@ -35,11 +35,10 @@
from lp.services.utils import utc_now
+@implementer(ITemporaryBlobStorage)
class TemporaryBlobStorage(SQLBase):
"""A temporary BLOB stored in Launchpad."""
- implements(ITemporaryBlobStorage)
-
_table='TemporaryBlobStorage'
uuid = StringCol(notNull=True, alternateID=True)
@@ -86,11 +85,10 @@
return job_for_blob.metadata['processed_data']
+@implementer(ITemporaryStorageManager)
class TemporaryStorageManager:
"""A tool to create temporary BLOB's in Launchpad."""
- implements(ITemporaryStorageManager)
-
def new(self, blob, expires=None):
"""See ITemporaryStorageManager."""
if expires is None:
=== modified file 'lib/lp/services/tests/test_looptuner.py'
--- lib/lp/services/tests/test_looptuner.py 2012-01-25 15:18:06 +0000
+++ lib/lp/services/tests/test_looptuner.py 2015-07-08 16:13:45 +0000
@@ -10,7 +10,7 @@
from cStringIO import StringIO
-from zope.interface import implements
+from zope.interface import implementer
from lp.services.log.logger import FakeLogger
from lp.services.looptuner import (
@@ -33,8 +33,8 @@
"""Exception raised from the isDone method of an ITunableLoop."""
+@implementer(ITunableLoop)
class FailingLoop:
- implements(ITunableLoop)
def __init__(
self, fail_main=False, fail_cleanup=False):
=== modified file 'lib/lp/services/tests/test_timeout.py'
--- lib/lp/services/tests/test_timeout.py 2012-06-28 16:36:49 +0000
+++ lib/lp/services/tests/test_timeout.py 2015-07-08 16:13:45 +0000
@@ -18,7 +18,7 @@
import urllib2
import xmlrpclib
-from zope.interface import implements
+from zope.interface import implementer
from lp.services.log.logger import FakeLogger
from lp.services.timeout import (
=== modified file 'lib/lp/services/twistedsupport/gracefulshutdown.py'
--- lib/lp/services/twistedsupport/gracefulshutdown.py 2011-12-19 23:38:16 +0000
+++ lib/lp/services/twistedsupport/gracefulshutdown.py 2015-07-08 16:13:45 +0000
@@ -27,7 +27,7 @@
resource,
server,
)
-from zope.interface import implements
+from zope.interface import implementer
class ConnTrackingFactoryWrapper(WrappingFactory):
@@ -138,6 +138,7 @@
return ''
+@implementer(service.IServiceCollection)
class OrderedMultiService(service.MultiService):
"""A MultiService that guarantees start and stop order.
@@ -145,8 +146,6 @@
reverse order (waiting for each to stop before stopping the next).
"""
- implements(service.IServiceCollection)
-
@inlineCallbacks
def stopService(self):
"""See service.MultiService.stopService."""
=== modified file 'lib/lp/services/twistedsupport/loggingsupport.py'
--- lib/lp/services/twistedsupport/loggingsupport.py 2014-01-30 15:04:06 +0000
+++ lib/lp/services/twistedsupport/loggingsupport.py 2015-07-08 16:13:45 +0000
@@ -26,7 +26,7 @@
)
from twisted.python.logfile import DailyLogFile
from twisted.web import xmlrpc
-from zope.interface import implements
+from zope.interface import implementer
from lp.services.librarian.utils import copy_and_close
from lp.services.scripts import logger
@@ -170,11 +170,10 @@
return deferred.addBoth(_logResult)
+@implementer(log.ILogObserver)
class RotatableFileLogObserver:
"""A log observer that uses a log file and reopens it on SIGUSR1."""
- implements(log.ILogObserver)
-
def __init__(self, logfilepath):
"""Set up the logfile and possible signal handler.
=== modified file 'lib/lp/services/twistedsupport/task.py'
--- lib/lp/services/twistedsupport/task.py 2013-01-07 02:40:55 +0000
+++ lib/lp/services/twistedsupport/task.py 2015-07-08 16:13:45 +0000
@@ -21,7 +21,7 @@
from twisted.internet.task import LoopingCall
from twisted.python import log
from zope.interface import (
- implements,
+ implementer,
Interface,
)
@@ -92,6 +92,7 @@
"""
+@implementer(ITaskSource)
class PollingTaskSource:
"""A task source that polls to generate tasks.
@@ -99,8 +100,6 @@
to find new work to do.
"""
- implements(ITaskSource)
-
def __init__(self, interval, task_producer, clock=None, logger=None):
"""Construct a `PollingTaskSource`.
@@ -214,6 +213,7 @@
self, "%r has not started, cannot run tasks." % (consumer,))
+@implementer(ITaskConsumer)
class ParallelLimitedTaskConsumer:
"""A consumer that runs tasks with limited parallelism.
@@ -221,8 +221,6 @@
that might return `Deferred`s.
"""
- implements(ITaskConsumer)
-
def __init__(self, worker_limit, logger=None):
if logger is None:
logger = logging.getLogger(__name__)
=== modified file 'lib/lp/services/twistedsupport/tests/test_task.py'
--- lib/lp/services/twistedsupport/tests/test_task.py 2013-01-07 02:40:55 +0000
+++ lib/lp/services/twistedsupport/tests/test_task.py 2015-07-08 16:13:45 +0000
@@ -9,7 +9,7 @@
succeed,
)
from twisted.internet.task import Clock
-from zope.interface import implements
+from zope.interface import implementer
from lp.services.twistedsupport.task import (
AlreadyRunningError,
@@ -22,11 +22,10 @@
from lp.testing import TestCase
+@implementer(ITaskConsumer)
class NoopTaskConsumer:
"""Task consumer that does nothing."""
- implements(ITaskConsumer)
-
def taskStarted(self, task):
"""Do nothing."""
@@ -48,11 +47,10 @@
self.data_sink.append(task)
+@implementer(ITaskSource)
class LoggingSource:
"""Task source that logs calls to `start` and `stop'`"""
- implements(ITaskSource)
-
def __init__(self, log, stop_deferred=None):
self._log = log
if stop_deferred is None:
=== modified file 'lib/lp/services/verification/model/logintoken.py'
--- lib/lp/services/verification/model/logintoken.py 2014-09-02 02:03:37 +0000
+++ lib/lp/services/verification/model/logintoken.py 2015-07-08 16:13:45 +0000
@@ -17,7 +17,7 @@
)
from storm.expr import And
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from lp.app.errors import NotFoundError
from lp.app.validators.email import valid_email
@@ -53,8 +53,8 @@
MAIL_APP = 'services/verification'
+@implementer(ILoginToken)
class LoginToken(SQLBase):
- implements(ILoginToken)
_table = 'LoginToken'
redirection_url = StringCol(default=None)
@@ -275,8 +275,8 @@
return lpkey, new
+@implementer(ILoginTokenSet)
class LoginTokenSet:
- implements(ILoginTokenSet)
def __init__(self):
self.title = 'Launchpad e-mail address confirmation'
=== modified file 'lib/lp/services/webapp/adapter.py'
--- lib/lp/services/webapp/adapter.py 2013-06-20 05:50:00 +0000
+++ lib/lp/services/webapp/adapter.py 2015-07-08 16:13:45 +0000
@@ -42,8 +42,8 @@
from zope.interface import (
alsoProvides,
classImplements,
- classProvides,
- implements,
+ implementer,
+ provider,
)
from zope.security.proxy import removeSecurityProxy
@@ -115,9 +115,9 @@
% (self.statement, self.params, self.original_error))
+@implementer(IRequestExpired)
class RequestExpired(RuntimeError):
"""Request has timed out."""
- implements(IRequestExpired)
def _get_dirty_commit_flags():
@@ -747,9 +747,9 @@
install_tracer(LaunchpadTimeoutTracer())
+@provider(IStoreSelector)
class StoreSelector:
"""See `lp.services.database.interfaces.IStoreSelector`."""
- classProvides(IStoreSelector)
@staticmethod
def push(db_policy):
=== modified file 'lib/lp/services/webapp/authentication.py'
--- lib/lp/services/webapp/authentication.py 2014-06-27 07:58:42 +0000
+++ lib/lp/services/webapp/authentication.py 2015-07-08 16:13:45 +0000
@@ -18,7 +18,7 @@
from zope.authentication.interfaces import ILoginPassword
from zope.component import getUtility
from zope.event import notify
-from zope.interface import implements
+from zope.interface import implementer
from zope.principalregistry.principalregistry import UnauthenticatedPrincipal
from zope.security.interfaces import Unauthorized
from zope.security.proxy import removeSecurityProxy
@@ -41,11 +41,11 @@
)
+@implementer(IPlacelessAuthUtility)
class PlacelessAuthUtility:
"""An authentication service which holds no state aside from its
ZCML configuration, implemented as a utility.
"""
- implements(IPlacelessAuthUtility)
def __init__(self):
self.nobody = UnauthenticatedPrincipal(
@@ -169,11 +169,11 @@
return getUtility(IPlacelessLoginSource).getPrincipalByLogin(login)
+@implementer(IPlacelessLoginSource)
class LaunchpadLoginSource:
"""A login source that uses the launchpad SQL database to look up
principal information.
"""
- implements(IPlacelessLoginSource)
def getPrincipal(self, id, access_level=AccessLevel.WRITE_PRIVATE,
scope=None):
@@ -250,10 +250,9 @@
loginSource.__parent__ = authService
+@implementer(ILaunchpadPrincipal)
class LaunchpadPrincipal:
- implements(ILaunchpadPrincipal)
-
def __init__(self, id, title, description, account,
access_level=AccessLevel.WRITE_PRIVATE, scope=None):
self.id = unicode(id)
=== modified file 'lib/lp/services/webapp/authorization.py'
--- lib/lp/services/webapp/authorization.py 2013-04-09 09:47:58 +0000
+++ lib/lp/services/webapp/authorization.py 2015-07-08 16:13:45 +0000
@@ -26,7 +26,7 @@
getUtility,
queryAdapter,
)
-from zope.interface import classProvides
+from zope.interface import provider
from zope.principalregistry.principalregistry import UnauthenticatedPrincipal
from zope.proxy import removeAllProxies
from zope.publisher.interfaces import IApplicationRequest
@@ -66,8 +66,8 @@
LAUNCHPAD_SECURITY_POLICY_CACHE_KEY = 'launchpad.security_policy_cache'
+@provider(ISecurityPolicy)
class LaunchpadSecurityPolicy(ParanoidSecurityPolicy):
- classProvides(ISecurityPolicy)
def __init__(self, *participations):
ParanoidSecurityPolicy.__init__(self, *participations)
=== modified file 'lib/lp/services/webapp/batching.py'
--- lib/lp/services/webapp/batching.py 2013-06-20 05:50:00 +0000
+++ lib/lp/services/webapp/batching.py 2015-07-08 16:13:45 +0000
@@ -26,7 +26,7 @@
from storm.store import EmptyResultSet
from storm.zope.interfaces import IResultSet
from zope.component import adapts
-from zope.interface import implements
+from zope.interface import implementer
from zope.interface.common.sequence import IFiniteSequence
from zope.security.proxy import (
isinstance as zope_isinstance,
@@ -49,10 +49,10 @@
from lp.services.webapp.publisher import LaunchpadView
+@implementer(IFiniteSequence)
class FiniteSequenceAdapter:
adapts(IResultSet)
- implements(IFiniteSequence)
def __init__(self, context):
self.context = context
@@ -67,11 +67,10 @@
return self.context.count()
+@implementer(IFiniteSequence)
class BoundReferenceSetAdapter:
"""Adaptor for `BoundReferenceSet` implementations in Storm."""
- implements(IFiniteSequence)
-
def __init__(self, context):
self.context = context
@@ -146,9 +145,9 @@
variable_name_prefix = 'inactive'
+@implementer(ITableBatchNavigator)
class TableBatchNavigator(BatchNavigator):
"""See lp.services.webapp.interfaces.ITableBatchNavigator."""
- implements(ITableBatchNavigator)
def __init__(self, results, request, start=0, size=None,
columns_to_show=None, callback=None):
@@ -244,6 +243,7 @@
return expression
+@implementer(IRangeFactory)
class StormRangeFactory:
"""A range factory for Storm result sets.
@@ -270,7 +270,6 @@
i.e. that the set of the column values used for sorting is
distinct for each result row.
"""
- implements(IRangeFactory)
def __init__(self, resultset, error_cb=None):
"""Create a new StormRangeFactory instance.
=== modified file 'lib/lp/services/webapp/breadcrumb.py'
--- lib/lp/services/webapp/breadcrumb.py 2014-11-24 06:31:25 +0000
+++ lib/lp/services/webapp/breadcrumb.py 2015-07-08 16:13:45 +0000
@@ -13,7 +13,7 @@
]
-from zope.interface import implements
+from zope.interface import implementer
from lp.services.webapp import canonical_url
from lp.services.webapp.interfaces import (
@@ -22,12 +22,12 @@
)
+@implementer(IBreadcrumb)
class Breadcrumb:
"""See `IBreadcrumb`.
This class is intended for use as an adapter.
"""
- implements(IBreadcrumb)
text = None
_detail = None
=== modified file 'lib/lp/services/webapp/doc/canonical_url.txt'
--- lib/lp/services/webapp/doc/canonical_url.txt 2014-02-26 01:10:16 +0000
+++ lib/lp/services/webapp/doc/canonical_url.txt 2015-07-08 16:13:45 +0000
@@ -12,7 +12,7 @@
will put in lp.testing.
>>> from lp.services.webapp.interfaces import ICanonicalUrlData
- >>> from zope.interface import Interface, Attribute, implements
+ >>> from zope.interface import Interface, Attribute, implementer
>>> class ICountrySet(Interface):
... pass
@@ -75,17 +75,18 @@
We don't have ICanonicalUrlData adapters for objects that provide any of these
interfaces. First, we create some countryset, country and town objects.
- >>> class CountrySet:
- ... implements(ICountrySet)
+ >>> @implementer(ICountrySet)
+ ... class CountrySet:
+ ... pass
>>> countryset_instance = CountrySet()
- >>> class Country:
- ... implements(ICountry)
+ >>> @implementer(ICountry)
+ ... class Country:
... name = 'England'
>>> country_instance = Country()
- >>> class Town:
- ... implements(ITown)
+ >>> @implementer(ITown)
+ ... class Town:
... country = country_instance
... name = 'London'
>>> town_instance = Town()
@@ -190,9 +191,8 @@
an adapter.
>>> from lp.services.webapp.interfaces import ILaunchpadRoot
- >>> class CountrySetUrl:
- ...
- ... implements(ICanonicalUrlData)
+ >>> @implementer(ICanonicalUrlData)
+ ... class CountrySetUrl:
...
... def __init__(self, context):
... self.context = context
@@ -282,8 +282,8 @@
Now, we must test the case where the object can be adapted to
ICanonicalUrlData, but its parent or its parent's parent (and so on) cannot.
- >>> class ObjectThatHasUrl:
- ... implements(ICanonicalUrlData)
+ >>> @implementer(ICanonicalUrlData)
+ ... class ObjectThatHasUrl:
... def __init__(self, name, parent):
... self.path = name
... self.inside = parent
@@ -358,9 +358,8 @@
zope.publisher.interfaces.http.IHTTPApplicationRequest.
>>> from zope.publisher.interfaces.http import IHTTPApplicationRequest
- >>> class FakeRequest:
- ...
- ... implements(IHTTPApplicationRequest)
+ >>> @implementer(IHTTPApplicationRequest)
+ ... class FakeRequest:
...
... def __init__(self, applicationurl):
... self.applicationurl = applicationurl
=== modified file 'lib/lp/services/webapp/doc/canonicalurl.txt'
--- lib/lp/services/webapp/doc/canonicalurl.txt 2011-12-30 08:13:14 +0000
+++ lib/lp/services/webapp/doc/canonicalurl.txt 2015-07-08 16:13:45 +0000
@@ -9,7 +9,7 @@
First, we'll construct an example object hierarchy.
- >>> from zope.interface import implements, Interface
+ >>> from zope.interface import implementer, Interface
>>> from lp.services.webapp.interfaces import ICanonicalUrlData
>>> class ICookbook(Interface):
@@ -18,9 +18,8 @@
>>> class IRecipe(Interface):
... pass
- >>> class BaseContent:
- ... implements(ICanonicalUrlData)
- ...
+ >>> @implementer(ICanonicalUrlData)
+ ... class BaseContent:
... def __init__(self, name, parent):
... self.name = name
... self.path = name
@@ -30,11 +29,13 @@
>>> class Root(BaseContent):
... pass
- >>> class Cookbook(BaseContent):
- ... implements(ICookbook)
+ >>> @implementer(ICookbook)
+ ... class Cookbook(BaseContent):
+ ... pass
- >>> class Recipe(BaseContent):
- ... implements(IRecipe)
+ >>> @implementer(IRecipe)
+ ... class Recipe(BaseContent):
+ ... pass
Here is the structure of our hierarchy:
@@ -50,8 +51,8 @@
>>> class ICookingDirections(Interface):
... """Something that tells us how to cook."""
- >>> class CookingDirections:
- ... implements(ICookingDirections)
+ >>> @implementer(ICookingDirections)
+ ... class CookingDirections:
... def __init__(self, context):
... self.context = context
@@ -121,8 +122,8 @@
>>> class ILabelledCookbook(Interface):
... """ A recipe with a name."""
- >>> class LabelledCookbook:
- ... implements(ILabelledCookbook)
+ >>> @implementer(ILabelledCookbook)
+ ... class LabelledCookbook:
... def __init__(self, context):
... self.context = context
=== modified file 'lib/lp/services/webapp/doc/menus.txt'
--- lib/lp/services/webapp/doc/menus.txt 2014-11-25 20:28:05 +0000
+++ lib/lp/services/webapp/doc/menus.txt 2015-07-08 16:13:45 +0000
@@ -9,11 +9,11 @@
>>> from lp.services.webapp.interfaces import (
... IApplicationMenu, ICanonicalUrlData, IContextMenu, IFacetLink,
... IFacetMenu, ILink, ILinkData)
- >>> from zope.interface import implements, directlyProvides, Interface
+ >>> from zope.interface import implementer, directlyProvides, Interface
>>> from zope.component import queryAdapter
- >>> class ObjectThatHasUrl:
- ... implements(ICanonicalUrlData)
+ >>> @implementer(ICanonicalUrlData)
+ ... class ObjectThatHasUrl:
... def __init__(self, name, parent):
... self.name = name # Used in examples later.
... self.path = name # See ICanonicalUrlData.
@@ -325,8 +325,8 @@
# IParticipation so that the login machinery will work.
>>> from zope.security.interfaces import IParticipation
>>> from lp.services.webapp.servers import LaunchpadTestRequest
- >>> class InteractiveTestRequest(LaunchpadTestRequest):
- ... implements(IParticipation)
+ >>> @implementer(IParticipation)
+ ... class InteractiveTestRequest(LaunchpadTestRequest):
... principal = None
... interaction = None
>>> request = InteractiveTestRequest()
@@ -614,8 +614,9 @@
Now, check that we have no IFacetMenu adapter for an IThingHavingFacets
object.
- >>> class SomeThing:
- ... implements(IThingHavingFacets)
+ >>> @implementer(IThingHavingFacets)
+ ... class SomeThing:
+ ... pass
>>> something_with_facets = SomeThing()
>>> IFacetMenu(something_with_facets, None) is None
True
@@ -623,8 +624,9 @@
We also need to check that we have no IApplicationMenu adapter named
'foo' for an IThingHavingMenus object.
- >>> class SomeOtherThing:
- ... implements(IThingHavingMenus)
+ >>> @implementer(IThingHavingMenus)
+ ... class SomeOtherThing:
+ ... pass
>>> something_with_menus = SomeOtherThing()
>>> print queryAdapter(something_with_menus, IApplicationMenu, 'foo')
None
@@ -682,8 +684,8 @@
>>> from lp.testing import test_tales
>>> from lp.services.webapp import LaunchpadView
>>> from lp.services.webapp.vhosts import allvhosts
- >>> class FakeRequest:
- ... implements(IHTTPApplicationRequest, IBrowserRequest)
+ >>> @implementer(IHTTPApplicationRequest, IBrowserRequest)
+ ... class FakeRequest:
...
... interaction = None
...
=== modified file 'lib/lp/services/webapp/doc/navigation.txt'
--- lib/lp/services/webapp/doc/navigation.txt 2013-04-09 08:01:32 +0000
+++ lib/lp/services/webapp/doc/navigation.txt 2015-07-08 16:13:45 +0000
@@ -55,7 +55,7 @@
for the thing being navigated. Rather than use a standard Launchpad interface,
we'll define one here.
- >>> from zope.interface import Interface, Attribute, implements
+ >>> from zope.interface import Interface, Attribute, implementer
>>> class IThingSet(Interface):
... """An interface we're using in this doctest."""
@@ -100,8 +100,8 @@
... except IndexError:
... return None
- >>> class Request(object):
- ... implements(IBrowserRequest)
+ >>> @implementer(IBrowserRequest)
+ ... class Request(object):
...
... def __init__(self):
... self.response = Response()
@@ -136,8 +136,8 @@
...
... value = Attribute('the value of the thing')
- >>> class Thing(object):
- ... implements(IThing)
+ >>> @implementer(IThing)
+ ... class Thing(object):
...
... def __init__(self, value):
... self.value = value
@@ -145,8 +145,8 @@
... def __repr__(self):
... return "<Thing '%s'>" % self.value
- >>> class ThingSet(object):
- ... implements(IThingSet)
+ >>> @implementer(IThingSet)
+ ... class ThingSet(object):
...
... def getThing(self, name):
... if name.startswith('t'):
=== modified file 'lib/lp/services/webapp/doc/test_adapter_timeout.txt.disabled'
--- lib/lp/services/webapp/doc/test_adapter_timeout.txt.disabled 2014-01-30 15:04:06 +0000
+++ lib/lp/services/webapp/doc/test_adapter_timeout.txt.disabled 2015-07-08 16:13:45 +0000
@@ -21,7 +21,7 @@
>>> from textwrap import dedent
>>> from zope.publisher.interfaces.browser import (
... IBrowserRequest, IBrowserView, IBrowserPublisher)
- >>> from zope.interface import Interface, implements
+ >>> from zope.interface import Interface, implementer
>>> from zope.security.checker import CheckerPublic, MultiChecker
>>> import zope.component
>>> import lp.services.webapp.adapter
@@ -40,8 +40,8 @@
... global _now
... _now += delta
>>> lp.services.webapp.adapter.time = fake_time # Monkey patch
- >>> class DoomedView(BrowserView):
- ... implements(IBrowserPublisher)
+ >>> @implementer(IBrowserPublisher)
+ ... class DoomedView(BrowserView):
... __Security_checker__ = MultiChecker((
... (IBrowserView, CheckerPublic),
... (IBrowserPublisher, CheckerPublic),
=== modified file 'lib/lp/services/webapp/doc/zcmldirectives.txt'
--- lib/lp/services/webapp/doc/zcmldirectives.txt 2013-04-10 09:04:16 +0000
+++ lib/lp/services/webapp/doc/zcmldirectives.txt 2015-07-08 16:13:45 +0000
@@ -40,7 +40,7 @@
>>> from zope.component import queryMultiAdapter
>>> import lp.testing
- >>> from zope.interface import Interface, implements
+ >>> from zope.interface import Interface, implementer
>>> class IFoo(Interface):
... pass
>>> class IFooLayer(Interface):
@@ -48,11 +48,13 @@
>>> lp.testing.IFoo = IFoo
>>> lp.testing.IFooLayer = IFooLayer
- >>> class FooObject:
- ... implements(IFoo)
+ >>> @implementer(IFoo)
+ ... class FooObject:
+ ... pass
>>> fooobject = FooObject()
- >>> class Request:
- ... implements(IFooLayer)
+ >>> @implementer(IFooLayer)
+ ... class Request:
+ ... pass
>>> request = Request()
>>> import types
=== modified file 'lib/lp/services/webapp/error.py'
--- lib/lp/services/webapp/error.py 2014-05-14 09:23:56 +0000
+++ lib/lp/services/webapp/error.py 2015-07-08 16:13:45 +0000
@@ -22,7 +22,7 @@
from zope.browser.interfaces import ISystemErrorView
from zope.component import getUtility
from zope.exceptions.exceptionformatter import format_exception
-from zope.interface import implements
+from zope.interface import implementer
import lp.layers
from lp.services import features
@@ -33,12 +33,12 @@
from lp.services.webapp.publisher import LaunchpadView
+@implementer(ISystemErrorView)
class SystemErrorView(LaunchpadView):
"""Helper class for views on exceptions.
Also, sets a 500 response code.
"""
- implements(ISystemErrorView)
page_title = 'Error: Launchpad system error'
=== modified file 'lib/lp/services/webapp/errorlog.py'
--- lib/lp/services/webapp/errorlog.py 2013-01-07 02:40:55 +0000
+++ lib/lp/services/webapp/errorlog.py 2015-07-08 16:13:45 +0000
@@ -25,7 +25,7 @@
from zope.error.interfaces import IErrorReportingUtility
from zope.event import notify
from zope.exceptions.exceptionformatter import format_exception
-from zope.interface import implements
+from zope.interface import implementer
from zope.publisher.interfaces.xmlrpc import IXMLRPCRequest
from zope.traversing.namespace import view
@@ -82,13 +82,13 @@
return True
+@implementer(IErrorReportEvent)
class ErrorReportEvent(ObjectEvent):
"""A new error report has been created."""
- implements(IErrorReportEvent)
-
-
+
+
+@implementer(IErrorReport)
class ErrorReport:
- implements(IErrorReport)
def __init__(self, id, type, value, time, tb_text, username,
url, duration, req_vars, timeline, informational=None,
@@ -289,8 +289,8 @@
return report.get('type', 'No exception type')
+@implementer(IErrorReportingUtility)
class ErrorReportingUtility:
- implements(IErrorReportingUtility)
_ignored_exceptions = set(['TranslationUnavailable', 'NoReferrerError'])
_ignored_exceptions_for_offsite_referer = set([
@@ -469,8 +469,8 @@
globalErrorUtility = ErrorReportingUtility()
+@implementer(IErrorReportRequest)
class ErrorReportRequest:
- implements(IErrorReportRequest)
oopsid = None
=== modified file 'lib/lp/services/webapp/escaping.py'
--- lib/lp/services/webapp/escaping.py 2013-02-06 04:22:43 +0000
+++ lib/lp/services/webapp/escaping.py 2015-07-08 16:13:45 +0000
@@ -13,7 +13,7 @@
Message,
translate,
)
-from zope.interface import implements
+from zope.interface import implementer
from lp.services.webapp.interfaces import IStructuredString
@@ -81,10 +81,9 @@
return obj_or_msgid
+@implementer(IStructuredString)
class structured:
- implements(IStructuredString)
-
def __init__(self, text, *reps, **kwreps):
text = unicode(translate_if_i18n(text))
self.text = text
=== modified file 'lib/lp/services/webapp/interaction.py'
--- lib/lp/services/webapp/interaction.py 2013-04-09 09:47:58 +0000
+++ lib/lp/services/webapp/interaction.py 2015-07-08 16:13:45 +0000
@@ -36,7 +36,7 @@
from zope.authentication.interfaces import IUnauthenticatedPrincipal
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from zope.publisher.interfaces import IPublicationRequest
from zope.security.interfaces import IParticipation
from zope.security.management import (
@@ -168,18 +168,18 @@
return setupInteractionByEmail(naked_email.email, participation)
+@implementer(IParticipation)
class Participation:
"""A very simple participation."""
- implements(IParticipation)
interaction = None
principal = None
+@implementer(IInteractionExtras)
class InteractionExtras:
"""Extra data attached to all interactions. See `IInteractionExtras`."""
- implements(IInteractionExtras)
permit_timeout_from_features = False
=== modified file 'lib/lp/services/webapp/interfaces.py'
--- lib/lp/services/webapp/interfaces.py 2015-01-29 13:24:42 +0000
+++ lib/lp/services/webapp/interfaces.py 2015-07-08 16:13:45 +0000
@@ -19,7 +19,7 @@
from zope.component.interfaces import IObjectEvent
from zope.interface import (
Attribute,
- implements,
+ implementer,
Interface,
)
from zope.publisher.interfaces.browser import IBrowserApplicationRequest
@@ -443,16 +443,16 @@
'The login id that was used. For example, an email address.')
+@implementer(ILoggedInEvent)
class CookieAuthLoggedInEvent:
- implements(ILoggedInEvent)
def __init__(self, request, login):
self.request = request
self.login = login
+@implementer(IPrincipalIdentifiedEvent)
class CookieAuthPrincipalIdentifiedEvent:
- implements(IPrincipalIdentifiedEvent)
def __init__(self, principal, request, login):
self.principal = principal
@@ -460,8 +460,8 @@
self.login = login
+@implementer(ILoggedInEvent, IPrincipalIdentifiedEvent)
class BasicAuthLoggedInEvent:
- implements(ILoggedInEvent, IPrincipalIdentifiedEvent)
def __init__(self, request, login, principal):
# these one from ILoggedInEvent
@@ -476,8 +476,8 @@
"""An event which gets sent after someone has logged out via a form."""
+@implementer(ILoggedOutEvent)
class LoggedOutEvent:
- implements(ILoggedOutEvent)
def __init__(self, request):
self.request = request
@@ -758,11 +758,10 @@
request = Attribute("The active request.")
+@implementer(IFinishReadOnlyRequestEvent)
class FinishReadOnlyRequestEvent:
"""An event which gets sent when the publication is ended"""
- implements(IFinishReadOnlyRequestEvent)
-
def __init__(self, ob, request):
self.object = ob
self.request = request
=== modified file 'lib/lp/services/webapp/launchbag.py'
--- lib/lp/services/webapp/launchbag.py 2015-01-29 13:26:13 +0000
+++ lib/lp/services/webapp/launchbag.py 2015-07-08 16:13:45 +0000
@@ -12,7 +12,7 @@
import pytz
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from lp.app.interfaces.launchpad import ILaunchpadCelebrities
from lp.blueprints.interfaces.specification import ISpecification
@@ -37,10 +37,9 @@
_utc_tz = pytz.timezone('UTC')
+@implementer(IOpenLaunchBag)
class LaunchBag:
- implements(IOpenLaunchBag)
-
# Map Interface to attribute name.
_registry = {
IPerson: 'person',
=== modified file 'lib/lp/services/webapp/menu.py'
--- lib/lp/services/webapp/menu.py 2014-02-26 05:36:25 +0000
+++ lib/lp/services/webapp/menu.py 2015-07-08 16:13:45 +0000
@@ -28,7 +28,7 @@
URI,
)
from zope.component import getMultiAdapter
-from zope.interface import implements
+from zope.interface import implementer
from zope.security.proxy import (
isinstance as zope_isinstance,
removeSecurityProxy,
@@ -78,13 +78,13 @@
return getattr(removeSecurityProxy(view), '__launchpad_facetname__', None)
+@implementer(ILinkData)
class LinkData:
"""General links that aren't default links.
Instances of this class just provide link data. The class is also known
as 'Link' to make it nice to use when defining menus.
"""
- implements(ILinkData)
def __init__(self, target, text, summary=None, icon=None, enabled=True,
site=None, menu=None, hidden=False):
@@ -122,9 +122,9 @@
Link = LinkData
+@implementer(ILink)
class MenuLink:
"""Adapter from ILinkData to ILink."""
- implements(ILink)
delegates(ILinkData, context='_linkdata')
# These attributes are set by the menus infrastructure.
@@ -175,9 +175,9 @@
return self.url.path
+@implementer(IFacetLink)
class FacetLink(MenuLink):
"""Adapter from ILinkData to IFacetLink."""
- implements(IFacetLink)
# This attribute is set by the menus infrastructure.
selected = False
@@ -189,11 +189,10 @@
MENU_ANNOTATION_KEY = 'lp.services.webapp.menu.links'
+@implementer(IMenuBase)
class MenuBase(UserAttributeCache):
"""Base class for facets and menus."""
- implements(IMenuBase)
-
links = None
extra_attributes = None
enable_only = ALL_LINKS
@@ -337,11 +336,10 @@
yield link
+@implementer(IFacetMenu)
class FacetMenu(MenuBase):
"""Base class for facet menus."""
- implements(IFacetMenu)
-
_baseclassname = 'FacetMenu'
# See IFacetMenu.
@@ -364,27 +362,24 @@
link.selected = True
+@implementer(IApplicationMenu)
class ApplicationMenu(MenuBase):
"""Base class for application menus."""
- implements(IApplicationMenu)
-
_baseclassname = 'ApplicationMenu'
+@implementer(IContextMenu)
class ContextMenu(MenuBase):
"""Base class for context menus."""
- implements(IContextMenu)
-
_baseclassname = 'ContextMenu'
+@implementer(INavigationMenu)
class NavigationMenu(MenuBase):
"""Base class for navigation menus."""
- implements(INavigationMenu)
-
_baseclassname = 'NavigationMenu'
title = None
=== modified file 'lib/lp/services/webapp/metazcml.py'
--- lib/lp/services/webapp/metazcml.py 2013-04-10 10:47:21 +0000
+++ lib/lp/services/webapp/metazcml.py 2015-07-08 16:13:45 +0000
@@ -29,7 +29,7 @@
)
from zope.contenttype import guess_content_type
from zope.interface import (
- implements,
+ implementer,
Interface,
)
from zope.pagetemplate.engine import TrustedEngine
@@ -340,12 +340,11 @@
self.vars = InterfaceInstanceDispatcher(interface, instance)
+# This is not true in this base class. It will be true for subclasses that
+# provide an 'inside' property.
+@implementer(ICanonicalUrlData)
class CanonicalUrlDataBase:
- # This is not true in this base class. It will be true for subclasses
- # that provide an 'inside' property.
- implements(ICanonicalUrlData)
-
# Filled in by subclass.
_for = None
_compiled_path_expression = None
@@ -591,8 +590,8 @@
access_level = IDefineLaunchpadPermissionDirective['access_level']
+@implementer(ILaunchpadPermission)
class LaunchpadPermission(Permission):
- implements(ILaunchpadPermission)
def __init__(self, id, title, access_level, description):
assert access_level in ["read", "write"], (
=== modified file 'lib/lp/services/webapp/namespace.py'
--- lib/lp/services/webapp/namespace.py 2013-04-10 09:36:25 +0000
+++ lib/lp/services/webapp/namespace.py 2015-07-08 16:13:45 +0000
@@ -14,7 +14,7 @@
ViewPageTemplateFile,
)
from zope.component import getMultiAdapter
-from zope.interface import implements
+from zope.interface import implementer
from zope.publisher.defaultview import getDefaultViewName
from zope.publisher.interfaces.browser import IBrowserPublisher
from zope.security.proxy import removeSecurityProxy
@@ -51,6 +51,7 @@
return self.context
+@implementer(IBrowserPublisher)
class JsonModelNamespaceView(view):
"""A namespace view to handle traversals with ++model++.
@@ -59,8 +60,6 @@
initialize will not be presented by the namespace.
"""
- implements(IBrowserPublisher)
-
def traverse(self, name, ignored):
"""Model traversal adapter.
=== modified file 'lib/lp/services/webapp/notifications.py'
--- lib/lp/services/webapp/notifications.py 2014-01-30 15:04:06 +0000
+++ lib/lp/services/webapp/notifications.py 2015-07-08 16:13:45 +0000
@@ -16,7 +16,7 @@
from datetime import datetime
-from zope.interface import implements
+from zope.interface import implementer
from zope.session.interfaces import ISession
from lp.services.config import config
@@ -38,6 +38,7 @@
SESSION_KEY = 'launchpad'
+@implementer(INotificationRequest)
class NotificationRequest:
"""NotificationRequest extracts notifications to display to the user
from the request and session
@@ -69,13 +70,13 @@
>>> [notification.message for notification in request.notifications]
['Fnord', u'Aargh']
"""
- implements(INotificationRequest)
@property
def notifications(self):
return INotificationResponse(self).notifications
+@implementer(INotificationResponse)
class NotificationResponse:
"""The NotificationResponse collects notifications to propogate to the
next page loaded. Notifications are stored in the session, with a key
@@ -163,7 +164,6 @@
>>> session.has_key('notifications')
False
"""
- implements(INotificationResponse)
# We stuff our Notifications here until we are sure we should persist it
# in the request. This avoids needless calls to the session machinery
@@ -243,6 +243,7 @@
self.addNotification(msg, BrowserNotificationLevel.ERROR)
+@implementer(INotificationList)
class NotificationList(list):
"""
Collection of INotification instances with a creation date
@@ -272,7 +273,6 @@
... print repr(notification.message)
u'A debug message'
"""
- implements(INotificationList)
created = None
@@ -297,8 +297,8 @@
]
+@implementer(INotification)
class Notification:
- implements(INotification)
level = None
message = None
=== modified file 'lib/lp/services/webapp/pgsession.py'
--- lib/lp/services/webapp/pgsession.py 2014-09-02 02:03:37 +0000
+++ lib/lp/services/webapp/pgsession.py 2015-07-08 16:13:45 +0000
@@ -14,7 +14,7 @@
from storm.zope.interfaces import IZStorm
from zope.authentication.interfaces import IUnauthenticatedPrincipal
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from zope.session.interfaces import (
IClientIdManager,
ISessionData,
@@ -39,6 +39,7 @@
return getUtility(IZStorm).get(self.store_name)
+@implementer(ISessionDataContainer)
class PGSessionDataContainer(PGSessionBase):
"""An ISessionDataContainer that stores data in PostgreSQL
@@ -61,7 +62,6 @@
Removing expired data needs to be done out of band.
"""
- implements(ISessionDataContainer)
# If we have a low enough resolution, we can determine active users
# using the session data.
@@ -81,8 +81,8 @@
pass
+@implementer(ISessionData)
class PGSessionData(PGSessionBase):
- implements(ISessionData)
session_data_container = None
@@ -161,8 +161,8 @@
pass
+@implementer(ISessionPkgData)
class PGSessionPkgData(DictMixin, PGSessionBase):
- implements(ISessionPkgData)
@property
def store(self):
=== modified file 'lib/lp/services/webapp/preferredcharsets.py'
--- lib/lp/services/webapp/preferredcharsets.py 2010-08-20 20:31:18 +0000
+++ lib/lp/services/webapp/preferredcharsets.py 2015-07-08 16:13:45 +0000
@@ -9,15 +9,15 @@
from zope.component import adapts
from zope.i18n.interfaces import IUserPreferredCharsets
-from zope.interface import implements
+from zope.interface import implementer
from zope.publisher.interfaces.http import IHTTPRequest
+@implementer(IUserPreferredCharsets)
class Utf8PreferredCharsets:
"""An IUserPreferredCharsets which always chooses utf-8."""
adapts(IHTTPRequest)
- implements(IUserPreferredCharsets)
def __init__(self, request):
self.request = request
=== modified file 'lib/lp/services/webapp/publication.py'
--- lib/lp/services/webapp/publication.py 2014-11-28 22:07:05 +0000
+++ lib/lp/services/webapp/publication.py 2015-07-08 16:13:45 +0000
@@ -39,7 +39,7 @@
from zope.error.interfaces import IErrorReportingUtility
from zope.event import notify
from zope.interface import (
- implements,
+ implementer,
providedBy,
)
from zope.publisher.interfaces import (
@@ -174,6 +174,7 @@
"""Fake exception used to log OOPS information when profiling pages."""
+@implementer(IPublishTraverse)
class LoginRoot:
"""Object that provides IPublishTraverse to return only itself.
@@ -181,7 +182,6 @@
special namespaces to be traversed, but doesn't traverse other
normal names.
"""
- implements(IPublishTraverse)
def publishTraverse(self, request, name):
if not request.getTraversalStack():
=== modified file 'lib/lp/services/webapp/publisher.py'
--- lib/lp/services/webapp/publisher.py 2014-11-16 08:31:41 +0000
+++ lib/lp/services/webapp/publisher.py 2015-07-08 16:13:45 +0000
@@ -47,7 +47,7 @@
from zope.component.interfaces import ComponentLookupError
from zope.interface import (
directlyProvides,
- implements,
+ implementer,
)
from zope.interface.advice import addClassAdvisor
from zope.publisher.defaultview import getDefaultViewName
@@ -566,21 +566,19 @@
return beta_info
+@implementer(IXMLRPCView, IMethodPublisher)
class LaunchpadXMLRPCView(UserAttributeCache):
"""Base class for writing XMLRPC view code."""
- implements(IXMLRPCView, IMethodPublisher)
-
def __init__(self, context, request):
self.context = context
self.request = request
+@implementer(ICanonicalUrlData)
class LaunchpadRootUrlData:
"""ICanonicalUrlData for the ILaunchpadRoot object."""
- implements(ICanonicalUrlData)
-
path = ''
inside = None
rootsite = None
@@ -619,13 +617,13 @@
yield urldata.inside
+@implementer(IAbsoluteURL)
class CanonicalAbsoluteURL:
"""A bridge between Zope's IAbsoluteURL and Launchpad's canonical_url.
We don't implement the whole interface; only what's needed to
make absoluteURL() succceed.
"""
- implements(IAbsoluteURL)
def __init__(self, context, request):
"""Initialize with respect to a context and request."""
@@ -832,15 +830,16 @@
return field
+@implementer(ILaunchpadApplication, ILaunchpadRoot)
class RootObject:
- implements(ILaunchpadApplication, ILaunchpadRoot)
+ pass
rootObject = ProxyFactory(RootObject(), NamesChecker(["__class__"]))
+@implementer(ILaunchpadContainer)
class LaunchpadContainer:
- implements(ILaunchpadContainer)
def __init__(self, context):
self.context = context
@@ -854,13 +853,13 @@
return self.context == scope
+@implementer(IBrowserPublisher)
class Navigation:
"""Base class for writing browser navigation components.
Note that the canonical_url part of Navigation is used outside of
the browser context.
"""
- implements(IBrowserPublisher)
def __init__(self, context, request=None):
"""Initialize with context and maybe with a request."""
@@ -1040,8 +1039,8 @@
return self.context, (view_name, )
+@implementer(IBrowserPublisher)
class RedirectionView:
- implements(IBrowserPublisher)
def __init__(self, target, request, status=None, cache_view=None):
self.target = target
@@ -1067,6 +1066,7 @@
return self, ()
+@implementer(IBrowserPublisher)
class RenamedView:
"""Redirect permanently to the new name of the view.
@@ -1076,7 +1076,6 @@
:param rootsite: (optional) the virtual host to redirect to,
e.g. 'answers'.
"""
- implements(IBrowserPublisher)
def __init__(self, context, request, new_name, rootsite=None):
self.context = context
=== modified file 'lib/lp/services/webapp/servers.py'
--- lib/lp/services/webapp/servers.py 2015-03-17 12:29:03 +0000
+++ lib/lp/services/webapp/servers.py 2015-07-08 16:13:45 +0000
@@ -36,7 +36,7 @@
from zope.formlib.widget import SimpleInputWidget
from zope.interface import (
alsoProvides,
- implements,
+ implementer,
)
from zope.publisher.browser import (
BrowserRequest,
@@ -234,13 +234,13 @@
return request
+@implementer(IRequestPublicationFactory)
class VirtualHostRequestPublicationFactory:
"""An `IRequestPublicationFactory` handling request to a Launchpad vhost.
This factory will accepts requests to a particular Launchpad virtual host
that matches a particular port and set of HTTP methods.
"""
- implements(IRequestPublicationFactory)
default_methods = ['GET', 'HEAD', 'POST']
@@ -559,11 +559,10 @@
return url
+@implementer(IBasicLaunchpadRequest)
class BasicLaunchpadRequest(LaunchpadBrowserRequestMixin):
"""Mixin request class to provide stepstogo."""
- implements(IBasicLaunchpadRequest)
-
strict_transport_security = True
def __init__(self, body_instream, environ, response=None):
@@ -634,16 +633,15 @@
return get_query_string_params(self)
+@implementer(
+ ILaunchpadBrowserApplicationRequest, ISynchronizer,
+ lp.layers.LaunchpadLayer)
class LaunchpadBrowserRequest(BasicLaunchpadRequest, BrowserRequest,
NotificationRequest, ErrorReportRequest):
"""Integration of launchpad mixin request classes to make an uber
launchpad request class.
"""
- implements(
- ILaunchpadBrowserApplicationRequest, ISynchronizer,
- lp.layers.LaunchpadLayer)
-
retry_max_count = 5 # How many times we're willing to retry
def __init__(self, body_instream, environ, response=None):
@@ -694,11 +692,10 @@
pass
+@implementer(IBrowserFormNG)
class BrowserFormNG:
"""Wrapper that provides IBrowserFormNG around a regular form dict."""
- implements(IBrowserFormNG)
-
def __init__(self, form):
"""Create a new BrowserFormNG that wraps a dict containing form data.
"""
@@ -864,6 +861,9 @@
return request.response
+@implementer(
+ INotificationRequest, IBasicLaunchpadRequest, IParticipation,
+ lp.layers.LaunchpadLayer)
class LaunchpadTestRequest(LaunchpadBrowserRequestMixin,
TestRequest, ErrorReportRequest):
"""Mock request for use in unit and functional tests.
@@ -904,9 +904,6 @@
>>> request.query_string_params == {'a': ['1'], 'b': ['2'], 'c': ['3']}
True
"""
- implements(
- INotificationRequest, IBasicLaunchpadRequest, IParticipation,
- lp.layers.LaunchpadLayer)
# These two attributes satisfy IParticipation.
principal = None
@@ -969,6 +966,7 @@
return
+@implementer(INotificationResponse)
class LaunchpadTestResponse(LaunchpadBrowserResponse):
"""Mock response for use in unit and functional tests.
@@ -983,7 +981,6 @@
>>> request.notifications[0].message
u'Warning Notification'
"""
- implements(INotificationResponse)
uuid = 'LaunchpadTestResponse'
@@ -1146,9 +1143,9 @@
return auth_utility.unauthenticatedPrincipal()
+@implementer(lp.layers.FeedsLayer)
class FeedsBrowserRequest(LaunchpadBrowserRequest):
"""Request type for a launchpad feed."""
- implements(lp.layers.FeedsLayer)
# Feeds is not served over SSL, so don't force SSL.
strict_transport_security = False
@@ -1156,8 +1153,9 @@
# ---- testopenid
+@implementer(lp.layers.TestOpenIDLayer)
class TestOpenIDBrowserRequest(LaunchpadBrowserRequest):
- implements(lp.layers.TestOpenIDLayer)
+ pass
class TestOpenIDBrowserPublication(LaunchpadBrowserPublication):
@@ -1325,8 +1323,8 @@
return principal
+@implementer(lp.layers.WebServiceLayer)
class LaunchpadWebServiceRequestTraversal(WebServiceRequestTraversal):
- implements(lp.layers.WebServiceLayer)
def getRootURL(self, rootsite):
"""See IBasicLaunchpadRequest."""
@@ -1510,9 +1508,9 @@
raise ProtocolErrorException(self.status, self.headers)
+@implementer(ILaunchpadProtocolError)
class ProtocolErrorException(Exception):
"""An exception for requests that turn out to be protocol errors."""
- implements(ILaunchpadProtocolError)
def __init__(self, status, headers):
"""Store status and headers for rendering in the HTTP response."""
=== modified file 'lib/lp/services/webapp/tests/test_authorization.py'
--- lib/lp/services/webapp/tests/test_authorization.py 2012-09-28 06:25:44 +0000
+++ lib/lp/services/webapp/tests/test_authorization.py 2015-07-08 16:13:45 +0000
@@ -14,9 +14,9 @@
provideUtility,
)
from zope.interface import (
- classProvides,
- implements,
+ implementer,
Interface,
+ provider,
)
from zope.security.interfaces import Unauthorized
import zope.testing.cleanup
@@ -135,11 +135,11 @@
return Checker(obj, self.calls)
+@implementer(IObjectPrivacy)
class Object:
"""An arbitrary object, adaptable to `IObjectPrivacy`.
For simplicity we implement `IObjectPrivacy` directly."""
- implements(IObjectPrivacy)
is_private = False
@@ -167,20 +167,20 @@
yield self.object_two, self.permission
+@implementer(ILaunchpadPermission)
class PermissionAccessLevel:
"""A minimal implementation of `ILaunchpadPermission`."""
- implements(ILaunchpadPermission)
access_level = 'read'
+@implementer(IPerson, IPersonRoles)
class FakePerson:
"""A minimal object to represent a person."""
- implements(IPerson, IPersonRoles)
-
-
+
+
+@implementer(ILaunchpadPrincipal)
class FakeLaunchpadPrincipal:
"""A minimal principal implementing `ILaunchpadPrincipal`"""
- implements(ILaunchpadPrincipal)
person = FakePerson()
scope = None
access_level = ''
@@ -195,9 +195,9 @@
pass
+@provider(IStoreSelector)
class FakeStoreSelector:
"""A store selector that always returns a `FakeStore`."""
- classProvides(IStoreSelector)
@staticmethod
def get(name, flavor):
@@ -431,8 +431,8 @@
"""A marker interface for objects that only contain themselves."""
+@implementer(ILoneObject, ILaunchpadContainer)
class LoneObject:
- implements(ILoneObject, ILaunchpadContainer)
def isWithin(self, context):
return self == context
@@ -675,11 +675,10 @@
self.assertEqual(cache_expected, cache)
+@implementer(Interface)
class AvailableWithPermissionObject:
""" An object used to test available_with_permission."""
- implements(Interface)
-
@available_with_permission('launchpad.Edit', 'foo')
def test_function_foo(self, foo, bar=None):
pass
=== modified file 'lib/lp/services/webapp/tests/test_authutility.py'
--- lib/lp/services/webapp/tests/test_authutility.py 2013-04-11 05:53:01 +0000
+++ lib/lp/services/webapp/tests/test_authutility.py 2015-07-08 16:13:45 +0000
@@ -14,7 +14,7 @@
provideAdapter,
provideUtility,
)
-from zope.interface import implements
+from zope.interface import implementer
from zope.principalregistry.principalregistry import UnauthenticatedPrincipal
from zope.publisher.browser import TestRequest
from zope.publisher.http import BasicAuthAdapter
@@ -33,13 +33,13 @@
)
+@implementer(IPerson)
class DummyPerson(object):
- implements(IPerson)
is_valid_person = True
+@implementer(IAccount)
class DummyAccount(object):
- implements(IAccount)
person = DummyPerson()
@@ -47,8 +47,8 @@
Bruce.person = Bruce.account.person
+@implementer(IPlacelessLoginSource)
class DummyPlacelessLoginSource(object):
- implements(IPlacelessLoginSource)
def getPrincipalByLogin(self, id):
return Bruce
=== modified file 'lib/lp/services/webapp/tests/test_breadcrumbs.py'
--- lib/lp/services/webapp/tests/test_breadcrumbs.py 2014-11-24 09:16:35 +0000
+++ lib/lp/services/webapp/tests/test_breadcrumbs.py 2015-07-08 16:13:45 +0000
@@ -4,7 +4,7 @@
__metaclass__ = type
from zope.i18nmessageid import Message
-from zope.interface import implements
+from zope.interface import implementer
from lp.app.browser.launchpad import Hierarchy
from lp.services.webapp.breadcrumb import Breadcrumb
@@ -18,8 +18,8 @@
from lp.testing.breadcrumbs import BaseBreadcrumbTestCase
+@implementer(ICanonicalUrlData)
class Cookbook:
- implements(ICanonicalUrlData)
rootsite = None
path = 'cookbook'
inside = None
=== modified file 'lib/lp/services/webapp/tests/test_errorlog.py'
--- lib/lp/services/webapp/tests/test_errorlog.py 2013-04-09 07:59:41 +0000
+++ lib/lp/services/webapp/tests/test_errorlog.py 2015-07-08 16:13:45 +0000
@@ -23,7 +23,7 @@
from zope.authentication.interfaces import IUnauthenticatedPrincipal
from zope.interface import (
directlyProvides,
- implements,
+ implementer,
)
from zope.publisher.browser import TestRequest
from zope.publisher.interfaces import NotFound
@@ -611,8 +611,8 @@
self.failUnless(_is_sensitive(request, 'oauth_signature'))
+@implementer(IUnauthenticatedPrincipal)
class UnauthenticatedPrincipal:
- implements(IUnauthenticatedPrincipal)
id = 0
title = ''
description = ''
=== modified file 'lib/lp/services/webapp/tests/test_navigation.py'
--- lib/lp/services/webapp/tests/test_navigation.py 2011-12-24 17:49:30 +0000
+++ lib/lp/services/webapp/tests/test_navigation.py 2015-07-08 16:13:45 +0000
@@ -9,7 +9,7 @@
)
from zope.configuration import xmlconfig
from zope.interface import (
- implements,
+ implementer,
Interface,
)
from zope.publisher.interfaces.browser import (
@@ -77,16 +77,18 @@
cleanUp()
+@implementer(IDefaultBrowserLayer)
class DefaultBrowserLayer:
- implements(IDefaultBrowserLayer)
+ pass
class IThing(Interface):
pass
+@implementer(IThing)
class Thing(object):
- implements(IThing)
+ pass
class ThingNavigation(Navigation):
@@ -101,8 +103,9 @@
pass
+@implementer(IOtherLayer)
class OtherLayer:
- implements(IOtherLayer)
+ pass
this = "lp.services.webapp.tests.test_navigation"
=== modified file 'lib/lp/services/webapp/tests/test_notifications.py'
--- lib/lp/services/webapp/tests/test_notifications.py 2013-04-11 07:03:36 +0000
+++ lib/lp/services/webapp/tests/test_notifications.py 2015-07-08 16:13:45 +0000
@@ -10,7 +10,7 @@
from zope.app.testing import placelesssetup
from zope.component import provideAdapter
-from zope.interface import implements
+from zope.interface import implementer
from zope.publisher.browser import TestRequest
from zope.publisher.interfaces.browser import IBrowserRequest
from zope.publisher.interfaces.http import IHTTPApplicationResponse
@@ -27,8 +27,8 @@
from lp.services.webapp.notifications import NotificationResponse
+@implementer(ISession)
class MockSession(dict):
- implements(ISession)
def __getitem__(self, key):
try:
@@ -38,8 +38,8 @@
return super(MockSession, self).__getitem__(key)
+@implementer(ISessionData)
class MockSessionData(dict):
- implements(ISessionData)
lastAccessTime = 0
@@ -47,8 +47,8 @@
return self
+@implementer(IHTTPApplicationResponse)
class MockHTTPApplicationResponse:
- implements(IHTTPApplicationResponse)
def redirect(self, location, status=None, trusted=False):
"""Just report the redirection to the doctest"""
=== modified file 'lib/lp/services/webapp/tests/test_pageid.py'
--- lib/lp/services/webapp/tests/test_pageid.py 2012-09-24 19:10:03 +0000
+++ lib/lp/services/webapp/tests/test_pageid.py 2015-07-08 16:13:45 +0000
@@ -6,7 +6,7 @@
from lazr.restful.interfaces import ICollectionResource
-from zope.interface import implements
+from zope.interface import implementer
from lp.services.webapp.publication import LaunchpadBrowserPublication
from lp.services.webapp.servers import WebServicePublication
@@ -39,9 +39,9 @@
return 'result'
+@implementer(ICollectionResource)
class FakeCollectionResourceView(FakeView):
"""A view object that provides ICollectionResource."""
- implements(ICollectionResource)
def __init__(self):
super(FakeCollectionResourceView, self).__init__()
=== modified file 'lib/lp/services/webapp/tests/test_publisher.py'
--- lib/lp/services/webapp/tests/test_publisher.py 2014-05-29 06:26:57 +0000
+++ lib/lp/services/webapp/tests/test_publisher.py 2015-07-08 16:13:45 +0000
@@ -13,7 +13,7 @@
from lazr.restful.interfaces import IJSONRequestCache
import simplejson
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from lp.app.interfaces.launchpad import IPrivacy
from lp.services.features.flags import flag_info
@@ -363,8 +363,8 @@
def test_view_privacy(self):
# View privacy is based on the context.
+ @implementer(IPrivacy)
class PrivateObject(object):
- implements(IPrivacy)
def __init__(self, private):
self.private = private
=== modified file 'lib/lp/services/webapp/tests/test_servers.py'
--- lib/lp/services/webapp/tests/test_servers.py 2015-03-17 12:29:03 +0000
+++ lib/lp/services/webapp/tests/test_servers.py 2015-07-08 16:13:45 +0000
@@ -26,7 +26,7 @@
getUtility,
)
from zope.interface import (
- implements,
+ implementer,
Interface,
)
@@ -289,8 +289,9 @@
# For this test we need to make the URL "/foo" resolve to a
# resource. To this end, we'll define a top-level collection
# named 'foo'.
+ @implementer(IGenericCollection)
class GenericCollection:
- implements(IGenericCollection)
+ pass
class MyRootResource(RootResource):
@@ -556,12 +557,14 @@
"""Marker interface for a thing."""
+@implementer(IThing)
class Thing:
- implements(IThing)
-
-
+ pass
+
+
+@implementer(IThingSet)
class ThingSet:
- implements(IThingSet)
+ pass
class TestLaunchpadBrowserRequest_getNearest(TestCase):
=== modified file 'lib/lp/services/webapp/tests/test_vocabulary.py'
--- lib/lp/services/webapp/tests/test_vocabulary.py 2012-01-01 02:58:52 +0000
+++ lib/lp/services/webapp/tests/test_vocabulary.py 2015-07-08 16:13:45 +0000
@@ -4,7 +4,7 @@
__metaclass__ = type
-from zope.interface import implements
+from zope.interface import implementer
from lp.services.webapp.vocabulary import (
FilteredVocabularyBase,
@@ -15,8 +15,8 @@
from lp.testing.layers import ZopelessLayer
+@implementer(IHugeVocabulary)
class TestVocabulary(FilteredVocabularyBase):
- implements(IHugeVocabulary)
def search(self, query=None, vocab_filter=None):
assert(isinstance(vocab_filter, VocabularyFilter))
=== modified file 'lib/lp/services/webapp/tests/test_webapp_authorization.py'
--- lib/lp/services/webapp/tests/test_webapp_authorization.py 2013-01-03 00:27:37 +0000
+++ lib/lp/services/webapp/tests/test_webapp_authorization.py 2015-07-08 16:13:45 +0000
@@ -7,7 +7,7 @@
from zope.component import provideAdapter
from zope.interface import (
- implements,
+ implementer,
Interface,
)
from zope.testing.cleanup import CleanUp
@@ -75,8 +75,8 @@
"""A marker interface for objects that only contain themselves."""
+@implementer(ILoneObject, ILaunchpadContainer)
class LoneObject:
- implements(ILoneObject, ILaunchpadContainer)
def isWithin(self, context):
return self == context
=== modified file 'lib/lp/services/webapp/vocabulary.py'
--- lib/lp/services/webapp/vocabulary.py 2015-04-28 15:22:46 +0000
+++ lib/lp/services/webapp/vocabulary.py 2015-07-08 16:13:45 +0000
@@ -33,7 +33,7 @@
from storm.store import EmptyResultSet
from zope.interface import (
Attribute,
- implements,
+ implementer,
Interface,
)
from zope.schema.interfaces import (
@@ -150,6 +150,7 @@
pass
+@implementer(ICountableIterator)
class CountableIterator:
"""Implements a wrapping iterator with a count() method.
@@ -158,8 +159,6 @@
BatchNavigator.
"""
- implements(ICountableIterator)
-
def __init__(self, count, iterator, item_wrapper=None):
"""Construct a CountableIterator instance.
@@ -279,6 +278,7 @@
return []
+@implementer(IVocabulary, IVocabularyTokenized)
class SQLObjectVocabularyBase(FilteredVocabularyBase):
"""A base class for widgets that are rendered to collect values
for attributes that are SQLObjects, e.g. ForeignKey.
@@ -293,7 +293,6 @@
Then the vocabulary for the widget that captures a value for bar
should derive from SQLObjectVocabularyBase.
"""
- implements(IVocabulary, IVocabularyTokenized)
_orderBy = None
_filter = None
_clauseTables = None
@@ -435,10 +434,9 @@
return self.emptySelectResults()
+@implementer(IHugeVocabulary)
class NamedSQLObjectHugeVocabulary(NamedSQLObjectVocabulary):
"""A NamedSQLObjectVocabulary that implements IHugeVocabulary."""
-
- implements(IHugeVocabulary)
_orderBy = 'name'
displayname = None
step_title = 'Search'
@@ -470,6 +468,7 @@
return self.iterator(results.count(), results, self.toTerm)
+@implementer(IVocabulary, IVocabularyTokenized)
class StormVocabularyBase(FilteredVocabularyBase):
"""A base class for widgets that are rendered to collect values
for attributes that are Storm references.
@@ -485,7 +484,6 @@
Then the vocabulary for the widget that captures a value for bar
should derive from StormVocabularyBase.
"""
- implements(IVocabulary, IVocabularyTokenized)
_order_by = None
_clauses = []
=== modified file 'lib/lp/services/webservice/bytestorage.py'
--- lib/lp/services/webservice/bytestorage.py 2012-01-01 02:58:52 +0000
+++ lib/lp/services/webservice/bytestorage.py 2015-07-08 16:13:45 +0000
@@ -16,7 +16,7 @@
getMultiAdapter,
getUtility,
)
-from zope.interface import implements
+from zope.interface import implementer
from lp.services.librarian.interfaces import (
ILibraryFileAliasSet,
@@ -25,9 +25,9 @@
from lp.services.webapp.interfaces import ICanonicalUrlData
+@implementer(IByteStorage, ICanonicalUrlData)
class LibraryBackedByteStorage:
"""See `IByteStorage`."""
- implements(IByteStorage, ICanonicalUrlData)
def __init__(self, entry, field):
"""Initialize as the backing storage for one entry's field."""
=== modified file 'lib/lp/services/webservice/doc/webservice-configuration.txt'
--- lib/lp/services/webservice/doc/webservice-configuration.txt 2014-01-30 15:04:06 +0000
+++ lib/lp/services/webservice/doc/webservice-configuration.txt 2015-07-08 16:13:45 +0000
@@ -27,10 +27,10 @@
>>> from lp.services.config import config
>>> from textwrap import dedent
- >>> from zope.interface import implements
+ >>> from zope.interface import implementer
>>> from lp.services.webapp.interfaces import ILaunchBag
- >>> class FakeLaunchBag:
- ... implements(ILaunchBag)
+ >>> @implementer(ILaunchBag)
+ ... class FakeLaunchBag:
... developer = False
>>> the_launchbag = FakeLaunchBag()
>>> provideUtility(the_launchbag, ILaunchBag)
=== modified file 'lib/lp/services/webservice/json.py'
--- lib/lp/services/webservice/json.py 2011-07-14 21:44:22 +0000
+++ lib/lp/services/webservice/json.py 2015-07-08 16:13:45 +0000
@@ -10,12 +10,12 @@
from lazr.restful.interfaces import IJSONPublishable
-from zope.interface import implements
-
-
+from zope.interface import implementer
+
+
+@implementer(IJSONPublishable)
class StrJSONSerializer:
"""Simple JSON serializer that simply str() it's context. """
- implements(IJSONPublishable)
def __init__(self, context):
self.context = context
=== modified file 'lib/lp/services/webservice/me.py'
--- lib/lp/services/webservice/me.py 2012-01-01 02:58:52 +0000
+++ lib/lp/services/webservice/me.py 2015-07-08 16:13:45 +0000
@@ -14,7 +14,7 @@
ITopLevelEntryLink,
)
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from lp.registry.interfaces.person import (
IPerson,
@@ -27,9 +27,9 @@
"""A marker interface."""
+@implementer(IMeLink)
class MeLink:
"""The top-level link to the authenticated user's account."""
- implements(IMeLink)
link_name = 'me'
entry_type = IPerson
=== modified file 'lib/lp/services/webservice/pillarset.py'
--- lib/lp/services/webservice/pillarset.py 2012-01-01 02:58:52 +0000
+++ lib/lp/services/webservice/pillarset.py 2015-07-08 16:13:45 +0000
@@ -10,7 +10,7 @@
]
from lazr.restful.interfaces import ITopLevelEntryLink
-from zope.interface import implements
+from zope.interface import implementer
from lp.registry.interfaces.pillar import IPillarNameSet
from lp.services.webapp.interfaces import ICanonicalUrlData
@@ -20,9 +20,9 @@
"""A marker interface."""
+@implementer(IPillarSetLink)
class PillarSetLink:
"""The top-level link to the pillar set."""
- implements(IPillarSetLink)
link_name = 'pillars'
entry_type = IPillarNameSet
=== modified file 'lib/lp/services/webservice/services.py'
--- lib/lp/services/webservice/services.py 2012-02-23 10:13:48 +0000
+++ lib/lp/services/webservice/services.py 2015-07-08 16:13:45 +0000
@@ -10,7 +10,7 @@
]
from lazr.restful.interfaces import ITopLevelEntryLink
-from zope.interface import implements
+from zope.interface import implementer
from lp.app.interfaces.services import IServiceFactory
from lp.services.webapp.interfaces import ICanonicalUrlData
@@ -20,9 +20,9 @@
"""A marker interface."""
+@implementer(IServicesLink)
class ServicesLink:
"""The top-level link to the services factory."""
- implements(IServicesLink)
link_name = 'services'
entry_type = IServiceFactory
=== modified file 'lib/lp/services/worlddata/model/country.py'
--- lib/lp/services/worlddata/model/country.py 2013-06-20 05:50:00 +0000
+++ lib/lp/services/worlddata/model/country.py 2015-07-08 16:13:45 +0000
@@ -9,7 +9,7 @@
SQLRelatedJoin,
StringCol,
)
-from zope.interface import implements
+from zope.interface import implementer
from lp.app.errors import NotFoundError
from lp.services.database.constants import DEFAULT
@@ -22,11 +22,10 @@
)
+@implementer(ICountry)
class Country(SQLBase):
"""A country."""
- implements(ICountry)
-
_table = 'Country'
# default to listing newest first
@@ -47,11 +46,10 @@
intermediateTable='SpokenIn')
+@implementer(ICountrySet)
class CountrySet:
"""A set of countries"""
- implements(ICountrySet)
-
def __getitem__(self, iso3166code2):
country = Country.selectOneBy(iso3166code2=iso3166code2)
if country is None:
@@ -74,11 +72,10 @@
"""See `ICountrySet`."""
return IStore(Country).find(Country).order_by(Country.iso3166code2)
+@implementer(IContinent)
class Continent(SQLBase):
"""See IContinent."""
- implements(IContinent)
-
_table = 'Continent'
_defaultOrder = ['name', 'id']
=== modified file 'lib/lp/services/worlddata/model/language.py'
--- lib/lp/services/worlddata/model/language.py 2015-01-28 16:10:51 +0000
+++ lib/lp/services/worlddata/model/language.py 2015-07-08 16:13:45 +0000
@@ -24,7 +24,7 @@
LeftJoin,
Or,
)
-from zope.interface import implements
+from zope.interface import implementer
from lp.app.errors import NotFoundError
from lp.registry.model.karma import (
@@ -56,8 +56,8 @@
SpokenIn
+@implementer(ILanguage)
class Language(SQLBase):
- implements(ILanguage)
_table = 'Language'
@@ -177,8 +177,8 @@
return self.translators.count()
+@implementer(ILanguageSet)
class LanguageSet:
- implements(ILanguageSet)
@staticmethod
def _getTranslatorJoins():
=== modified file 'lib/lp/services/worlddata/model/spokenin.py'
--- lib/lp/services/worlddata/model/spokenin.py 2013-01-07 02:40:55 +0000
+++ lib/lp/services/worlddata/model/spokenin.py 2015-07-08 16:13:45 +0000
@@ -5,20 +5,19 @@
__all__ = ['SpokenIn']
from sqlobject import ForeignKey
-from zope.interface import implements
+from zope.interface import implementer
from lp.services.database.sqlbase import SQLBase
from lp.services.worlddata.interfaces.spokenin import ISpokenIn
+@implementer(ISpokenIn)
class SpokenIn(SQLBase):
"""A way of telling which languages are spoken in which countries.
This table maps a language which is SpokenIn a country.
"""
- implements(ISpokenIn)
-
_table = 'SpokenIn'
country = ForeignKey(dbName='country', notNull=True, foreignKey='Country')
=== modified file 'lib/lp/services/worlddata/tests/test_helpers.py'
--- lib/lp/services/worlddata/tests/test_helpers.py 2013-04-11 05:53:01 +0000
+++ lib/lp/services/worlddata/tests/test_helpers.py 2015-07-08 16:13:45 +0000
@@ -4,7 +4,7 @@
from doctest import DocTestSuite
import unittest
-from zope.interface import implements
+from zope.interface import implementer
from zope.publisher.interfaces.browser import IBrowserRequest
from lp.registry.interfaces.person import IPerson
@@ -20,8 +20,8 @@
self.alt_suggestion_language = None
+@implementer(ILanguageSet)
class DummyLanguageSet:
- implements(ILanguageSet)
_languages = {
'ja': DummyLanguage('ja', 1),
@@ -34,8 +34,8 @@
return self._languages[key]
+@implementer(IPerson)
class DummyPerson:
- implements(IPerson)
def __init__(self, codes):
self.codes = codes
@@ -54,8 +54,8 @@
pass
+@implementer(IBrowserRequest)
class DummyRequest:
- implements(IBrowserRequest)
def __init__(self, **form_data):
self.form = form_data
@@ -85,8 +85,8 @@
]
+@implementer(ILaunchBag)
class DummyLaunchBag:
- implements(ILaunchBag)
def __init__(self, login=None, user=None):
self.login = login
=== modified file 'lib/lp/soyuz/adapters/copypolicy.py'
--- lib/lp/soyuz/adapters/copypolicy.py 2014-08-20 11:36:15 +0000
+++ lib/lp/soyuz/adapters/copypolicy.py 2015-07-08 16:13:45 +0000
@@ -15,7 +15,7 @@
]
-from zope.interface import implements
+from zope.interface import implementer
from lp.registry.interfaces.pocket import PackagePublishingPocket
from lp.registry.interfaces.series import SeriesStatus
@@ -64,19 +64,19 @@
return True
+@implementer(ICopyPolicy)
class InsecureCopyPolicy(BasicCopyPolicy):
"""A policy for copying from insecure sources."""
- implements(ICopyPolicy)
enum_value = PackageCopyPolicy.INSECURE
+@implementer(ICopyPolicy)
class MassSyncCopyPolicy(BasicCopyPolicy):
"""A policy for mass 'sync' copies.
Exists soley so the classic job runner processes autosyncs last.
"""
- implements(ICopyPolicy)
enum_value = PackageCopyPolicy.MASS_SYNC
=== modified file 'lib/lp/soyuz/adapters/overrides.py'
--- lib/lp/soyuz/adapters/overrides.py 2014-07-29 07:29:32 +0000
+++ lib/lp/soyuz/adapters/overrides.py 2015-07-08 16:13:45 +0000
@@ -26,7 +26,7 @@
from zope.component import getUtility
from zope.interface import (
Attribute,
- implements,
+ implementer,
Interface,
)
from zope.security.proxy import isinstance as zope_isinstance
@@ -102,9 +102,9 @@
"%s objects are not hashable." % self.__class__.__name__)
+@implementer(ISourceOverride)
class SourceOverride(Override):
"""See `ISourceOverride`."""
- implements(ISourceOverride)
def __eq__(self, other):
return (
@@ -121,9 +121,9 @@
self.version, self.new))
+@implementer(IBinaryOverride)
class BinaryOverride(Override):
"""See `IBinaryOverride`."""
- implements(IBinaryOverride)
def __init__(self, component=None, section=None, priority=None,
phased_update_percentage=None, version=None, new=None,
@@ -197,10 +197,9 @@
pass
+@implementer(IOverridePolicy)
class BaseOverridePolicy:
- implements(IOverridePolicy)
-
def __init__(self, archive, distroseries, pocket,
phased_update_percentage=None):
super(BaseOverridePolicy, self).__init__()
=== modified file 'lib/lp/soyuz/browser/archive.py'
--- lib/lp/soyuz/browser/archive.py 2015-06-18 13:46:38 +0000
+++ lib/lp/soyuz/browser/archive.py 2015-07-08 16:13:45 +0000
@@ -43,7 +43,7 @@
from zope.formlib import form
from zope.formlib.widgets import TextAreaWidget
from zope.interface import (
- implements,
+ implementer,
Interface,
)
from zope.schema import (
@@ -194,6 +194,7 @@
return None
+@implementer(ICanonicalUrlData)
class DistributionArchiveURL:
"""Dynamic URL declaration for `IDistributionArchive`.
@@ -201,7 +202,6 @@
IDistribution as /<distro>/+archive/<name>, for example:
/ubuntu/+archive/partner
"""
- implements(ICanonicalUrlData)
rootsite = None
def __init__(self, context):
@@ -216,9 +216,9 @@
return u"+archive/%s" % self.context.name
+@implementer(ICanonicalUrlData)
class PPAURL:
"""Dynamic URL declaration for named PPAs."""
- implements(ICanonicalUrlData)
rootsite = None
def __init__(self, context):
@@ -734,11 +734,10 @@
return "This %s has been disabled." % self.archive_label
+@implementer(IContextSourceBinder)
class ArchiveSeriesVocabularyFactory:
"""A factory for generating vocabularies of an archive's series."""
- implements(IContextSourceBinder)
-
def __call__(self, context):
"""Return a vocabulary created dynamically from the context archive.
@@ -891,14 +890,13 @@
return not self.filtered_sources.is_empty()
+@implementer(IArchiveIndexActionsMenu)
class ArchiveView(ArchiveSourcePackageListViewBase):
"""Default Archive view class.
Implements useful actions and collects useful sets for the page template.
"""
- implements(IArchiveIndexActionsMenu)
-
def initialize(self):
"""Redirect if our context is a main archive."""
if self.context.is_main:
@@ -1020,9 +1018,9 @@
}
+@implementer(IArchivePackagesActionMenu)
class ArchivePackagesView(ArchiveSourcePackageListViewBase):
"""Detailed packages view for an archive."""
- implements(IArchivePackagesActionMenu)
@property
def page_title(self):
=== modified file 'lib/lp/soyuz/browser/archivepermission.py'
--- lib/lp/soyuz/browser/archivepermission.py 2012-08-01 04:18:50 +0000
+++ lib/lp/soyuz/browser/archivepermission.py 2015-07-08 16:13:45 +0000
@@ -9,15 +9,15 @@
'ArchivePermissionURL',
]
-from zope.interface import implements
+from zope.interface import implementer
from lp.services.webapp.interfaces import ICanonicalUrlData
from lp.soyuz.enums import ArchivePermissionType
+@implementer(ICanonicalUrlData)
class ArchivePermissionURL:
"""Dynamic URL declaration for `IArchivePermission`."""
- implements(ICanonicalUrlData)
rootsite = None
def __init__(self, context):
=== modified file 'lib/lp/soyuz/browser/archivesubscription.py'
--- lib/lp/soyuz/browser/archivesubscription.py 2013-04-10 08:35:47 +0000
+++ lib/lp/soyuz/browser/archivesubscription.py 2015-07-08 16:13:45 +0000
@@ -25,7 +25,7 @@
from zope.formlib.widget import CustomWidgetFactory
from zope.formlib.widgets import TextWidget
from zope.interface import (
- implements,
+ implementer,
Interface,
)
from zope.schema import (
@@ -76,11 +76,10 @@
return archive_subscription
+@implementer(IPersonalArchiveSubscription)
class PersonalArchiveSubscription:
"""See `IPersonalArchiveSubscription`."""
- implements(IPersonalArchiveSubscription)
-
def __init__(self, subscriber, archive):
self.subscriber = subscriber
self.archive = archive
=== modified file 'lib/lp/soyuz/browser/build.py'
--- lib/lp/soyuz/browser/build.py 2015-03-02 01:49:40 +0000
+++ lib/lp/soyuz/browser/build.py 2015-07-08 16:13:45 +0000
@@ -26,7 +26,7 @@
from lazr.restful.utils import safe_hasattr
from zope.component import getUtility
from zope.interface import (
- implements,
+ implementer,
Interface,
)
from zope.security.interfaces import Unauthorized
@@ -98,6 +98,7 @@
return None
+@implementer(ICanonicalUrlData)
class BuildUrl:
"""Dynamic URL declaration for IBinaryPackageBuild.
@@ -113,7 +114,6 @@
Copy archives will be presented under the archives page:
/ubuntu/+archive/my-special-archive/+build/1234
"""
- implements(ICanonicalUrlData)
rootsite = None
def __init__(self, context):
=== modified file 'lib/lp/soyuz/browser/distroarchseries.py'
--- lib/lp/soyuz/browser/distroarchseries.py 2015-05-13 09:37:29 +0000
+++ lib/lp/soyuz/browser/distroarchseries.py 2015-07-08 16:13:45 +0000
@@ -16,7 +16,7 @@
from lazr.restful.interface import copy_field
from lazr.restful.utils import smartquote
from zope.interface import (
- implements,
+ implementer,
Interface,
)
@@ -82,9 +82,9 @@
return self.context.searchBinaryPackages(self.text)
+@implementer(IDistroArchSeriesActionMenu)
class DistroArchSeriesView(DistroArchSeriesPackageSearchView):
"""Default DistroArchSeries view class."""
- implements(IDistroArchSeriesActionMenu)
@property
def page_title(self):
=== modified file 'lib/lp/soyuz/browser/packagerelationship.py'
--- lib/lp/soyuz/browser/packagerelationship.py 2012-01-03 05:05:39 +0000
+++ lib/lp/soyuz/browser/packagerelationship.py 2015-07-08 16:13:45 +0000
@@ -12,7 +12,7 @@
import operator as std_operator
-from zope.interface import implements
+from zope.interface import implementer
from lp.services.webapp import canonical_url
from lp.soyuz.interfaces.packagerelationship import (
@@ -53,11 +53,10 @@
return relationship_set
+@implementer(IPackageRelationship)
class PackageRelationship:
"""See IPackageRelationship."""
- implements(IPackageRelationship)
-
def __init__(self, name, operator, version, url=None):
self.name = name
self.version = version
@@ -69,9 +68,9 @@
self.operator = operator
+@implementer(IPackageRelationshipSet)
class PackageRelationshipSet:
"""See IPackageRelationshipSet."""
- implements(IPackageRelationshipSet)
def __init__(self):
self.contents = []
=== modified file 'lib/lp/soyuz/browser/publishing.py'
--- lib/lp/soyuz/browser/publishing.py 2013-01-21 16:29:24 +0000
+++ lib/lp/soyuz/browser/publishing.py 2015-07-08 16:13:45 +0000
@@ -15,7 +15,7 @@
from operator import attrgetter
from lazr.delegates import delegates
-from zope.interface import implements
+from zope.interface import implementer
from lp.services.librarian.browser import (
FileNavigationMixin,
@@ -39,9 +39,9 @@
)
+@implementer(ICanonicalUrlData)
class PublicationURLBase:
"""Dynamic URL declaration for `I*PackagePublishingHistory`"""
- implements(ICanonicalUrlData)
rootsite = None
def __init__(self, context):
=== modified file 'lib/lp/soyuz/model/archive.py'
--- lib/lp/soyuz/model/archive.py 2015-05-19 02:45:25 +0000
+++ lib/lp/soyuz/model/archive.py 2015-07-08 16:13:45 +0000
@@ -46,7 +46,7 @@
from zope.event import notify
from zope.interface import (
alsoProvides,
- implements,
+ implementer,
)
from zope.security.proxy import removeSecurityProxy
@@ -226,8 +226,8 @@
return value
+@implementer(IArchive, IHasOwner, IHasBuildRecords)
class Archive(SQLBase):
- implements(IArchive, IHasOwner, IHasBuildRecords)
_table = 'Archive'
_defaultOrder = 'id'
@@ -2241,8 +2241,8 @@
return text
+@implementer(IArchiveSet)
class ArchiveSet:
- implements(IArchiveSet)
title = "Archives registered in Launchpad"
def get(self, archive_id):
=== modified file 'lib/lp/soyuz/model/archiveauthtoken.py'
--- lib/lp/soyuz/model/archiveauthtoken.py 2013-06-20 05:50:00 +0000
+++ lib/lp/soyuz/model/archiveauthtoken.py 2015-07-08 16:13:45 +0000
@@ -19,7 +19,7 @@
Unicode,
)
from storm.store import Store
-from zope.interface import implements
+from zope.interface import implementer
from lp.services.database.constants import UTC_NOW
from lp.services.database.interfaces import IStore
@@ -29,9 +29,9 @@
)
+@implementer(IArchiveAuthToken)
class ArchiveAuthToken(Storm):
"""See `IArchiveAuthToken`."""
- implements(IArchiveAuthToken)
__storm_table__ = 'ArchiveAuthToken'
id = Int(primary=True)
@@ -63,9 +63,9 @@
return str(auth_url)
+@implementer(IArchiveAuthTokenSet)
class ArchiveAuthTokenSet:
"""See `IArchiveAuthTokenSet`."""
- implements(IArchiveAuthTokenSet)
title = "Archive Tokens in Launchpad"
def get(self, token_id):
=== modified file 'lib/lp/soyuz/model/archivedependency.py'
--- lib/lp/soyuz/model/archivedependency.py 2012-11-26 01:02:38 +0000
+++ lib/lp/soyuz/model/archivedependency.py 2015-07-08 16:13:45 +0000
@@ -9,7 +9,7 @@
from sqlobject import ForeignKey
-from zope.interface import implements
+from zope.interface import implementer
from lp.registry.interfaces.pocket import PackagePublishingPocket
from lp.services.database.constants import UTC_NOW
@@ -20,11 +20,10 @@
from lp.soyuz.interfaces.archivedependency import IArchiveDependency
+@implementer(IArchiveDependency)
class ArchiveDependency(SQLBase):
"""See `IArchiveDependency`."""
- implements(IArchiveDependency)
-
_table = 'ArchiveDependency'
_defaultOrder = 'id'
=== modified file 'lib/lp/soyuz/model/archivepermission.py'
--- lib/lp/soyuz/model/archivepermission.py 2014-07-04 09:47:34 +0000
+++ lib/lp/soyuz/model/archivepermission.py 2015-07-08 16:13:45 +0000
@@ -26,7 +26,7 @@
from zope.component import getUtility
from zope.interface import (
alsoProvides,
- implements,
+ implementer,
)
from zope.security.proxy import isinstance as zope_isinstance
@@ -66,9 +66,9 @@
from lp.soyuz.interfaces.packageset import IPackageset
+@implementer(IArchivePermission)
class ArchivePermission(SQLBase):
"""See `IArchivePermission`."""
- implements(IArchivePermission)
_table = 'ArchivePermission'
_defaultOrder = 'id'
@@ -150,9 +150,9 @@
return None
+@implementer(IArchivePermissionSet)
class ArchivePermissionSet:
"""See `IArchivePermissionSet`."""
- implements(IArchivePermissionSet)
def checkAuthenticated(self, person, archive, permission, item,
distroseries=None):
=== modified file 'lib/lp/soyuz/model/archivesubscriber.py'
--- lib/lp/soyuz/model/archivesubscriber.py 2015-03-06 10:22:08 +0000
+++ lib/lp/soyuz/model/archivesubscriber.py 2015-07-08 16:13:45 +0000
@@ -28,7 +28,7 @@
)
from storm.store import EmptyResultSet
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from lp.registry.interfaces.person import validate_person
from lp.registry.model.person import Person
@@ -44,9 +44,9 @@
from lp.soyuz.model.archiveauthtoken import ArchiveAuthToken
+@implementer(IArchiveSubscriber)
class ArchiveSubscriber(Storm):
"""See `IArchiveSubscriber`."""
- implements(IArchiveSubscriber)
__storm_table__ = 'ArchiveSubscriber'
id = Int(primary=True)
=== modified file 'lib/lp/soyuz/model/binaryandsourcepackagename.py'
--- lib/lp/soyuz/model/binaryandsourcepackagename.py 2013-01-07 02:40:55 +0000
+++ lib/lp/soyuz/model/binaryandsourcepackagename.py 2015-07-08 16:13:45 +0000
@@ -8,7 +8,7 @@
]
from sqlobject import StringCol
-from zope.interface import implements
+from zope.interface import implementer
from zope.schema.vocabulary import SimpleTerm
from lp.services.database.sqlbase import SQLBase
@@ -19,11 +19,10 @@
from lp.soyuz.interfaces.binarypackagename import IBinaryAndSourcePackageName
+@implementer(IBinaryAndSourcePackageName)
class BinaryAndSourcePackageName(SQLBase):
"""See IBinaryAndSourcePackageName"""
- implements(IBinaryAndSourcePackageName)
-
_table = 'BinaryAndSourcePackageNameView'
_idName = 'name'
_idType = unicode
=== modified file 'lib/lp/soyuz/model/binarypackagebuild.py'
--- lib/lp/soyuz/model/binarypackagebuild.py 2015-07-03 14:30:48 +0000
+++ lib/lp/soyuz/model/binarypackagebuild.py 2015-07-08 16:13:45 +0000
@@ -43,7 +43,7 @@
)
from storm.zope import IResultSet
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from zope.security.proxy import removeSecurityProxy
from lp.app.browser.tales import DurationFormatterAPI
@@ -151,8 +151,8 @@
COPY_ARCHIVE_SCORE_PENALTY = 2600
+@implementer(IBinaryPackageBuild)
class BinaryPackageBuild(PackageBuildMixin, SQLBase):
- implements(IBinaryPackageBuild)
_table = 'BinaryPackageBuild'
_defaultOrder = 'id'
@@ -899,8 +899,8 @@
return changes.signer
+@implementer(IBinaryPackageBuildSet)
class BinaryPackageBuildSet(SpecificBuildFarmJobSourceMixin):
- implements(IBinaryPackageBuildSet)
def new(self, source_package_release, archive, distro_arch_series, pocket,
arch_indep=None, status=BuildStatus.NEEDSBUILD, builder=None):
=== modified file 'lib/lp/soyuz/model/binarypackagebuildbehaviour.py'
--- lib/lp/soyuz/model/binarypackagebuildbehaviour.py 2015-05-14 08:50:41 +0000
+++ lib/lp/soyuz/model/binarypackagebuildbehaviour.py 2015-07-08 16:13:45 +0000
@@ -9,7 +9,7 @@
'BinaryPackageBuildBehaviour',
]
-from zope.interface import implements
+from zope.interface import implementer
from lp.buildmaster.interfaces.builder import CannotBuild
from lp.buildmaster.interfaces.buildfarmjobbehaviour import (
@@ -28,11 +28,10 @@
from lp.soyuz.model.publishing import makePoolPath
+@implementer(IBuildFarmJobBehaviour)
class BinaryPackageBuildBehaviour(BuildFarmJobBehaviourBase):
"""Define the behaviour of binary package builds."""
- implements(IBuildFarmJobBehaviour)
-
def getLogFileName(self):
"""See `IBuildPackageJob`."""
sourcename = self.build.source_package_release.name
=== modified file 'lib/lp/soyuz/model/binarypackagename.py'
--- lib/lp/soyuz/model/binarypackagename.py 2013-06-20 05:50:00 +0000
+++ lib/lp/soyuz/model/binarypackagename.py 2015-07-08 16:13:45 +0000
@@ -15,7 +15,7 @@
)
from storm.expr import Join
from storm.store import EmptyResultSet
-from zope.interface import implements
+from zope.interface import implementer
from zope.schema.vocabulary import SimpleTerm
from lp.app.errors import NotFoundError
@@ -37,9 +37,8 @@
from lp.soyuz.model.binarypackagerelease import BinaryPackageRelease
+@implementer(IBinaryPackageName)
class BinaryPackageName(SQLBase):
-
- implements(IBinaryPackageName)
_table = 'BinaryPackageName'
name = StringCol(dbName='name', notNull=True, unique=True,
alternateID=True)
@@ -51,8 +50,8 @@
return "<BinaryPackageName at %X name=%r>" % (id(self), self.name)
+@implementer(IBinaryPackageNameSet)
class BinaryPackageNameSet:
- implements(IBinaryPackageNameSet)
def __getitem__(self, name):
"""See `IBinaryPackageNameSet`."""
=== modified file 'lib/lp/soyuz/model/binarypackagerelease.py'
--- lib/lp/soyuz/model/binarypackagerelease.py 2015-01-20 15:14:15 +0000
+++ lib/lp/soyuz/model/binarypackagerelease.py 2015-07-08 16:13:45 +0000
@@ -22,7 +22,7 @@
Store,
Storm,
)
-from zope.interface import implements
+from zope.interface import implementer
from lp.services.database.constants import UTC_NOW
from lp.services.database.datetimecol import UtcDateTimeCol
@@ -44,8 +44,8 @@
from lp.soyuz.model.files import BinaryPackageFile
+@implementer(IBinaryPackageRelease)
class BinaryPackageRelease(SQLBase):
- implements(IBinaryPackageRelease)
_table = 'BinaryPackageRelease'
binarypackagename = ForeignKey(dbName='binarypackagename', notNull=True,
foreignKey='BinaryPackageName')
@@ -146,10 +146,10 @@
self.priority = priority
+@implementer(IBinaryPackageReleaseDownloadCount)
class BinaryPackageReleaseDownloadCount(Storm):
"""See `IBinaryPackageReleaseDownloadCount`."""
- implements(IBinaryPackageReleaseDownloadCount)
__storm_table__ = 'BinaryPackageReleaseDownloadCount'
id = Int(primary=True)
=== modified file 'lib/lp/soyuz/model/component.py'
--- lib/lp/soyuz/model/component.py 2013-01-07 02:40:55 +0000
+++ lib/lp/soyuz/model/component.py 2015-07-08 16:13:45 +0000
@@ -12,7 +12,7 @@
ForeignKey,
StringCol,
)
-from zope.interface import implements
+from zope.interface import implementer
from lp.app.errors import NotFoundError
from lp.services.database.sqlbase import SQLBase
@@ -23,11 +23,10 @@
)
+@implementer(IComponent)
class Component(SQLBase):
"""See IComponent."""
- implements(IComponent)
-
_defaultOrder = ['id']
name = StringCol(notNull=True, alternateID=True)
@@ -36,11 +35,10 @@
return "<%s '%s'>" % (self.__class__.__name__, self.name)
+@implementer(IComponentSelection)
class ComponentSelection(SQLBase):
"""See IComponentSelection."""
- implements(IComponentSelection)
-
_defaultOrder = ['id']
distroseries = ForeignKey(dbName='distroseries',
@@ -49,11 +47,10 @@
foreignKey='Component', notNull=True)
+@implementer(IComponentSet)
class ComponentSet:
"""See IComponentSet."""
- implements(IComponentSet)
-
def __iter__(self):
"""See IComponentSet."""
return iter(Component.select())
=== modified file 'lib/lp/soyuz/model/distributionjob.py'
--- lib/lp/soyuz/model/distributionjob.py 2013-06-20 05:50:00 +0000
+++ lib/lp/soyuz/model/distributionjob.py 2015-07-08 16:13:45 +0000
@@ -15,7 +15,7 @@
JSON,
Reference,
)
-from zope.interface import implements
+from zope.interface import implementer
from lp.app.errors import NotFoundError
from lp.registry.model.distribution import Distribution
@@ -34,11 +34,10 @@
)
+@implementer(IDistributionJob)
class DistributionJob(StormBase):
"""Base class for jobs related to Distributions."""
- implements(IDistributionJob)
-
__storm_table__ = 'DistributionJob'
id = Int(primary=True)
=== modified file 'lib/lp/soyuz/model/distributionsourcepackagecache.py'
--- lib/lp/soyuz/model/distributionsourcepackagecache.py 2014-07-09 15:11:03 +0000
+++ lib/lp/soyuz/model/distributionsourcepackagecache.py 2015-07-08 16:13:45 +0000
@@ -10,7 +10,7 @@
ForeignKey,
StringCol,
)
-from zope.interface import implements
+from zope.interface import implementer
from lp.registry.model.sourcepackagename import SourcePackageName
from lp.services.database.decoratedresultset import DecoratedResultSet
@@ -28,8 +28,8 @@
from lp.soyuz.model.sourcepackagerelease import SourcePackageRelease
+@implementer(IDistributionSourcePackageCache)
class DistributionSourcePackageCache(SQLBase):
- implements(IDistributionSourcePackageCache)
_table = 'DistributionSourcePackageCache'
archive = ForeignKey(dbName='archive',
=== modified file 'lib/lp/soyuz/model/distributionsourcepackagerelease.py'
--- lib/lp/soyuz/model/distributionsourcepackagerelease.py 2014-12-18 11:44:19 +0000
+++ lib/lp/soyuz/model/distributionsourcepackagerelease.py 2015-07-08 16:13:45 +0000
@@ -20,7 +20,7 @@
SQL,
)
from storm.store import Store
-from zope.interface import implements
+from zope.interface import implementer
from lp.services.database.decoratedresultset import DecoratedResultSet
from lp.soyuz.interfaces.distributionsourcepackagerelease import (
@@ -38,6 +38,7 @@
)
+@implementer(IDistributionSourcePackageRelease)
class DistributionSourcePackageRelease:
"""This is a "Magic Distribution Source Package Release". It is not an
SQLObject, but it represents the concept of a specific source package
@@ -45,7 +46,6 @@
information.
"""
- implements(IDistributionSourcePackageRelease)
delegates(ISourcePackageRelease, context='sourcepackagerelease')
def __init__(self, distribution, sourcepackagerelease):
=== modified file 'lib/lp/soyuz/model/distroarchseries.py'
--- lib/lp/soyuz/model/distroarchseries.py 2015-04-20 15:59:27 +0000
+++ lib/lp/soyuz/model/distroarchseries.py 2015-07-08 16:13:45 +0000
@@ -26,7 +26,7 @@
)
from storm.store import EmptyResultSet
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from lp.buildmaster.model.processor import Processor
from lp.registry.interfaces.person import validate_public_person
@@ -61,8 +61,8 @@
from lp.soyuz.model.binarypackagerelease import BinaryPackageRelease
+@implementer(IDistroArchSeries, IHasBuildRecords)
class DistroArchSeries(SQLBase):
- implements(IDistroArchSeries, IHasBuildRecords)
_table = 'DistroArchSeries'
_defaultOrder = 'id'
@@ -285,8 +285,8 @@
return self.distroseries.distribution.main_archive
+@implementer(IPocketChroot)
class PocketChroot(SQLBase):
- implements(IPocketChroot)
_table = "PocketChroot"
distroarchseries = ForeignKey(
=== modified file 'lib/lp/soyuz/model/distroarchseriesbinarypackage.py'
--- lib/lp/soyuz/model/distroarchseriesbinarypackage.py 2014-11-27 20:52:37 +0000
+++ lib/lp/soyuz/model/distroarchseriesbinarypackage.py 2015-07-08 16:13:45 +0000
@@ -10,7 +10,7 @@
]
from storm.locals import Desc
-from zope.interface import implements
+from zope.interface import implementer
from lp.app.errors import NotFoundError
from lp.services.database.interfaces import IStore
@@ -27,6 +27,7 @@
from lp.soyuz.model.publishing import BinaryPackagePublishingHistory
+@implementer(IDistroArchSeriesBinaryPackage)
class DistroArchSeriesBinaryPackage:
"""A Binary Package in the context of a Distro Arch Series.
@@ -35,8 +36,6 @@
the publishing and binarypackagerelease tables.
"""
- implements(IDistroArchSeriesBinaryPackage)
-
def __init__(self, distroarchseries, binarypackagename):
self.distroarchseries = distroarchseries
self.binarypackagename = binarypackagename
=== modified file 'lib/lp/soyuz/model/distroarchseriesbinarypackagerelease.py'
--- lib/lp/soyuz/model/distroarchseriesbinarypackagerelease.py 2013-01-21 16:27:29 +0000
+++ lib/lp/soyuz/model/distroarchseriesbinarypackagerelease.py 2015-07-08 16:13:45 +0000
@@ -10,7 +10,7 @@
'DistroArchSeriesBinaryPackageRelease',
]
-from zope.interface import implements
+from zope.interface import implementer
from lp.services.database.sqlbase import sqlvalues
from lp.soyuz.interfaces.distroarchseriesbinarypackagerelease import (
@@ -23,10 +23,9 @@
from lp.soyuz.model.publishing import BinaryPackagePublishingHistory
+@implementer(IDistroArchSeriesBinaryPackageRelease)
class DistroArchSeriesBinaryPackageRelease:
- implements(IDistroArchSeriesBinaryPackageRelease)
-
def __init__(self, distroarchseries, binarypackagerelease):
self.distroarchseries = distroarchseries
self.binarypackagerelease = binarypackagerelease
=== modified file 'lib/lp/soyuz/model/distroseriesbinarypackage.py'
--- lib/lp/soyuz/model/distroseriesbinarypackage.py 2014-11-09 08:56:32 +0000
+++ lib/lp/soyuz/model/distroseriesbinarypackage.py 2015-07-08 16:13:45 +0000
@@ -10,7 +10,7 @@
from storm.expr import Desc
from storm.store import Store
-from zope.interface import implements
+from zope.interface import implementer
from lp.services.propertycache import (
cachedproperty,
@@ -23,6 +23,7 @@
from lp.soyuz.model.publishing import BinaryPackagePublishingHistory
+@implementer(IDistroSeriesBinaryPackage)
class DistroSeriesBinaryPackage:
"""A binary package, like "apache2.1", in a distro series like "hoary".
@@ -32,8 +33,6 @@
in specific DistroArchSeriess.
"""
- implements(IDistroSeriesBinaryPackage)
-
default = object()
def __init__(self, distroseries, binarypackagename, cache=default):
=== modified file 'lib/lp/soyuz/model/distroseriesdifferencejob.py'
--- lib/lp/soyuz/model/distroseriesdifferencejob.py 2013-07-04 05:38:43 +0000
+++ lib/lp/soyuz/model/distroseriesdifferencejob.py 2015-07-08 16:13:45 +0000
@@ -10,8 +10,8 @@
from zope.component import getUtility
from zope.interface import (
- classProvides,
- implements,
+ implementer,
+ provider,
)
from lp.registry.interfaces.distroseriesdifference import (
@@ -151,12 +151,11 @@
sourcepackagename, include_pending=True).is_empty()
+@implementer(IDistroSeriesDifferenceJob)
+@provider(IDistroSeriesDifferenceJobSource)
class DistroSeriesDifferenceJob(DistributionJobDerived):
"""A `Job` type for creating/updating `DistroSeriesDifference`s."""
- implements(IDistroSeriesDifferenceJob)
- classProvides(IDistroSeriesDifferenceJobSource)
-
class_job_type = DistributionJobType.DISTROSERIESDIFFERENCE
config = config.IDistroSeriesDifferenceJobSource
=== modified file 'lib/lp/soyuz/model/distroseriespackagecache.py'
--- lib/lp/soyuz/model/distroseriespackagecache.py 2014-07-09 15:11:03 +0000
+++ lib/lp/soyuz/model/distroseriespackagecache.py 2015-07-08 16:13:45 +0000
@@ -15,7 +15,7 @@
Max,
RawStr,
)
-from zope.interface import implements
+from zope.interface import implementer
from lp.services.database.interfaces import IStore
from lp.services.database.sqlbase import (
@@ -31,8 +31,8 @@
from lp.soyuz.model.publishing import BinaryPackagePublishingHistory
+@implementer(IDistroSeriesPackageCache)
class DistroSeriesPackageCache(SQLBase):
- implements(IDistroSeriesPackageCache)
_table = 'DistroSeriesPackageCache'
archive = ForeignKey(dbName='archive',
=== modified file 'lib/lp/soyuz/model/files.py'
--- lib/lp/soyuz/model/files.py 2013-01-08 06:42:18 +0000
+++ lib/lp/soyuz/model/files.py 2015-07-08 16:13:45 +0000
@@ -9,7 +9,7 @@
]
from sqlobject import ForeignKey
-from zope.interface import implements
+from zope.interface import implementer
from lp.registry.interfaces.sourcepackage import SourcePackageFileType
from lp.services.database.enumcol import EnumCol
@@ -21,9 +21,9 @@
)
+@implementer(IBinaryPackageFile)
class BinaryPackageFile(SQLBase):
"""See IBinaryPackageFile """
- implements(IBinaryPackageFile)
_table = 'BinaryPackageFile'
binarypackagerelease = ForeignKey(dbName='binarypackagerelease',
@@ -46,11 +46,10 @@
)
+@implementer(ISourcePackageReleaseFile)
class SourcePackageReleaseFile(SourceFileMixin, SQLBase):
"""See ISourcePackageFile"""
- implements(ISourcePackageReleaseFile)
-
sourcepackagerelease = ForeignKey(foreignKey='SourcePackageRelease',
dbName='sourcepackagerelease')
libraryfile = ForeignKey(foreignKey='LibraryFileAlias',
=== modified file 'lib/lp/soyuz/model/initializedistroseriesjob.py'
--- lib/lp/soyuz/model/initializedistroseriesjob.py 2014-07-22 20:29:57 +0000
+++ lib/lp/soyuz/model/initializedistroseriesjob.py 2015-07-08 16:13:45 +0000
@@ -8,8 +8,8 @@
]
from zope.interface import (
- classProvides,
- implements,
+ implementer,
+ provider,
)
from lp.registry.model.distroseries import DistroSeries
@@ -38,12 +38,11 @@
)
+@implementer(IInitializeDistroSeriesJob)
+@provider(IInitializeDistroSeriesJobSource)
class InitializeDistroSeriesJob(DistributionJobDerived):
- implements(IInitializeDistroSeriesJob)
-
class_job_type = DistributionJobType.INITIALIZE_SERIES
- classProvides(IInitializeDistroSeriesJobSource)
user_error_types = (InitializationError,)
=== modified file 'lib/lp/soyuz/model/livefs.py'
--- lib/lp/soyuz/model/livefs.py 2015-05-07 10:52:10 +0000
+++ lib/lp/soyuz/model/livefs.py 2015-07-08 16:13:45 +0000
@@ -21,7 +21,7 @@
Unicode,
)
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from lp.buildmaster.enums import BuildStatus
from lp.registry.errors import NoSuchDistroSeries
@@ -80,13 +80,12 @@
livefs.date_last_modified = UTC_NOW
+@implementer(ILiveFS, IHasOwner)
class LiveFS(Storm):
"""See `ILiveFS`."""
__storm_table__ = 'LiveFS'
- implements(ILiveFS, IHasOwner)
-
id = Int(primary=True)
date_created = DateTime(
@@ -219,11 +218,10 @@
IStore(LiveFS).remove(self)
+@implementer(ILiveFSSet)
class LiveFSSet:
"""See `ILiveFSSet`."""
- implements(ILiveFSSet)
-
def new(self, registrant, owner, distro_series, name, metadata,
require_virtualized=True, date_created=DEFAULT):
"""See `ILiveFSSet`."""
=== modified file 'lib/lp/soyuz/model/livefsbuild.py'
--- lib/lp/soyuz/model/livefsbuild.py 2015-05-14 08:56:37 +0000
+++ lib/lp/soyuz/model/livefsbuild.py 2015-07-08 16:13:45 +0000
@@ -23,7 +23,7 @@
)
from storm.store import EmptyResultSet
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from lp.app.errors import NotFoundError
from lp.buildmaster.enums import (
@@ -64,11 +64,10 @@
from lp.soyuz.model.archive import Archive
+@implementer(ILiveFSFile)
class LiveFSFile(Storm):
"""See `ILiveFS`."""
- implements(ILiveFSFile)
-
__storm_table__ = 'LiveFSFile'
id = Int(name='id', primary=True)
@@ -86,11 +85,10 @@
self.libraryfile = libraryfile
+@implementer(ILiveFSBuild)
class LiveFSBuild(PackageBuildMixin, Storm):
"""See `ILiveFSBuild`."""
- implements(ILiveFSBuild)
-
__storm_table__ = 'LiveFSBuild'
job_type = BuildFarmJobType.LIVEFSBUILD
@@ -336,8 +334,8 @@
return [self.lfaUrl(lfa) for _, lfa, _ in self.getFiles()]
+@implementer(ILiveFSBuildSet)
class LiveFSBuildSet(SpecificBuildFarmJobSourceMixin):
- implements(ILiveFSBuildSet)
def new(self, requester, livefs, archive, distro_arch_series, pocket,
unique_key=None, metadata_override=None, date_created=DEFAULT):
=== modified file 'lib/lp/soyuz/model/livefsbuildbehaviour.py'
--- lib/lp/soyuz/model/livefsbuildbehaviour.py 2014-06-25 11:37:48 +0000
+++ lib/lp/soyuz/model/livefsbuildbehaviour.py 2015-07-08 16:13:45 +0000
@@ -12,7 +12,7 @@
]
from zope.component import adapts
-from zope.interface import implements
+from zope.interface import implementer
from zope.security.proxy import removeSecurityProxy
from lp.buildmaster.interfaces.builder import CannotBuild
@@ -31,11 +31,11 @@
from lp.soyuz.interfaces.livefsbuild import ILiveFSBuild
+@implementer(IBuildFarmJobBehaviour)
class LiveFSBuildBehaviour(BuildFarmJobBehaviourBase):
"""Dispatches `LiveFSBuild` jobs to slaves."""
adapts(ILiveFSBuild)
- implements(IBuildFarmJobBehaviour)
def getLogFileName(self):
das = self.build.distro_arch_series
=== modified file 'lib/lp/soyuz/model/packagecloner.py'
--- lib/lp/soyuz/model/packagecloner.py 2015-05-19 02:24:41 +0000
+++ lib/lp/soyuz/model/packagecloner.py 2015-07-08 16:13:45 +0000
@@ -13,7 +13,7 @@
import transaction
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from lp.services.database.constants import UTC_NOW
from lp.services.database.interfaces import IStore
@@ -48,12 +48,11 @@
pkg_cloner.clonePackages(origin, destination, distroarchseries_list)
+@implementer(IPackageCloner)
class PackageCloner:
"""Used for copying of various publishing history data across archives.
"""
- implements(IPackageCloner)
-
def clonePackages(self, origin, destination, distroarchseries_list=None,
processors=None, sourcepackagenames=None):
"""Copies packages from origin to destination package location.
=== modified file 'lib/lp/soyuz/model/packagecopyjob.py'
--- lib/lp/soyuz/model/packagecopyjob.py 2015-05-19 10:30:32 +0000
+++ lib/lp/soyuz/model/packagecopyjob.py 2015-07-08 16:13:45 +0000
@@ -23,8 +23,8 @@
import transaction
from zope.component import getUtility
from zope.interface import (
- classProvides,
- implements,
+ implementer,
+ provider,
)
from zope.security.proxy import removeSecurityProxy
@@ -80,12 +80,11 @@
from lp.soyuz.scripts.packagecopier import do_copy
+@implementer(IPackageCopyJob)
+@provider(IPackageCopyJobSource)
class PackageCopyJob(StormBase):
"""Base class for package copying jobs."""
- implements(IPackageCopyJob)
- classProvides(IPackageCopyJobSource)
-
__storm_table__ = 'PackageCopyJob'
id = Int(primary=True)
@@ -253,6 +252,8 @@
return self.context.copy_policy
+@implementer(IPlainPackageCopyJob)
+@provider(IPlainPackageCopyJobSource)
class PlainPackageCopyJob(PackageCopyJobDerived):
"""Job that copies a package from one archive to another."""
# This job type serves in different places: it supports copying
@@ -261,10 +262,7 @@
# separate types at some point, but for now we (allenap, bigjools,
# jtv) chose to keep it as one.
- implements(IPlainPackageCopyJob)
-
class_job_type = PackageCopyJobType.PLAIN
- classProvides(IPlainPackageCopyJobSource)
config = config.IPlainPackageCopyJobSource
user_error_types = (CannotCopy,)
# Raised when closing bugs ends up hitting another process and
=== modified file 'lib/lp/soyuz/model/packagecopyrequest.py'
--- lib/lp/soyuz/model/packagecopyrequest.py 2013-06-20 05:50:00 +0000
+++ lib/lp/soyuz/model/packagecopyrequest.py 2015-07-08 16:13:45 +0000
@@ -15,7 +15,7 @@
Storm,
Unicode,
)
-from zope.interface import implements
+from zope.interface import implementer
from lp.registry.interfaces.person import validate_public_person
from lp.registry.interfaces.pocket import PackagePublishingPocket
@@ -33,9 +33,9 @@
return dict(zip(db_item_cls.items, itertools.count(1)))
+@implementer(IPackageCopyRequest)
class PackageCopyRequest(Storm):
"""See `IPackageCopyRequest`."""
- implements(IPackageCopyRequest)
__storm_table__ = 'PackageCopyRequest'
id = Int(primary=True)
@@ -157,9 +157,9 @@
setattr(pcr, '%s_%s' % (prefix, datum_name), value)
+@implementer(IPackageCopyRequestSet)
class PackageCopyRequestSet:
"""See `IPackageCopyRequestSet`."""
- implements(IPackageCopyRequestSet)
def new(self, source, target, requester, copy_binaries=False, reason=None):
"""See `IPackageCopyRequestSet`."""
=== modified file 'lib/lp/soyuz/model/packagediff.py'
--- lib/lp/soyuz/model/packagediff.py 2013-07-31 00:37:32 +0000
+++ lib/lp/soyuz/model/packagediff.py 2015-07-08 16:13:45 +0000
@@ -18,7 +18,7 @@
from storm.expr import Desc
from storm.store import EmptyResultSet
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from lp.services.database.bulk import load
from lp.services.database.constants import UTC_NOW
@@ -96,11 +96,10 @@
copy_and_close(libraryfile, destination_file)
+@implementer(IPackageDiff)
class PackageDiff(SQLBase):
"""A Package Diff request."""
- implements(IPackageDiff)
-
_defaultOrder = ['id']
date_requested = UtcDateTimeCol(notNull=False, default=UTC_NOW)
@@ -251,11 +250,10 @@
shutil.rmtree(tmp_dir)
+@implementer(IPackageDiffSet)
class PackageDiffSet:
"""This class is to deal with Distribution related stuff"""
- implements(IPackageDiffSet)
-
def __iter__(self):
"""See `IPackageDiffSet`."""
return iter(PackageDiff.select(orderBy=['-id']))
=== modified file 'lib/lp/soyuz/model/packagediffjob.py'
--- lib/lp/soyuz/model/packagediffjob.py 2015-06-05 21:24:50 +0000
+++ lib/lp/soyuz/model/packagediffjob.py 2015-07-08 16:13:45 +0000
@@ -11,8 +11,8 @@
import simplejson
from zope.component import getUtility
from zope.interface import (
- classProvides,
- implements,
+ implementer,
+ provider,
)
from lp.services.config import config
@@ -30,12 +30,12 @@
)
+@provider(IPackageDiffJobSource)
class PackageDiffJobDerived(BaseRunnableJob):
__metaclass__ = EnumeratedSubclass
delegates(IPackageDiffJob)
- classProvides(IPackageDiffJobSource)
config = config.IPackageDiffJobSource
def __init__(self, job):
@@ -61,11 +61,10 @@
return (cls(job) for job in jobs)
+@implementer(IPackageDiffJob)
+@provider(IPackageDiffJobSource)
class PackageDiffJob(PackageDiffJobDerived):
- implements(IPackageDiffJob)
- classProvides(IPackageDiffJobSource)
-
def __repr__(self):
"""Returns an informative representation of a PackageDiff job."""
diff = self.packagediff
=== modified file 'lib/lp/soyuz/model/packageset.py'
--- lib/lp/soyuz/model/packageset.py 2014-07-05 00:23:24 +0000
+++ lib/lp/soyuz/model/packageset.py 2015-07-08 16:13:45 +0000
@@ -15,7 +15,7 @@
Unicode,
)
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from lp.registry.interfaces.sourcepackagename import (
ISourcePackageName,
@@ -42,9 +42,9 @@
return result_set.order_by('name')
+@implementer(IPackageset)
class Packageset(Storm):
"""See `IPackageset`."""
- implements(IPackageset)
__storm_table__ = 'Packageset'
id = Int(primary=True)
@@ -333,9 +333,9 @@
store.remove(self.packagesetgroup)
+@implementer(IPackagesetSet)
class PackagesetSet:
"""See `IPackagesetSet`."""
- implements(IPackagesetSet)
def new(self, name, description, owner, distroseries, related_set=None):
"""See `IPackagesetSet`."""
=== modified file 'lib/lp/soyuz/model/packagesetgroup.py'
--- lib/lp/soyuz/model/packagesetgroup.py 2010-08-20 20:31:18 +0000
+++ lib/lp/soyuz/model/packagesetgroup.py 2015-07-08 16:13:45 +0000
@@ -14,14 +14,14 @@
Reference,
Storm,
)
-from zope.interface import implements
+from zope.interface import implementer
from lp.soyuz.interfaces.packagesetgroup import IPackagesetGroup
+@implementer(IPackagesetGroup)
class PackagesetGroup(Storm):
"""See `IPackageset`."""
- implements(IPackagesetGroup)
__storm_table__ = 'PackagesetGroup'
id = Int(primary=True)
=== modified file 'lib/lp/soyuz/model/packagetranslationsuploadjob.py'
--- lib/lp/soyuz/model/packagetranslationsuploadjob.py 2013-10-22 01:45:25 +0000
+++ lib/lp/soyuz/model/packagetranslationsuploadjob.py 2015-07-08 16:13:45 +0000
@@ -12,8 +12,8 @@
import simplejson
from zope.component import getUtility
from zope.interface import (
- classProvides,
- implements,
+ implementer,
+ provider,
)
from lp.registry.interfaces.sourcepackagename import ISourcePackageNameSet
@@ -69,12 +69,12 @@
return filename
+@provider(IPackageTranslationsUploadJobSource)
class PackageTranslationsUploadJobDerived(BaseRunnableJob):
__metaclass__ = EnumeratedSubclass
delegates(IPackageTranslationsUploadJob)
- classProvides(IPackageTranslationsUploadJobSource)
config = config.IPackageTranslationsUploadJobSource
def __init__(self, job):
@@ -110,11 +110,10 @@
return []
+@implementer(IPackageTranslationsUploadJob)
+@provider(IPackageTranslationsUploadJobSource)
class PackageTranslationsUploadJob(PackageTranslationsUploadJobDerived):
- implements(IPackageTranslationsUploadJob)
- classProvides(IPackageTranslationsUploadJobSource)
-
@property
def distroseries_id(self):
return simplejson.loads(self.base_json_data)['distroseries']
=== modified file 'lib/lp/soyuz/model/processacceptedbugsjob.py'
--- lib/lp/soyuz/model/processacceptedbugsjob.py 2014-08-09 09:21:13 +0000
+++ lib/lp/soyuz/model/processacceptedbugsjob.py 2015-07-08 16:13:45 +0000
@@ -20,8 +20,8 @@
)
from zope.component import getUtility
from zope.interface import (
- classProvides,
- implements,
+ implementer,
+ provider,
)
from zope.security.management import getSecurityPolicy
@@ -209,6 +209,12 @@
job_source.create(distroseries, source_release, bug_ids_to_close)
+@implementer(IProcessAcceptedBugsJob)
+# Oddly, BaseRunnableJob inherits from BaseRunnableJobSource so this class
+# is both the factory for jobs (the "implementer", above) and the source for
+# runnable jobs (not the constructor of the job source, the class provides
+# the IJobSource interface itself).
+@provider(IProcessAcceptedBugsJobSource)
class ProcessAcceptedBugsJob(StormBase, BaseRunnableJob):
"""Base class for jobs to close bugs for accepted package uploads."""
@@ -216,14 +222,6 @@
config = config.IProcessAcceptedBugsJobSource
- implements(IProcessAcceptedBugsJob)
-
- # Oddly, BaseRunnableJob inherits from BaseRunnableJobSource so this class
- # is both the factory for jobs (the "implements", above) and the source
- # for runnable jobs (not the constructor of the job source, the class
- # provides the IJobSource interface itself).
- classProvides(IProcessAcceptedBugsJobSource)
-
# The Job table contains core job details.
job_id = Int("job", primary=True)
job = Reference(job_id, Job.id)
=== modified file 'lib/lp/soyuz/model/publishing.py'
--- lib/lp/soyuz/model/publishing.py 2015-05-14 16:11:09 +0000
+++ lib/lp/soyuz/model/publishing.py 2015-07-08 16:13:45 +0000
@@ -40,7 +40,7 @@
from storm.zope import IResultSet
from storm.zope.interfaces import ISQLObjectResultSet
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from zope.security.proxy import (
isinstance as zope_isinstance,
removeSecurityProxy,
@@ -173,6 +173,7 @@
self.libraryfilealiasfilename)
+@implementer(ISourcePackageFilePublishing)
class SourcePackageFilePublishing(FilePublishingBase, SQLBase):
"""Source package release files and their publishing status.
@@ -182,8 +183,6 @@
_idType = unicode
_defaultOrder = "id"
- implements(ISourcePackageFilePublishing)
-
distribution = ForeignKey(dbName='distribution',
foreignKey="Distribution",
unique=False,
@@ -223,6 +222,7 @@
return self.sourcepackagepublishing
+@implementer(IBinaryPackageFilePublishing)
class BinaryPackageFilePublishing(FilePublishingBase, SQLBase):
"""A binary package file which is published.
@@ -232,8 +232,6 @@
_idType = unicode
_defaultOrder = "id"
- implements(IBinaryPackageFilePublishing)
-
binarypackagepublishing = ForeignKey(
dbName='binarypackagepublishing',
foreignKey='BinaryPackagePublishingHistory', immutable=True)
@@ -328,9 +326,9 @@
return self.section.name
+@implementer(ISourcePackagePublishingHistory)
class SourcePackagePublishingHistory(SQLBase, ArchivePublisherBase):
"""A source package release publishing record."""
- implements(ISourcePackagePublishingHistory)
sourcepackagename = ForeignKey(
foreignKey='SourcePackageName', dbName='sourcepackagename')
@@ -698,11 +696,10 @@
[self], removed_by, removal_comment)
+@implementer(IBinaryPackagePublishingHistory)
class BinaryPackagePublishingHistory(SQLBase, ArchivePublisherBase):
"""A binary package publishing record."""
- implements(IBinaryPackagePublishingHistory)
-
binarypackagename = ForeignKey(
foreignKey='BinaryPackageName', dbName='binarypackagename')
binarypackagerelease = ForeignKey(
@@ -1108,11 +1105,10 @@
return expanded
+@implementer(IPublishingSet)
class PublishingSet:
"""Utilities for manipulating publications in batches."""
- implements(IPublishingSet)
-
def publishBinaries(self, archive, distroseries, pocket, binaries):
"""See `IPublishingSet`."""
# Expand the dict of binaries into a list of tuples including the
=== modified file 'lib/lp/soyuz/model/queue.py'
--- lib/lp/soyuz/model/queue.py 2015-04-08 10:35:22 +0000
+++ lib/lp/soyuz/model/queue.py 2015-07-08 16:13:45 +0000
@@ -38,7 +38,7 @@
Store,
)
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from lp.app.errors import NotFoundError
# XXX 2009-05-10 julian
@@ -152,20 +152,18 @@
'provided methods to set it.')
+@implementer(IPackageUploadQueue)
class PackageUploadQueue:
- implements(IPackageUploadQueue)
-
def __init__(self, distroseries, status):
self.distroseries = distroseries
self.status = status
+@implementer(IPackageUpload)
class PackageUpload(SQLBase):
"""A Queue item for the archive uploader."""
- implements(IPackageUpload)
-
_defaultOrder = ['id']
status = EnumCol(
@@ -1156,9 +1154,9 @@
}
+@implementer(IPackageUploadBuild)
class PackageUploadBuild(SQLBase):
"""A Queue item's related builds."""
- implements(IPackageUploadBuild)
_defaultOrder = ['id']
@@ -1216,11 +1214,10 @@
self.packageupload.pocket, bins)
+@implementer(IPackageUploadSource)
class PackageUploadSource(SQLBase):
"""A Queue item's related sourcepackagereleases."""
- implements(IPackageUploadSource)
-
_defaultOrder = ['id']
packageupload = ForeignKey(
@@ -1342,9 +1339,9 @@
packageupload=self.packageupload)
+@implementer(IPackageUploadCustom)
class PackageUploadCustom(SQLBase):
"""A Queue item's related custom format uploads."""
- implements(IPackageUploadCustom)
_defaultOrder = ['id']
@@ -1491,9 +1488,9 @@
assert len(publisher_dispatch) == len(PackageUploadCustomFormat)
+@implementer(IPackageUploadSet)
class PackageUploadSet:
"""See `IPackageUploadSet`"""
- implements(IPackageUploadSet)
def __iter__(self):
"""See `IPackageUploadSet`."""
=== modified file 'lib/lp/soyuz/model/reporting.py'
--- lib/lp/soyuz/model/reporting.py 2012-11-13 13:07:59 +0000
+++ lib/lp/soyuz/model/reporting.py 2015-07-08 16:13:45 +0000
@@ -13,7 +13,7 @@
Reference,
)
from storm.properties import DateTime
-from zope.interface import implements
+from zope.interface import implementer
from lp.services.database.enumcol import EnumCol
from lp.soyuz.enums import ArchivePurpose
@@ -23,9 +23,9 @@
from lp.soyuz.interfaces.sourcepackagerelease import ISourcePackageRelease
+@implementer(ILatestPersonSourcePackageReleaseCache)
class LatestPersonSourcePackageReleaseCache(Storm):
"""See `LatestPersonSourcePackageReleaseCache`."""
- implements(ILatestPersonSourcePackageReleaseCache)
delegates(ISourcePackageRelease, context='sourcepackagerelease')
__storm_table__ = 'LatestPersonSourcePackageReleaseCache'
=== modified file 'lib/lp/soyuz/model/section.py'
--- lib/lp/soyuz/model/section.py 2013-01-07 02:40:55 +0000
+++ lib/lp/soyuz/model/section.py 2015-07-08 16:13:45 +0000
@@ -12,7 +12,7 @@
ForeignKey,
StringCol,
)
-from zope.interface import implements
+from zope.interface import implementer
from lp.app.errors import NotFoundError
from lp.services.database.sqlbase import SQLBase
@@ -23,20 +23,19 @@
)
+@implementer(ISection)
class Section(SQLBase):
"""See ISection"""
- implements(ISection)
_defaultOrder = ['id']
name = StringCol(notNull=True, alternateID=True)
+@implementer(ISectionSelection)
class SectionSelection(SQLBase):
"""See ISectionSelection."""
- implements(ISectionSelection)
-
_defaultOrder = ['id']
distroseries = ForeignKey(dbName='distroseries',
@@ -45,9 +44,9 @@
foreignKey='Section', notNull=True)
+@implementer(ISectionSet)
class SectionSet:
"""See ISectionSet."""
- implements(ISectionSet)
def __iter__(self):
"""See ISectionSet."""
=== modified file 'lib/lp/soyuz/model/sourcepackageformat.py'
--- lib/lp/soyuz/model/sourcepackageformat.py 2013-06-20 05:50:00 +0000
+++ lib/lp/soyuz/model/sourcepackageformat.py 2015-07-08 16:13:45 +0000
@@ -13,7 +13,7 @@
Reference,
Storm,
)
-from zope.interface import implements
+from zope.interface import implementer
from lp.services.database.enumcol import DBEnum
from lp.services.database.interfaces import (
@@ -27,11 +27,10 @@
)
+@implementer(ISourcePackageFormatSelection)
class SourcePackageFormatSelection(Storm):
"""See ISourcePackageFormatSelection."""
- implements(ISourcePackageFormatSelection)
-
__storm_table__ = 'sourcepackageformatselection'
id = Int(primary=True)
@@ -42,11 +41,10 @@
format = DBEnum(enum=SourcePackageFormat)
+@implementer(ISourcePackageFormatSelectionSet)
class SourcePackageFormatSelectionSet:
"""See ISourcePackageFormatSelectionSet."""
- implements(ISourcePackageFormatSelectionSet)
-
def getBySeriesAndFormat(self, distroseries, format):
"""See `ISourcePackageFormatSelection`."""
return IStore(SourcePackageFormatSelection).find(
=== modified file 'lib/lp/soyuz/model/sourcepackagerelease.py'
--- lib/lp/soyuz/model/sourcepackagerelease.py 2015-06-05 21:24:50 +0000
+++ lib/lp/soyuz/model/sourcepackagerelease.py 2015-07-08 16:13:45 +0000
@@ -33,7 +33,7 @@
)
from storm.store import Store
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from lp.app.errors import NotFoundError
from lp.archiveuploader.utils import determine_source_file_type
@@ -75,8 +75,8 @@
)
+@implementer(ISourcePackageRelease)
class SourcePackageRelease(SQLBase):
- implements(ISourcePackageRelease)
_table = 'SourcePackageRelease'
section = ForeignKey(foreignKey='Section', dbName='section')
=== modified file 'lib/lp/soyuz/vocabularies.py'
--- lib/lp/soyuz/vocabularies.py 2015-04-20 11:24:21 +0000
+++ lib/lp/soyuz/vocabularies.py 2015-07-08 16:13:45 +0000
@@ -17,7 +17,7 @@
Or,
)
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from zope.schema.vocabulary import SimpleTerm
from zope.security.interfaces import Unauthorized
@@ -82,10 +82,9 @@
obj, obj.id, obj.name + " " + obj.version)
+@implementer(IHugeVocabulary)
class PPAVocabulary(SQLObjectVocabularyBase):
- implements(IHugeVocabulary)
-
_table = Archive
_orderBy = ['Person.name, Archive.name']
_clauseTables = ['Person']
=== modified file 'lib/lp/systemhomes.py'
--- lib/lp/systemhomes.py 2015-03-03 01:48:18 +0000
+++ lib/lp/systemhomes.py 2015-07-08 16:13:45 +0000
@@ -23,7 +23,7 @@
from lazr.restful.interfaces import ITopLevelEntryLink
from storm.expr import Max
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from lp.app.enums import PRIVATE_INFORMATION_TYPES
from lp.bugs.adapters.bug import convert_to_information_type
@@ -79,43 +79,45 @@
)
+@implementer(ICodehostingApplication)
class CodehostingApplication:
"""Codehosting End-Point."""
- implements(ICodehostingApplication)
title = "Codehosting API"
+@implementer(ICodeImportSchedulerApplication)
class CodeImportSchedulerApplication:
"""CodeImportScheduler End-Point."""
- implements(ICodeImportSchedulerApplication)
title = "Code Import Scheduler"
+@implementer(IGitApplication)
class GitApplication:
- implements(IGitApplication)
title = "Git API"
+@implementer(IPrivateMaloneApplication)
class PrivateMaloneApplication:
"""ExternalBugTracker authentication token end-point."""
- implements(IPrivateMaloneApplication)
title = "Launchpad Bugs."
+@implementer(IMailingListApplication)
class MailingListApplication:
- implements(IMailingListApplication)
-
-
+ pass
+
+
+@implementer(IFeedsApplication)
class FeedsApplication:
- implements(IFeedsApplication)
-
-
+ pass
+
+
+@implementer(IMaloneApplication)
class MaloneApplication:
- implements(IMaloneApplication)
def __init__(self):
self.title = 'Malone: the Launchpad bug tracker'
@@ -201,15 +203,15 @@
return []
+@implementer(IBazaarApplication)
class BazaarApplication:
- implements(IBazaarApplication)
def __init__(self):
self.title = 'The Open Source Bazaar'
+@implementer(IRosettaApplication)
class RosettaApplication:
- implements(IRosettaApplication)
def __init__(self):
self.title = 'Rosetta: Translations in the Launchpad'
@@ -276,9 +278,9 @@
return stats.value('translator_count')
+@implementer(IHWDBApplication, ITopLevelEntryLink)
class HWDBApplication:
"""See `IHWDBApplication`."""
- implements(IHWDBApplication, ITopLevelEntryLink)
link_name = 'hwdb'
entry_type = IHWDBApplication
@@ -389,13 +391,13 @@
bug_ids, bug_tags, affected_by_bug, subscribed_to_bug, user)
+@implementer(IWebServiceApplication, ICanonicalUrlData)
class WebServiceApplication(ServiceRootResource):
"""See `IWebServiceApplication`.
This implementation adds a 'cached_wadl' attribute, which starts
out as an empty dict and is populated as needed.
"""
- implements(IWebServiceApplication, ICanonicalUrlData)
inside = None
path = ''
@@ -446,5 +448,6 @@
return self.__class__.cached_wadl[version]
+@implementer(ITestOpenIDApplication)
class TestOpenIDApplication:
- implements(ITestOpenIDApplication)
+ pass
=== modified file 'lib/lp/testing/tests/test_fixture.py'
--- lib/lp/testing/tests/test_fixture.py 2015-06-12 17:50:34 +0000
+++ lib/lp/testing/tests/test_fixture.py 2015-07-08 16:13:45 +0000
@@ -18,7 +18,7 @@
queryAdapter,
)
from zope.interface import (
- implements,
+ implementer,
Interface,
)
from zope.sendmail.interfaces import IMailDelivery
@@ -59,18 +59,20 @@
pass
+@implementer(IFoo)
class Foo:
- implements(IFoo)
-
-
+ pass
+
+
+@implementer(IBar)
class Bar:
- implements(IBar)
-
-
+ pass
+
+
+@implementer(IBar)
class FooToBar:
adapts(IFoo)
- implements(IBar)
def __init__(self, foo):
self.foo = foo
@@ -95,9 +97,10 @@
self.assertIs(None, queryAdapter(context, IBar))
+@implementer(IMailDelivery)
class DummyMailer(object):
- implements(IMailDelivery)
+ pass
class TestZopeUtilityFixture(TestCase):
=== modified file 'lib/lp/testing/tests/test_matchers.py'
--- lib/lp/testing/tests/test_matchers.py 2012-06-29 08:40:05 +0000
+++ lib/lp/testing/tests/test_matchers.py 2015-07-08 16:13:45 +0000
@@ -9,7 +9,7 @@
Not,
)
from zope.interface import (
- implements,
+ implementer,
Interface,
)
from zope.interface.exceptions import BrokenImplementation
@@ -45,11 +45,10 @@
"""Dummy method for interface compliance testing."""
+@implementer(ITestInterface)
class Implementor:
"""Dummy class that implements ITestInterface for testing."""
- implements(ITestInterface)
-
def doFoo(self):
pass
@@ -113,8 +112,9 @@
def match_does_not_verify(self):
+ @implementer(ITestInterface)
class BadlyImplementedClass:
- implements(ITestInterface)
+ pass
obj = BadlyImplementedClass()
matcher = Provides(ITestInterface)
=== modified file 'lib/lp/testing/yuixhr.py'
--- lib/lp/testing/yuixhr.py 2013-04-22 06:51:58 +0000
+++ lib/lp/testing/yuixhr.py 2015-07-08 16:13:45 +0000
@@ -23,7 +23,7 @@
import simplejson
from zope.component import getUtility
from zope.exceptions.exceptionformatter import format_exception
-from zope.interface import implements
+from zope.interface import implementer
from zope.publisher.interfaces import NotFound
from zope.publisher.interfaces.http import IResult
from zope.security.checker import (
@@ -117,8 +117,8 @@
logInPrincipal(request, principal, email)
+@implementer(IResult)
class CloseDbResult:
- implements(IResult)
# This is machinery, not content. We specify our security checker here
# directly for clarity.
=== modified file 'lib/lp/testopenid/adapters/openid.py'
--- lib/lp/testopenid/adapters/openid.py 2012-01-01 02:58:52 +0000
+++ lib/lp/testopenid/adapters/openid.py 2015-07-08 16:13:45 +0000
@@ -10,7 +10,7 @@
]
from zope.component import adapts
-from zope.interface import implements
+from zope.interface import implementer
from lp.services.identity.interfaces.account import IAccount
from lp.services.openid.adapters.openid import OpenIDPersistentIdentity
@@ -18,11 +18,11 @@
from lp.testopenid.interfaces.server import ITestOpenIDPersistentIdentity
+@implementer(ITestOpenIDPersistentIdentity)
class TestOpenIDPersistentIdentity(OpenIDPersistentIdentity):
"""See `IOpenIDPersistentIdentity`."""
adapts(IAccount)
- implements(ITestOpenIDPersistentIdentity)
@property
def openid_identity_url(self):
=== modified file 'lib/lp/testopenid/browser/server.py'
--- lib/lp/testopenid/browser/server.py 2013-04-09 09:47:58 +0000
+++ lib/lp/testopenid/browser/server.py 2015-07-08 16:13:45 +0000
@@ -29,7 +29,7 @@
from z3c.ptcompat import ViewPageTemplateFile
from zope.authentication.interfaces import IUnauthenticatedPrincipal
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from zope.security.proxy import isinstance as zisinstance
from zope.session.interfaces import ISession
@@ -82,11 +82,10 @@
oidutil.log = lambda message, level=0: None
+@implementer(ICanonicalUrlData)
class TestOpenIDRootUrlData:
"""`ICanonicalUrlData` for the test OpenID provider."""
- implements(ICanonicalUrlData)
-
path = ''
inside = None
rootsite = 'testopenid'
=== modified file 'lib/lp/translations/browser/hastranslationimports.py'
--- lib/lp/translations/browser/hastranslationimports.py 2013-04-10 08:09:05 +0000
+++ lib/lp/translations/browser/hastranslationimports.py 2015-07-08 16:13:45 +0000
@@ -17,7 +17,7 @@
from zope.component import getUtility
from zope.formlib import form
from zope.formlib.widgets import DropdownWidget
-from zope.interface import implements
+from zope.interface import implementer
from zope.schema import Choice
from zope.schema.interfaces import IContextSourceBinder
from zope.schema.vocabulary import (
@@ -362,11 +362,10 @@
'items': items}
+@implementer(IContextSourceBinder)
class EntryImportStatusVocabularyFactory:
"""Factory for a vocabulary containing a list of statuses for import."""
- implements(IContextSourceBinder)
-
def __init__(self, entry, user):
"""Create a EntryImportStatusVocabularyFactory.
@@ -386,11 +385,10 @@
return SimpleVocabulary(terms)
+@implementer(IContextSourceBinder)
class TranslationImportStatusVocabularyFactory:
"""Factory for a vocabulary containing a list of import statuses."""
- implements(IContextSourceBinder)
-
def __call__(self, context):
terms = [SimpleTerm('all', 'all', 'All statuses')]
for status in RosettaImportStatus.items:
@@ -398,11 +396,10 @@
return SimpleVocabulary(terms)
+@implementer(IContextSourceBinder)
class TranslationImportFileExtensionVocabularyFactory:
"""Factory for a vocabulary containing a list of available extensions."""
- implements(IContextSourceBinder)
-
def __call__(self, context):
file_extensions = ('po', 'pot')
all_files = SimpleTerm('all', 'all', 'All files')
=== modified file 'lib/lp/translations/browser/person.py'
--- lib/lp/translations/browser/person.py 2013-04-10 08:09:05 +0000
+++ lib/lp/translations/browser/person.py 2015-07-08 16:13:45 +0000
@@ -23,7 +23,7 @@
from zope.component import getUtility
from zope.formlib.widgets import TextWidget
from zope.interface import (
- implements,
+ implementer,
Interface,
)
@@ -199,9 +199,9 @@
site='translations')
+@implementer(IPersonTranslationsMenu)
class PersonTranslationView(LaunchpadView):
"""View for translation-related Person pages."""
- implements(IPersonTranslationsMenu)
reviews_to_show = 10
=== modified file 'lib/lp/translations/browser/potemplate.py'
--- lib/lp/translations/browser/potemplate.py 2014-02-27 05:43:46 +0000
+++ lib/lp/translations/browser/potemplate.py 2015-07-08 16:13:45 +0000
@@ -34,7 +34,7 @@
)
from storm.info import ClassAlias
from zope.component import getUtility
-from zope.interface import implements
+from zope.interface import implementer
from zope.publisher.browser import FileUpload
from zope.security.proxy import removeSecurityProxy
@@ -742,8 +742,8 @@
return self.context.source_file_format
+@implementer(ICanonicalUrlData)
class POTemplateSubsetURL:
- implements(ICanonicalUrlData)
rootsite = 'mainsite'
path = '+pots'
@@ -763,8 +763,8 @@
return potemplatesubset.productseries
+@implementer(ICanonicalUrlData)
class POTemplateURL:
- implements(ICanonicalUrlData)
rootsite = 'translations'
=== modified file 'lib/lp/translations/browser/translationimportqueue.py'
--- lib/lp/translations/browser/translationimportqueue.py 2014-08-20 06:59:52 +0000
+++ lib/lp/translations/browser/translationimportqueue.py 2015-07-08 16:13:45 +0000
@@ -17,7 +17,7 @@
from zope.component import getUtility
from zope.formlib.interfaces import ConversionError
-from zope.interface import implements
+from zope.interface import implementer
from zope.schema.interfaces import IContextSourceBinder
from zope.schema.vocabulary import (
SimpleTerm,
@@ -598,11 +598,10 @@
title='Choose which target to show')
+@implementer(IContextSourceBinder)
class TranslationImportTargetVocabularyFactory:
"""Factory for a vocabulary containing a list of targets."""
- implements(IContextSourceBinder)
-
def __init__(self, view):
"""Create a `TranslationImportTargetVocabularyFactory`.
=== modified file 'lib/lp/translations/browser/translationmessage.py'
--- lib/lp/translations/browser/translationmessage.py 2014-07-02 05:53:25 +0000
+++ lib/lp/translations/browser/translationmessage.py 2015-07-08 16:13:45 +0000
@@ -32,7 +32,7 @@
from zope.formlib.utility import setUpWidgets
from zope.formlib.widget import CustomWidgetFactory
from zope.formlib.widgets import DropdownWidget
-from zope.interface import implements
+from zope.interface import implementer
from zope.schema.vocabulary import getVocabularyRegistry
from lp.app.errors import UnexpectedFormData
@@ -1589,11 +1589,10 @@
return None
+@implementer(ITranslationMessageSuggestions)
class TranslationMessageSuggestions:
"""See `ITranslationMessageSuggestions`."""
- implements(ITranslationMessageSuggestions)
-
def __init__(self, title, translation, submissions,
user_is_official_translator, form_is_writeable,
plural_form, seen_translations=None, legal_warning=False,
=== modified file 'lib/lp/translations/interfaces/pofile.py'
--- lib/lp/translations/interfaces/pofile.py 2013-01-07 02:40:55 +0000
+++ lib/lp/translations/interfaces/pofile.py 2015-07-08 16:13:45 +0000
@@ -16,7 +16,7 @@
from zope.component import getUtility
from zope.interface import (
Attribute,
- implements,
+ implementer,
Interface,
)
from zope.schema import (
@@ -302,6 +302,7 @@
"""
+@implementer(IContextSourceBinder)
class AlternativeLanguageVocabularyFactory:
"""Gets vocab for user's preferred languages, or all languages if not set.
@@ -329,7 +330,6 @@
# and class derivation. Also of course, the distinction applies unchanged
# throughout the vocabulary object's lifetime. See interfaces.buglink.py
# for an example of the same implementation pattern.
- implements(IContextSourceBinder)
def __call__(self, context):
"""See `IContextSourceBinder`."""
=== modified file 'lib/lp/translations/model/customlanguagecode.py'
--- lib/lp/translations/model/customlanguagecode.py 2013-06-20 05:50:00 +0000
+++ lib/lp/translations/model/customlanguagecode.py 2015-07-08 16:13:45 +0000
@@ -16,18 +16,17 @@
StringCol,
)
from storm.expr import And
-from zope.interface import implements
+from zope.interface import implementer
from lp.services.database.interfaces import IStore
from lp.services.database.sqlbase import SQLBase
from lp.translations.interfaces.customlanguagecode import ICustomLanguageCode
+@implementer(ICustomLanguageCode)
class CustomLanguageCode(SQLBase):
"""See `ICustomLanguageCode`."""
- implements(ICustomLanguageCode)
-
_table = 'CustomLanguageCode'
product = ForeignKey(
=== modified file 'lib/lp/translations/model/distroserieslanguage.py'
--- lib/lp/translations/model/distroserieslanguage.py 2013-01-07 02:40:55 +0000
+++ lib/lp/translations/model/distroserieslanguage.py 2015-07-08 16:13:45 +0000
@@ -18,7 +18,7 @@
ForeignKey,
IntCol,
)
-from zope.interface import implements
+from zope.interface import implementer
from lp.services.database.constants import (
DEFAULT,
@@ -42,12 +42,12 @@
from lp.translations.utilities.rosettastats import
Follow ups