launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #00350
[Merge] lp:~mwhudson/launchpad/no-more-__used_for__ into lp:launchpad/devel
Michael Hudson has proposed merging lp:~mwhudson/launchpad/no-more-__used_for__ into lp:launchpad/devel.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
Hi,
This _very exciting_ branch removes the __used_for__ declarations from all our browser code. Apparently they're a relic of an old way Zope used to do things, so I deleted them all.
Cheers,
mwh
--
https://code.launchpad.net/~mwhudson/launchpad/no-more-__used_for__/+merge/31351
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~mwhudson/launchpad/no-more-__used_for__ into lp:launchpad/devel.
=== modified file 'lib/canonical/launchpad/browser/librarian.py'
--- lib/canonical/launchpad/browser/librarian.py 2010-03-26 19:19:49 +0000
+++ lib/canonical/launchpad/browser/librarian.py 2010-07-30 06:13:48 +0000
@@ -46,8 +46,6 @@
http://launchpad.net/firefox/1.0./1.0.0/+download/firefox-1.0.0.tgz.
"""
- __used_for__ = ILibraryFileAlias
-
def initialize(self):
"""Redirect the request to the URL of the file in the Librarian."""
# Redirect based on the scheme of the request, as set by Apache in the
@@ -65,8 +63,6 @@
class LibraryFileAliasMD5View(LaunchpadView):
"""View to show the MD5 digest for a librarian file."""
- __used_for__ = ILibraryFileAlias
-
def render(self):
"""Return the plain text MD5 signature"""
self.request.response.setHeader('Content-type', 'text/plain')
@@ -81,8 +77,6 @@
"""
implements(IBrowserPublisher)
- __used_for__ = ILibraryFileAlias
-
def getFileContents(self):
# Reset system proxy setting if it exists. The urllib2 default
# opener is cached that's why it has to be re-installed after
=== modified file 'lib/canonical/launchpad/webapp/tales.py'
--- lib/canonical/launchpad/webapp/tales.py 2010-06-08 15:57:09 +0000
+++ lib/canonical/launchpad/webapp/tales.py 2010-07-30 06:13:48 +0000
@@ -290,7 +290,6 @@
"""
implements(ITraversable)
- __used_for__ = IBrowserApplicationRequest
def __init__(self, request):
self.form = request.form
@@ -340,8 +339,6 @@
"""Adapter from IApplicationRequest to IRequestAPI."""
implements(IRequestAPI)
- __used_for__ = IApplicationRequest
-
def __init__(self, request):
self.request = request
=== modified file 'lib/canonical/lazr/doc/menus.txt'
--- lib/canonical/lazr/doc/menus.txt 2010-02-23 13:36:51 +0000
+++ lib/canonical/lazr/doc/menus.txt 2010-07-30 06:13:48 +0000
@@ -105,26 +105,21 @@
>>> class RecipeIndexView(LaunchpadView):
... """View for summary of a recipe on the cookery facet."""
- ... __used_for__ = IRecipe
>>> class RecipeEditInstructionsView(LaunchpadView):
... """View for editing recipe instructions on the cookery facet."""
- ... __used_for__ = IRecipe
... implements(IRecipeEditMenuMarker)
>>> class RecipeEditIngredientsView(LaunchpadView):
... """View for editing recipe ingedients on the cookery facet."""
- ... __used_for__ = IRecipe
... implements(IRecipeEditMenuMarker)
>>> class RecipeReadJournalView(LaunchpadView):
... """View for reading a recipe's journal on the cookery facet."""
- ... __used_for__ = IRecipe
... implements(IRecipeJournalMenuMarker)
>>> class RecipeQuestionsAllView(LaunchpadView):
... """View for all questions of a recipe on the questions facet."""
- ... __used_for__ = IRecipe
# Monkey patch the interfaces and views into the cookingexample module.
>>> cookingexample.IRecipeEditMenuMarker = IRecipeEditMenuMarker
=== modified file 'lib/lp/answers/browser/faq.py'
--- lib/lp/answers/browser/faq.py 2009-10-31 15:04:48 +0000
+++ lib/lp/answers/browser/faq.py 2010-07-30 06:13:48 +0000
@@ -57,8 +57,6 @@
class FAQView(LaunchpadView):
"""View for the FAQ index."""
- __used_for__ = IFAQ
-
@property
def label(self):
return self.context.title
=== modified file 'lib/lp/blueprints/browser/specification.py'
--- lib/lp/blueprints/browser/specification.py 2009-11-11 15:54:20 +0000
+++ lib/lp/blueprints/browser/specification.py 2010-07-30 06:13:48 +0000
@@ -424,8 +424,6 @@
class SpecificationSimpleView(LaunchpadView):
"""Used to render portlets and listing items that need browser code."""
- __used_for__ = ISpecification
-
@cachedproperty
def feedbackrequests(self):
if self.user is None:
@@ -457,8 +455,6 @@
class SpecificationView(SpecificationSimpleView):
"""Used to render the main view of a specification."""
- __used_for__ = ISpecification
-
@property
def label(self):
return self.context.title
=== modified file 'lib/lp/blueprints/browser/sprint.py'
--- lib/lp/blueprints/browser/sprint.py 2009-11-09 04:24:09 +0000
+++ lib/lp/blueprints/browser/sprint.py 2010-07-30 06:13:48 +0000
@@ -140,8 +140,6 @@
class SprintView(HasSpecificationsView, LaunchpadView):
- __used_for__ = ISprint
-
implements(IMajorHeadingView)
# XXX Michael Nelson 20090923 bug=435255
@@ -149,7 +147,7 @@
# a second h1 to display. But as this view implements IMajorHeadingView
# it should not include an h1 below the app buttons.
label = None
-
+
@property
def page_title(self):
return '%s (sprint or meeting)' % self.context.title
=== modified file 'lib/lp/blueprints/interfaces/specificationdependency.py'
--- lib/lp/blueprints/interfaces/specificationdependency.py 2009-06-25 00:00:26 +0000
+++ lib/lp/blueprints/interfaces/specificationdependency.py 2010-07-30 06:13:48 +0000
@@ -46,7 +46,6 @@
class SpecDependencyIsAlsoRemoval:
implements(ISpecificationDependencyRemoval)
- __used_for__ = ISpecificationDependency
def __init__(self, specdep):
self.specdep = specdep
=== modified file 'lib/lp/bugs/browser/bugbranch.py'
--- lib/lp/bugs/browser/bugbranch.py 2009-11-14 10:03:57 +0000
+++ lib/lp/bugs/browser/bugbranch.py 2010-07-30 06:13:48 +0000
@@ -95,8 +95,6 @@
class BugBranchView(LaunchpadView):
"""Simple view to cache related branch information."""
- __used_for__ = IBugBranch
-
@cachedproperty
def merge_proposals(self):
"""Return a list of active proposals for the branch."""
=== modified file 'lib/lp/bugs/browser/cve.py'
--- lib/lp/bugs/browser/cve.py 2010-05-21 13:45:56 +0000
+++ lib/lp/bugs/browser/cve.py 2010-07-30 06:13:48 +0000
@@ -116,8 +116,6 @@
class CveSetView:
- __used_for__ = ICveSet
-
def __init__(self, context, request):
self.context = context
self.request = request
=== modified file 'lib/lp/code/browser/branch.py'
--- lib/lp/code/browser/branch.py 2010-06-17 01:16:30 +0000
+++ lib/lp/code/browser/branch.py 2010-07-30 06:13:48 +0000
@@ -326,8 +326,6 @@
class BranchView(LaunchpadView, FeedsMixin):
- __used_for__ = IBranch
-
feed_types = (
BranchFeedLink,
)
@@ -1155,8 +1153,6 @@
class BranchMergeQueueView(LaunchpadView):
"""The view used to render the merge queue for a branch."""
- __used_for__ = IBranch
-
@cachedproperty
def merge_queue(self):
"""Get the merge queue and check visibility."""
=== modified file 'lib/lp/code/browser/branchlisting.py'
--- lib/lp/code/browser/branchlisting.py 2010-05-28 01:44:13 +0000
+++ lib/lp/code/browser/branchlisting.py 2010-07-30 06:13:48 +0000
@@ -1037,14 +1037,10 @@
class PersonCodeSummaryView(LaunchpadView):
"""A view to render the code page summary for a person."""
- __used_for__ = IPerson
-
class PersonProductCodeSummaryView(PersonCodeSummaryView):
"""A view to render the code page summary for a `PersonProduct`."""
- __used_for__ = IPersonProduct
-
@property
def person(self):
"""Return the person from the context."""
=== modified file 'lib/lp/code/browser/branchmergeproposal.py'
--- lib/lp/code/browser/branchmergeproposal.py 2010-06-17 01:16:30 +0000
+++ lib/lp/code/browser/branchmergeproposal.py 2010-07-30 06:13:48 +0000
@@ -550,7 +550,6 @@
implements(IBranchMergeProposalActionMenu)
label = "Proposal to merge branch"
- __used_for__ = IBranchMergeProposal
schema = ClaimButton
@action('Claim', name='claim')
@@ -782,8 +781,6 @@
class BranchMergeProposalVoteView(LaunchpadView):
"""The view used for the tables of votes and requested reviews."""
- __used_for__ = IBranchMergeProposal
-
@property
def show_table(self):
"""Should the reviewer table be shown at all?
@@ -1238,8 +1235,6 @@
class BranchMergeProposalSubscribersView(LaunchpadView):
"""Used to show the pagelet subscribers on the main proposal page."""
- __used_for__ = IBranchMergeProposal
-
def initialize(self):
"""See `LaunchpadView`."""
# Get the subscribers and dump them into two sets.
@@ -1451,8 +1446,6 @@
class FormatPreviewDiffView(LaunchpadView, DiffRenderingMixin):
"""A simple view to render a diff formatted nicely."""
- __used_for__ = IPreviewDiff
-
@property
def preview_diff(self):
return self.context
=== modified file 'lib/lp/code/browser/codeimport.py'
--- lib/lp/code/browser/codeimport.py 2010-05-25 03:13:25 +0000
+++ lib/lp/code/browser/codeimport.py 2010-07-30 06:13:48 +0000
@@ -594,8 +594,6 @@
class CodeImportMachineView(LaunchpadView):
"""The view for the page that shows all the import machines."""
- __used_for__ = ICodeImportSet
-
label = "Import machines for Launchpad"
@property
=== modified file 'lib/lp/code/browser/codeimportmachine.py'
--- lib/lp/code/browser/codeimportmachine.py 2010-04-23 03:36:24 +0000
+++ lib/lp/code/browser/codeimportmachine.py 2010-07-30 06:13:48 +0000
@@ -56,8 +56,6 @@
class CodeImportMachineSetView(LaunchpadView):
"""The view for the page that shows all the import machines."""
- __used_for__ = ICodeImportMachineSet
-
label = "Import machines for Launchpad"
@property
=== modified file 'lib/lp/code/browser/codereviewcomment.py'
--- lib/lp/code/browser/codereviewcomment.py 2010-02-19 19:16:32 +0000
+++ lib/lp/code/browser/codereviewcomment.py 2010-07-30 06:13:48 +0000
@@ -113,7 +113,6 @@
class CodeReviewCommentView(LaunchpadView):
"""Standard view of a CodeReviewComment"""
- __used_for__ = ICodeReviewComment
page_title = "Code review comment"
=== modified file 'lib/lp/code/browser/sourcepackagerecipelisting.py'
--- lib/lp/code/browser/sourcepackagerecipelisting.py 2010-06-15 18:24:04 +0000
+++ lib/lp/code/browser/sourcepackagerecipelisting.py 2010-07-30 06:13:48 +0000
@@ -50,18 +50,13 @@
class BranchRecipeListingView(RecipeListingView):
- __used_for__ = IBranch
-
branch_enabled = False
class PersonRecipeListingView(RecipeListingView):
- __used_for__ = IPerson
-
owner_enabled = False
class ProductRecipeListingView(RecipeListingView):
-
- __used_for__ = IProduct
+ pass
=== modified file 'lib/lp/registry/browser/codeofconduct.py'
--- lib/lp/registry/browser/codeofconduct.py 2009-09-15 20:20:20 +0000
+++ lib/lp/registry/browser/codeofconduct.py 2010-07-30 06:13:48 +0000
@@ -35,6 +35,8 @@
ICodeOfConduct, ICodeOfConductConf, ICodeOfConductSet,
ISignedCodeOfConduct, ISignedCodeOfConductSet)
from lp.registry.interfaces.person import IPerson
+
+
class SignedCodeOfConductSetNavigation(GetitemNavigation):
usedfor = ISignedCodeOfConductSet
@@ -183,8 +185,6 @@
class SignedCodeOfConductAckView(AddView):
"""Acknowledge a Paper Submitted CoC."""
- __used_for__ = ICodeOfConduct
-
def __init__(self, context, request):
self.context = context
self.request = request
@@ -261,8 +261,6 @@
* set active.
"""
- __used_for__ = ISignedCodeOfConduct
-
def __init__(self, context, request):
self.context = context
self.request = request
@@ -304,8 +302,6 @@
* clear active.
"""
- __used_for__ = ISignedCodeOfConduct
-
def __init__(self, context, request):
self.context = context
self.request = request
=== modified file 'lib/lp/registry/browser/product.py'
--- lib/lp/registry/browser/product.py 2010-07-09 10:22:32 +0000
+++ lib/lp/registry/browser/product.py 2010-07-30 06:13:48 +0000
@@ -857,7 +857,6 @@
class ProductView(HasAnnouncementsView, SortSeriesMixin, FeedsMixin,
ProductDownloadFileMixin, UsesLaunchpadMixin):
- __used_for__ = IProduct
implements(IProductActionMenu, IEditableContextTitle)
def __init__(self, context, request):
@@ -1187,7 +1186,6 @@
SortSeriesMixin,
ProductDownloadFileMixin):
"""View class for the product's file downloads page."""
- __used_for__ = IProduct
batch_size = config.launchpad.download_batch_size
=== modified file 'lib/lp/registry/browser/productrelease.py'
--- lib/lp/registry/browser/productrelease.py 2010-01-22 03:17:00 +0000
+++ lib/lp/registry/browser/productrelease.py 2010-07-30 06:13:48 +0000
@@ -333,7 +333,6 @@
class ProductReleaseView(LaunchpadView, ProductDownloadFileMixin):
"""View for ProductRelease overview."""
- __used_for__ = IProductRelease
def initialize(self):
self.form = self.request.form
=== modified file 'lib/lp/soyuz/browser/archive.py'
--- lib/lp/soyuz/browser/archive.py 2010-07-20 10:25:51 +0000
+++ lib/lp/soyuz/browser/archive.py 2010-07-30 06:13:48 +0000
@@ -807,7 +807,6 @@
Implements useful actions and collects useful sets for the page template.
"""
- __used_for__ = IArchive
implements(IArchiveIndexActionsMenu)
def initialize(self):
@@ -1819,8 +1818,6 @@
class ArchiveBuildsView(ArchiveViewBase, BuildRecordsView):
"""Build Records View for IArchive."""
- __used_for__ = IHasBuildRecords
-
# The archive builds view presents all package builds (binary
# or source package recipe builds).
binary_only = False
=== modified file 'lib/lp/soyuz/browser/build.py'
--- lib/lp/soyuz/browser/build.py 2010-06-16 13:37:42 +0000
+++ lib/lp/soyuz/browser/build.py 2010-07-30 06:13:48 +0000
@@ -143,7 +143,6 @@
class BuildView(LaunchpadView):
"""Auxiliary view class for IBinaryPackageBuild"""
- __used_for__ = IBinaryPackageBuild
@property
def label(self):
@@ -234,8 +233,6 @@
class BuildRetryView(BuildView):
"""View class for retrying `IBinaryPackageBuild`s"""
- __used_for__ = IBinaryPackageBuild
-
@property
def label(self):
return 'Retry %s' % self.context.title
@@ -348,7 +345,6 @@
template/builds-list.pt and callsite details in Builder, Distribution,
DistroSeries, DistroArchSeries and SourcePackage view classes.
"""
- __used_for__ = IHasBuildRecords
page_title = 'Builds'
=== modified file 'lib/lp/soyuz/browser/builder.py'
--- lib/lp/soyuz/browser/builder.py 2010-06-16 13:37:42 +0000
+++ lib/lp/soyuz/browser/builder.py 2010-07-30 06:13:48 +0000
@@ -118,7 +118,6 @@
class BuilderSetView(LaunchpadView):
"""Default BuilderSet view class."""
- __used_for__ = IBuilderSet
@property
def label(self):
@@ -235,7 +234,6 @@
Implements useful actions for the page template.
"""
- __used_for__ = IBuilder
@property
def current_build_duration(self):
@@ -262,8 +260,6 @@
class BuilderHistoryView(BuildRecordsView):
"""This class exists only to override the page_title."""
- __used_for__ = IBuilder
-
page_title = 'Build history'
binary_only = False
=== modified file 'lib/lp/soyuz/browser/publishing.py'
--- lib/lp/soyuz/browser/publishing.py 2010-05-14 08:45:43 +0000
+++ lib/lp/soyuz/browser/publishing.py 2010-07-30 06:13:48 +0000
@@ -194,7 +194,6 @@
class SourcePublishingRecordView(BasePublishingRecordView):
"""View class for `ISourcePackagePublishingHistory`."""
- __used_for__ = ISourcePackagePublishingHistory
@cachedproperty
def build_status_summary(self):
@@ -354,7 +353,6 @@
class BinaryPublishingRecordView(BasePublishingRecordView):
"""View class for `IBinaryPackagePublishingHistory`."""
- __used_for__ = IBinaryPackagePublishingHistory
def wasCopied(self):
"""Whether or not a binary is published in its original location.
=== modified file 'lib/lp/soyuz/browser/queue.py'
--- lib/lp/soyuz/browser/queue.py 2010-03-17 02:25:13 +0000
+++ lib/lp/soyuz/browser/queue.py 2010-07-30 06:13:48 +0000
@@ -47,7 +47,6 @@
template/distroseries-queue.pt and callsite details in DistroSeries
view classes.
"""
- __used_for__ = IHasQueueItems
def setupQueueList(self):
"""Setup a batched queue list.
=== modified file 'lib/lp/soyuz/browser/sourceslist.py'
--- lib/lp/soyuz/browser/sourceslist.py 2009-09-07 14:54:34 +0000
+++ lib/lp/soyuz/browser/sourceslist.py 2010-07-30 06:13:48 +0000
@@ -31,7 +31,6 @@
class SourcesListEntriesView(LaunchpadView):
"""Renders sources.list entries with a Javascript menu."""
- __used_for__ = SourcesListEntries
template = ViewPageTemplateFile('../templates/sources-list-entries.pt')
def __init__(self, context, request, initially_without_selection=False,
=== modified file 'lib/lp/translations/browser/product.py'
--- lib/lp/translations/browser/product.py 2010-02-17 09:33:38 +0000
+++ lib/lp/translations/browser/product.py 2010-07-30 06:13:48 +0000
@@ -82,8 +82,6 @@
class ProductView(LaunchpadView):
- __used_for__ = IProduct
-
label = "Translation overview"
@cachedproperty