launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #22846
[Merge] lp:~cjwatson/launchpad/custom-widget-no-class-advice-3 into lp:launchpad
Colin Watson has proposed merging lp:~cjwatson/launchpad/custom-widget-no-class-advice-3 into lp:launchpad.
Commit message:
Remove Zope class advice from custom widget registration (part 3).
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/custom-widget-no-class-advice-3/+merge/353872
Next step after https://code.launchpad.net/~cjwatson/launchpad/custom-widget-no-class-advice-2/+merge/353253.
--
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~cjwatson/launchpad/custom-widget-no-class-advice-3 into lp:launchpad.
=== modified file 'lib/lp/code/browser/branch.py'
--- lib/lp/code/browser/branch.py 2018-06-22 10:01:34 +0000
+++ lib/lp/code/browser/branch.py 2018-08-28 13:49:22 +0000
@@ -39,6 +39,7 @@
from zope.component import getUtility
from zope.event import notify
from zope.formlib import form
+from zope.formlib.widget import CustomWidgetFactory
from zope.formlib.widgets import TextAreaWidget
from zope.interface import (
implementer,
@@ -61,7 +62,6 @@
from lp.app.browser.informationtype import InformationTypePortletMixin
from lp.app.browser.launchpadform import (
action,
- custom_widget,
LaunchpadEditFormView,
LaunchpadFormView,
)
@@ -1082,9 +1082,9 @@
'lifecycle_status'])
return field_names
- custom_widget('target', BranchTargetWidget)
- custom_widget('lifecycle_status', LaunchpadRadioWidgetWithDescription)
- custom_widget('information_type', LaunchpadRadioWidgetWithDescription)
+ custom_widget_target = BranchTargetWidget
+ custom_widget_lifecycle_status = LaunchpadRadioWidgetWithDescription
+ custom_widget_information_type = LaunchpadRadioWidgetWithDescription
any_owner_description = _(
"As an administrator you are able to assign this branch to any "
@@ -1201,9 +1201,11 @@
schema = RegisterProposalSchema
for_input = True
- custom_widget('target_branch', TargetBranchWidget)
- custom_widget('commit_message', TextAreaWidget, cssClass='comment-text')
- custom_widget('comment', TextAreaWidget, cssClass='comment-text')
+ custom_widget_target_branch = TargetBranchWidget
+ custom_widget_commit_message = CustomWidgetFactory(
+ TextAreaWidget, cssClass='comment-text')
+ custom_widget_comment = CustomWidgetFactory(
+ TextAreaWidget, cssClass='comment-text')
page_title = label = 'Propose branch for merging'
=== modified file 'lib/lp/code/browser/branchlisting.py'
--- lib/lp/code/browser/branchlisting.py 2017-06-15 01:02:11 +0000
+++ lib/lp/code/browser/branchlisting.py 2018-08-28 13:49:22 +0000
@@ -1,4 +1,4 @@
-# Copyright 2009-2017 Canonical Ltd. This software is licensed under the
+# Copyright 2009-2018 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Base class view for branch listings."""
@@ -49,10 +49,7 @@
Badge,
HasBadgeBase,
)
-from lp.app.browser.launchpadform import (
- custom_widget,
- LaunchpadFormView,
- )
+from lp.app.browser.launchpadform import LaunchpadFormView
from lp.app.enums import (
PRIVATE_INFORMATION_TYPES,
ServiceUsage,
@@ -459,8 +456,8 @@
field_names = ['lifecycle', 'sort_by']
development_focus_branch = None
show_set_development_focus = False
- custom_widget('lifecycle', LaunchpadDropdownWidget)
- custom_widget('sort_by', LaunchpadDropdownWidget)
+ custom_widget_lifecycle = LaunchpadDropdownWidget
+ custom_widget_sort_by = LaunchpadDropdownWidget
# Showing the series links is only really useful on product listing
# pages. Derived views can override this value to have the series links
# shown in the branch listings.
@@ -839,7 +836,7 @@
schema = IPersonBranchListingFilter
field_names = ['category', 'lifecycle', 'sort_by']
- custom_widget('category', LaunchpadDropdownWidget)
+ custom_widget_category = LaunchpadDropdownWidget
no_sort_by = (BranchListingSort.DEFAULT, BranchListingSort.OWNER)
can_have_git_link = True
=== modified file 'lib/lp/code/browser/branchmergeproposal.py'
--- lib/lp/code/browser/branchmergeproposal.py 2018-06-21 17:26:43 +0000
+++ lib/lp/code/browser/branchmergeproposal.py 2018-08-28 13:49:22 +0000
@@ -41,6 +41,7 @@
getUtility,
)
from zope.formlib import form
+from zope.formlib.widget import CustomWidgetFactory
from zope.formlib.widgets import TextAreaWidget
from zope.interface import (
implementer,
@@ -60,7 +61,6 @@
from lp import _
from lp.app.browser.launchpadform import (
action,
- custom_widget,
LaunchpadEditFormView,
LaunchpadFormView,
)
@@ -1308,7 +1308,8 @@
schema = IAddVote
field_names = ['vote', 'review_type', 'comment']
- custom_widget('comment', TextAreaWidget, cssClass='comment-text')
+ custom_widget_comment = CustomWidgetFactory(
+ TextAreaWidget, cssClass='comment-text')
@cachedproperty
def initial_values(self):
=== modified file 'lib/lp/code/browser/branchmergeproposallisting.py'
--- lib/lp/code/browser/branchmergeproposallisting.py 2015-10-14 12:50:55 +0000
+++ lib/lp/code/browser/branchmergeproposallisting.py 2018-08-28 13:49:22 +0000
@@ -1,4 +1,4 @@
-# Copyright 2009-2015 Canonical Ltd. This software is licensed under the
+# Copyright 2009-2018 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Base class view for branch merge proposal listings."""
@@ -31,10 +31,7 @@
from zope.schema import Choice
from lp import _
-from lp.app.browser.launchpadform import (
- custom_widget,
- LaunchpadFormView,
- )
+from lp.app.browser.launchpadform import LaunchpadFormView
from lp.app.interfaces.launchpad import IHeadingContext
from lp.app.widgets.itemswidgets import LaunchpadDropdownWidget
from lp.code.enums import (
@@ -201,7 +198,7 @@
schema = BranchMergeProposalFilterSchema
field_names = ['status']
- custom_widget('status', LaunchpadDropdownWidget)
+ custom_widget_status = LaunchpadDropdownWidget
extra_columns = []
_queue_status = None
=== modified file 'lib/lp/code/browser/codeimport.py'
--- lib/lp/code/browser/codeimport.py 2017-10-21 18:14:14 +0000
+++ lib/lp/code/browser/codeimport.py 2018-08-28 13:49:22 +0000
@@ -1,4 +1,4 @@
-# Copyright 2009-2016 Canonical Ltd. This software is licensed under the
+# Copyright 2009-2018 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Browser views for CodeImports."""
@@ -42,7 +42,6 @@
from lp import _
from lp.app.browser.launchpadform import (
action,
- custom_widget,
LaunchpadFormView,
)
from lp.app.errors import NotFoundError
@@ -183,9 +182,11 @@
schema = ICodeImport
- custom_widget('cvs_root', StrippedTextWidget, displayWidth=50)
- custom_widget('cvs_module', StrippedTextWidget, displayWidth=20)
- custom_widget('url', URIWidget, displayWidth=50)
+ custom_widget_cvs_root = CustomWidgetFactory(
+ StrippedTextWidget, displayWidth=50)
+ custom_widget_cvs_module = CustomWidgetFactory(
+ StrippedTextWidget, displayWidth=20)
+ custom_widget_url = CustomWidgetFactory(URIWidget, displayWidth=50)
@cachedproperty
def _super_user(self):
@@ -328,8 +329,8 @@
schema = NewCodeImportForm
for_input = True
- custom_widget('rcs_type', LaunchpadRadioWidget)
- custom_widget('git_target_rcs_type', LaunchpadRadioWidget)
+ custom_widget_rcs_type = LaunchpadRadioWidget
+ custom_widget_git_target_rcs_type = LaunchpadRadioWidget
@property
def initial_values(self):
=== modified file 'lib/lp/code/browser/codereviewcomment.py'
--- lib/lp/code/browser/codereviewcomment.py 2018-04-25 12:01:33 +0000
+++ lib/lp/code/browser/codereviewcomment.py 2018-08-28 13:49:22 +0000
@@ -13,6 +13,7 @@
from lazr.delegates import delegate_to
from lazr.restful.interface import copy_field
from zope.component import getUtility
+from zope.formlib.widget import CustomWidgetFactory
from zope.formlib.widgets import (
DropdownWidget,
TextAreaWidget,
@@ -27,7 +28,6 @@
from lp import _
from lp.app.browser.launchpadform import (
action,
- custom_widget,
LaunchpadFormView,
)
from lp.code.interfaces.codereviewcomment import ICodeReviewComment
@@ -228,9 +228,11 @@
schema = IEditCodeReviewComment
- custom_widget('review_type', TextWidget, displayWidth=15)
- custom_widget('comment', TextAreaWidget, cssClass='comment-text')
- custom_widget('vote', MyDropWidget)
+ custom_widget_review_type = CustomWidgetFactory(
+ TextWidget, displayWidth=15)
+ custom_widget_comment = CustomWidgetFactory(
+ TextAreaWidget, cssClass='comment-text')
+ custom_widget_vote = MyDropWidget
page_title = 'Reply to code review comment'
=== modified file 'lib/lp/code/browser/gitref.py'
--- lib/lp/code/browser/gitref.py 2018-08-24 16:52:27 +0000
+++ lib/lp/code/browser/gitref.py 2018-08-28 13:49:22 +0000
@@ -20,6 +20,7 @@
urlunsplit,
)
from zope.component import getUtility
+from zope.formlib.widget import CustomWidgetFactory
from zope.formlib.widgets import TextAreaWidget
from zope.interface import Interface
from zope.publisher.interfaces import NotFound
@@ -33,7 +34,6 @@
from lp import _
from lp.app.browser.launchpadform import (
action,
- custom_widget,
LaunchpadFormView,
)
from lp.app.widgets.suggestion import TargetGitRepositoryWidget
@@ -259,9 +259,11 @@
schema = GitRefRegisterMergeProposalSchema
for_input = True
- custom_widget('target_git_repository', TargetGitRepositoryWidget)
- custom_widget('commit_message', TextAreaWidget, cssClass='comment-text')
- custom_widget('comment', TextAreaWidget, cssClass='comment-text')
+ custom_widget_target_git_repository = TargetGitRepositoryWidget
+ custom_widget_commit_message = CustomWidgetFactory(
+ TextAreaWidget, cssClass='comment-text')
+ custom_widget_comment = CustomWidgetFactory(
+ TextAreaWidget, cssClass='comment-text')
page_title = label = 'Propose for merging'
=== modified file 'lib/lp/code/browser/gitrepository.py'
--- lib/lp/code/browser/gitrepository.py 2018-08-24 16:52:27 +0000
+++ lib/lp/code/browser/gitrepository.py 2018-08-28 13:49:22 +0000
@@ -49,7 +49,6 @@
from lp.app.browser.informationtype import InformationTypePortletMixin
from lp.app.browser.launchpadform import (
action,
- custom_widget,
LaunchpadEditFormView,
LaunchpadFormView,
)
@@ -540,7 +539,7 @@
"default_branch",
]
- custom_widget("information_type", LaunchpadRadioWidgetWithDescription)
+ custom_widget_information_type = LaunchpadRadioWidgetWithDescription
any_owner_description = _(
"As an administrator you are able to assign this repository to any "
=== modified file 'lib/lp/code/browser/sourcepackagerecipe.py'
--- lib/lp/code/browser/sourcepackagerecipe.py 2017-06-16 10:29:14 +0000
+++ lib/lp/code/browser/sourcepackagerecipe.py 2018-08-28 13:49:22 +0000
@@ -1,4 +1,4 @@
-# Copyright 2010-2016 Canonical Ltd. This software is licensed under the
+# Copyright 2010-2018 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""SourcePackageRecipe views."""
@@ -61,7 +61,6 @@
from lp import _
from lp.app.browser.launchpadform import (
action,
- custom_widget,
has_structured_doc,
LaunchpadEditFormView,
LaunchpadFormView,
@@ -379,7 +378,7 @@
Choice(vocabulary='BuildableDistroSeries'),
title=u'Distribution series')
- custom_widget('distroseries', LabeledMultiCheckBoxWidget)
+ custom_widget_distroseries = LabeledMultiCheckBoxWidget
def validate(self, data):
if not data['archive']:
@@ -668,23 +667,21 @@
class RecipeRelatedBranchesMixin(LaunchpadFormView):
"""A class to find related branches for a recipe's base branch."""
- custom_widget('related-branches', RelatedBranchesWidget)
+ custom_widget_related_branches = RelatedBranchesWidget
def extendFields(self):
"""See `LaunchpadFormView`.
Adds a related branches field to the form.
"""
- self.form_fields += form.Fields(Field(__name__='related-branches'))
- self.form_fields['related-branches'].custom_widget = (
- self.custom_widgets['related-branches'])
- self.widget_errors['related-branches'] = ''
+ self.form_fields += form.Fields(Field(__name__='related_branches'))
+ self.widget_errors['related_branches'] = ''
def setUpWidgets(self, context=None):
# Adds a new related branches widget.
super(RecipeRelatedBranchesMixin, self).setUpWidgets(context)
- self.widgets['related-branches'].display_label = False
- self.widgets['related-branches'].setRenderedValue(dict(
+ self.widgets['related_branches'].display_label = False
+ self.widgets['related_branches'].setRenderedValue(dict(
related_package_branch_info=self.related_package_branch_info,
related_series_branch_info=self.related_series_branch_info))
@@ -712,9 +709,9 @@
title = label = 'Create a new source package recipe'
schema = ISourcePackageAddSchema
- custom_widget('distroseries', LabeledMultiCheckBoxWidget)
- custom_widget('owner', RecipeOwnerWidget)
- custom_widget('use_ppa', LaunchpadRadioWidget)
+ custom_widget_distroseries = LabeledMultiCheckBoxWidget
+ custom_widget_owner = RecipeOwnerWidget
+ custom_widget_use_ppa = LaunchpadRadioWidget
def initialize(self):
super(SourcePackageRecipeAddView, self).initialize()
@@ -862,7 +859,7 @@
label = title
schema = ISourcePackageEditSchema
- custom_widget('distroseries', LabeledMultiCheckBoxWidget)
+ custom_widget_distroseries = LabeledMultiCheckBoxWidget
def setUpFields(self):
super(SourcePackageRecipeEditView, self).setUpFields()
=== modified file 'lib/lp/code/templates/sourcepackagerecipe-new.pt'
--- lib/lp/code/templates/sourcepackagerecipe-new.pt 2016-01-20 16:07:26 +0000
+++ lib/lp/code/templates/sourcepackagerecipe-new.pt 2018-08-28 13:49:22 +0000
@@ -107,7 +107,7 @@
<tal:widget define="widget nocall:view/widgets/recipe_text">
<metal:block use-macro="context/@@launchpad_form/widget_row" />
</tal:widget>
- <tal:widget define="widget nocall:view/widgets/related-branches">
+ <tal:widget define="widget nocall:view/widgets/related_branches">
<metal:block use-macro="context/@@launchpad_form/widget_row" />
</tal:widget>
=== modified file 'lib/lp/registry/browser/announcement.py'
--- lib/lp/registry/browser/announcement.py 2015-07-08 16:05:11 +0000
+++ lib/lp/registry/browser/announcement.py 2018-08-28 13:49:22 +0000
@@ -1,4 +1,4 @@
-# Copyright 2009-2011 Canonical Ltd. This software is licensed under the
+# Copyright 2009-2018 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Announcement views."""
@@ -29,7 +29,6 @@
from lp import _
from lp.app.browser.launchpadform import (
action,
- custom_widget,
LaunchpadFormView,
)
from lp.app.validators.url import valid_webref
@@ -149,7 +148,7 @@
label = "Make an announcement"
page_title = label
- custom_widget('publication_date', AnnouncementDateWidget)
+ custom_widget_publication_date = AnnouncementDateWidget
@action(_('Make announcement'), name='announce')
def announce_action(self, action, data):
@@ -246,7 +245,7 @@
field_names = ['publication_date']
page_title = 'Publish announcement'
- custom_widget('publication_date', AnnouncementDateWidget)
+ custom_widget_publication_date = AnnouncementDateWidget
@action(_('Publish'), name='publish')
def publish_action(self, action, data):
=== modified file 'lib/lp/registry/browser/branding.py'
--- lib/lp/registry/browser/branding.py 2012-02-28 04:24:19 +0000
+++ lib/lp/registry/browser/branding.py 2018-08-28 13:49:22 +0000
@@ -1,4 +1,4 @@
-# Copyright 2009-2012 Canonical Ltd. This software is licensed under the
+# Copyright 2009-2018 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Browser views for items that can be displayed as images."""
@@ -9,9 +9,10 @@
'BrandingChangeView',
]
+from zope.formlib.widget import CustomWidgetFactory
+
from lp.app.browser.launchpadform import (
action,
- custom_widget,
LaunchpadEditFormView,
)
from lp.app.widgets.image import ImageChangeWidget
@@ -34,9 +35,12 @@
page_title = "Change branding"
- custom_widget('icon', ImageChangeWidget, ImageChangeWidget.EDIT_STYLE)
- custom_widget('logo', ImageChangeWidget, ImageChangeWidget.EDIT_STYLE)
- custom_widget('mugshot', ImageChangeWidget, ImageChangeWidget.EDIT_STYLE)
+ custom_widget_icon = CustomWidgetFactory(
+ ImageChangeWidget, ImageChangeWidget.EDIT_STYLE)
+ custom_widget_logo = CustomWidgetFactory(
+ ImageChangeWidget, ImageChangeWidget.EDIT_STYLE)
+ custom_widget_mugshot = CustomWidgetFactory(
+ ImageChangeWidget, ImageChangeWidget.EDIT_STYLE)
@action("Change Branding", name='change')
def change_action(self, action, data):
=== modified file 'lib/lp/registry/browser/distribution.py'
--- lib/lp/registry/browser/distribution.py 2015-10-13 13:22:08 +0000
+++ lib/lp/registry/browser/distribution.py 2018-08-28 13:49:22 +0000
@@ -1,4 +1,4 @@
-# Copyright 2009-2015 Canonical Ltd. This software is licensed under the
+# Copyright 2009-2018 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Browser views for distributions."""
@@ -45,6 +45,7 @@
from zope.event import notify
from zope.formlib import form
from zope.formlib.boolwidgets import CheckBoxWidget
+from zope.formlib.widget import CustomWidgetFactory
from zope.interface import implementer
from zope.lifecycleevent import ObjectCreatedEvent
from zope.schema import Bool
@@ -55,7 +56,6 @@
from lp.answers.browser.questiontarget import QuestionTargetTraversalMixin
from lp.app.browser.launchpadform import (
action,
- custom_widget,
LaunchpadEditFormView,
LaunchpadFormView,
)
@@ -832,8 +832,8 @@
"translations_usage",
"answers_usage",
]
- custom_widget('require_virtualized', CheckBoxWidget)
- custom_widget('processors', LabeledMultiCheckBoxWidget)
+ custom_widget_require_virtualized = CheckBoxWidget
+ custom_widget_processors = LabeledMultiCheckBoxWidget
@property
def page_title(self):
@@ -906,11 +906,14 @@
'translation_focus',
]
- custom_widget('icon', ImageChangeWidget, ImageChangeWidget.EDIT_STYLE)
- custom_widget('logo', ImageChangeWidget, ImageChangeWidget.EDIT_STYLE)
- custom_widget('mugshot', ImageChangeWidget, ImageChangeWidget.EDIT_STYLE)
- custom_widget('require_virtualized', CheckBoxWidget)
- custom_widget('processors', LabeledMultiCheckBoxWidget)
+ custom_widget_icon = CustomWidgetFactory(
+ ImageChangeWidget, ImageChangeWidget.EDIT_STYLE)
+ custom_widget_logo = CustomWidgetFactory(
+ ImageChangeWidget, ImageChangeWidget.EDIT_STYLE)
+ custom_widget_mugshot = CustomWidgetFactory(
+ ImageChangeWidget, ImageChangeWidget.EDIT_STYLE)
+ custom_widget_require_virtualized = CheckBoxWidget
+ custom_widget_processors = LabeledMultiCheckBoxWidget
@property
def label(self):
=== modified file 'lib/lp/registry/browser/distroseries.py'
--- lib/lp/registry/browser/distroseries.py 2015-10-13 13:22:08 +0000
+++ lib/lp/registry/browser/distroseries.py 2018-08-28 13:49:22 +0000
@@ -1,4 +1,4 @@
-# Copyright 2009-2013 Canonical Ltd. This software is licensed under the
+# Copyright 2009-2018 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""View classes related to `IDistroSeries`."""
@@ -26,6 +26,7 @@
from zope.component import getUtility
from zope.event import notify
from zope.formlib import form
+from zope.formlib.widget import CustomWidgetFactory
from zope.interface import Interface
from zope.lifecycleevent import ObjectCreatedEvent
from zope.schema import (
@@ -41,7 +42,6 @@
from lp import _
from lp.app.browser.launchpadform import (
action,
- custom_widget,
LaunchpadEditFormView,
LaunchpadFormView,
)
@@ -553,7 +553,7 @@
"""
schema = IDistroSeries
field_names = ['display_name', 'title', 'summary', 'description']
- custom_widget('status', LaunchpadDropdownWidget)
+ custom_widget_status = LaunchpadDropdownWidget
@property
def label(self):
@@ -605,7 +605,7 @@
schema = IDistroSeries
field_names = [
'name', 'version', 'changeslist', 'inherit_overrides_from_parents']
- custom_widget('status', LaunchpadDropdownWidget)
+ custom_widget_status = LaunchpadDropdownWidget
@property
def label(self):
@@ -866,10 +866,10 @@
a derived series and its parent."""
schema = IDifferencesFormSchema
field_names = ['selected_differences', 'sponsored_person']
- custom_widget('selected_differences', LabeledMultiCheckBoxWidget)
- custom_widget('package_type', LaunchpadRadioWidget)
- custom_widget(
- 'sponsored_person', PersonPickerWidget,
+ custom_widget_selected_differences = LabeledMultiCheckBoxWidget
+ custom_widget_package_type = LaunchpadRadioWidget
+ custom_widget_sponsored_person = CustomWidgetFactory(
+ PersonPickerWidget,
header="Select person being sponsored", show_assign_me_button=False)
# Differences type to display. Can be overrided by sublasses.
=== modified file 'lib/lp/registry/browser/distroseriesdifference.py'
--- lib/lp/registry/browser/distroseriesdifference.py 2018-04-25 12:01:33 +0000
+++ lib/lp/registry/browser/distroseriesdifference.py 2018-08-28 13:49:22 +0000
@@ -26,10 +26,7 @@
SimpleVocabulary,
)
-from lp.app.browser.launchpadform import (
- custom_widget,
- LaunchpadFormView,
- )
+from lp.app.browser.launchpadform import LaunchpadFormView
from lp.registry.enums import (
DistroSeriesDifferenceStatus,
DistroSeriesDifferenceType,
@@ -112,7 +109,7 @@
@implementer(IConversation)
class DistroSeriesDifferenceView(LaunchpadFormView):
schema = IDistroSeriesDifferenceForm
- custom_widget('blacklist_options', RadioWidget)
+ custom_widget_blacklist_options = RadioWidget
@property
def initial_values(self):
=== modified file 'lib/lp/registry/browser/featuredproject.py'
--- lib/lp/registry/browser/featuredproject.py 2015-10-26 14:54:43 +0000
+++ lib/lp/registry/browser/featuredproject.py 2018-08-28 13:49:22 +0000
@@ -1,4 +1,4 @@
-# Copyright 2009-2011 Canonical Ltd. This software is licensed under the
+# Copyright 2009-2018 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Featured Project views."""
@@ -19,7 +19,6 @@
from lp import _
from lp.app.browser.launchpadform import (
action,
- custom_widget,
LaunchpadFormView,
)
from lp.app.widgets.itemswidgets import LabeledMultiCheckBoxWidget
@@ -51,7 +50,7 @@
page_title = label
schema = FeaturedProjectForm
- custom_widget('remove', LabeledMultiCheckBoxWidget)
+ custom_widget_remove = LabeledMultiCheckBoxWidget
@action(_('Update featured project list'), name='update')
def update_action(self, action, data):
=== modified file 'lib/lp/registry/browser/milestone.py'
--- lib/lp/registry/browser/milestone.py 2015-07-08 16:05:11 +0000
+++ lib/lp/registry/browser/milestone.py 2018-08-28 13:49:22 +0000
@@ -1,4 +1,4 @@
-# Copyright 2009-2013 Canonical Ltd. This software is licensed under the
+# Copyright 2009-2018 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Milestone views."""
@@ -40,7 +40,6 @@
from lp.app.browser.informationtype import InformationTypePortletMixin
from lp.app.browser.launchpadform import (
action,
- custom_widget,
LaunchpadEditFormView,
LaunchpadFormView,
safe_action,
@@ -452,7 +451,7 @@
field_names = ['name', 'code_name', 'dateexpected', 'summary']
label = "Register a new milestone"
- custom_widget('dateexpected', DateWidget)
+ custom_widget_dateexpected = DateWidget
@action(_('Register Milestone'), name='register')
def register_action(self, action, data):
@@ -489,7 +488,7 @@
schema = IMilestone
label = "Modify milestone details"
- custom_widget('dateexpected', DateWidget)
+ custom_widget_dateexpected = DateWidget
@property
def cancel_url(self):
=== modified file 'lib/lp/registry/browser/nameblacklist.py'
--- lib/lp/registry/browser/nameblacklist.py 2015-07-08 16:05:11 +0000
+++ lib/lp/registry/browser/nameblacklist.py 2018-08-28 13:49:22 +0000
@@ -1,4 +1,4 @@
-# Copyright 2010-2012 Canonical Ltd. This software is licensed under the
+# Copyright 2010-2018 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
__metaclass__ = type
@@ -16,12 +16,12 @@
adapter,
getUtility,
)
+from zope.formlib.widget import CustomWidgetFactory
from zope.formlib.widgets import TextWidget
from zope.interface import implementer
from lp.app.browser.launchpadform import (
action,
- custom_widget,
LaunchpadFormView,
)
from lp.registry.browser import RegistryEditFormView
@@ -92,7 +92,7 @@
label = "Add a new blacklist expression"
page_title = label
- custom_widget('regexp', TextWidget, displayWidth=60)
+ custom_widget_regexp = CustomWidgetFactory(TextWidget, displayWidth=60)
@property
def cancel_url(self):
=== modified file 'lib/lp/registry/browser/objectreassignment.py'
--- lib/lp/registry/browser/objectreassignment.py 2013-04-10 07:45:16 +0000
+++ lib/lp/registry/browser/objectreassignment.py 2018-08-28 13:49:22 +0000
@@ -1,4 +1,4 @@
-# Copyright 2009-2011 Canonical Ltd. This software is licensed under the
+# Copyright 2009-2018 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""A view for changing the owner or registrant of an object.
@@ -26,7 +26,6 @@
from lp import _
from lp.app.browser.launchpadform import (
action,
- custom_widget,
LaunchpadFormView,
)
from lp.app.validators.name import valid_name
@@ -63,7 +62,7 @@
callback = None
schema = IObjectReassignment
- custom_widget('existing', LaunchpadRadioWidget)
+ custom_widget_existing = LaunchpadRadioWidget
@property
def label(self):
Follow ups