Merge lp:~mwhudson/launchpad/no-more-__used_for__ into lp:launchpad

Proposed by Michael Hudson-Doyle
Status: Merged
Approved by: Jonathan Lange
Approved revision: no longer in the source branch.
Merged at revision: 11290
Proposed branch: lp:~mwhudson/launchpad/no-more-__used_for__
Merge into: lp:launchpad
Diff against target: 527 lines (+4/-80)
26 files modified
lib/canonical/launchpad/browser/librarian.py (+0/-6)
lib/canonical/launchpad/webapp/tales.py (+0/-3)
lib/canonical/lazr/doc/menus.txt (+0/-5)
lib/lp/answers/browser/faq.py (+0/-2)
lib/lp/blueprints/browser/specification.py (+0/-4)
lib/lp/blueprints/browser/sprint.py (+1/-3)
lib/lp/blueprints/interfaces/specificationdependency.py (+0/-1)
lib/lp/bugs/browser/bugbranch.py (+0/-2)
lib/lp/bugs/browser/cve.py (+0/-2)
lib/lp/code/browser/branch.py (+0/-4)
lib/lp/code/browser/branchlisting.py (+0/-4)
lib/lp/code/browser/branchmergeproposal.py (+0/-7)
lib/lp/code/browser/codeimport.py (+0/-2)
lib/lp/code/browser/codeimportmachine.py (+0/-2)
lib/lp/code/browser/codereviewcomment.py (+0/-1)
lib/lp/code/browser/sourcepackagerecipelisting.py (+1/-6)
lib/lp/registry/browser/codeofconduct.py (+2/-6)
lib/lp/registry/browser/product.py (+0/-2)
lib/lp/registry/browser/productrelease.py (+0/-1)
lib/lp/soyuz/browser/archive.py (+0/-3)
lib/lp/soyuz/browser/build.py (+0/-4)
lib/lp/soyuz/browser/builder.py (+0/-4)
lib/lp/soyuz/browser/publishing.py (+0/-2)
lib/lp/soyuz/browser/queue.py (+0/-1)
lib/lp/soyuz/browser/sourceslist.py (+0/-1)
lib/lp/translations/browser/product.py (+0/-2)
To merge this branch: bzr merge lp:~mwhudson/launchpad/no-more-__used_for__
Reviewer Review Type Date Requested Status
Jonathan Lange (community) Approve
Review via email: mp+31351@code.launchpad.net

Commit message

Remove the no longer relevant __used_for__ attribute from some view classes

Description of the change

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

To post a comment you must log in.
Revision history for this message
Jonathan Lange (jml) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/canonical/launchpad/browser/librarian.py'
2--- lib/canonical/launchpad/browser/librarian.py 2010-03-26 19:19:49 +0000
3+++ lib/canonical/launchpad/browser/librarian.py 2010-08-04 04:11:08 +0000
4@@ -46,8 +46,6 @@
5 http://launchpad.net/firefox/1.0./1.0.0/+download/firefox-1.0.0.tgz.
6 """
7
8- __used_for__ = ILibraryFileAlias
9-
10 def initialize(self):
11 """Redirect the request to the URL of the file in the Librarian."""
12 # Redirect based on the scheme of the request, as set by Apache in the
13@@ -65,8 +63,6 @@
14 class LibraryFileAliasMD5View(LaunchpadView):
15 """View to show the MD5 digest for a librarian file."""
16
17- __used_for__ = ILibraryFileAlias
18-
19 def render(self):
20 """Return the plain text MD5 signature"""
21 self.request.response.setHeader('Content-type', 'text/plain')
22@@ -81,8 +77,6 @@
23 """
24 implements(IBrowserPublisher)
25
26- __used_for__ = ILibraryFileAlias
27-
28 def getFileContents(self):
29 # Reset system proxy setting if it exists. The urllib2 default
30 # opener is cached that's why it has to be re-installed after
31
32=== modified file 'lib/canonical/launchpad/webapp/tales.py'
33--- lib/canonical/launchpad/webapp/tales.py 2010-06-08 15:57:09 +0000
34+++ lib/canonical/launchpad/webapp/tales.py 2010-08-04 04:11:08 +0000
35@@ -290,7 +290,6 @@
36
37 """
38 implements(ITraversable)
39- __used_for__ = IBrowserApplicationRequest
40
41 def __init__(self, request):
42 self.form = request.form
43@@ -340,8 +339,6 @@
44 """Adapter from IApplicationRequest to IRequestAPI."""
45 implements(IRequestAPI)
46
47- __used_for__ = IApplicationRequest
48-
49 def __init__(self, request):
50 self.request = request
51
52
53=== modified file 'lib/canonical/lazr/doc/menus.txt'
54--- lib/canonical/lazr/doc/menus.txt 2010-02-23 13:36:51 +0000
55+++ lib/canonical/lazr/doc/menus.txt 2010-08-04 04:11:08 +0000
56@@ -105,26 +105,21 @@
57
58 >>> class RecipeIndexView(LaunchpadView):
59 ... """View for summary of a recipe on the cookery facet."""
60- ... __used_for__ = IRecipe
61
62 >>> class RecipeEditInstructionsView(LaunchpadView):
63 ... """View for editing recipe instructions on the cookery facet."""
64- ... __used_for__ = IRecipe
65 ... implements(IRecipeEditMenuMarker)
66
67 >>> class RecipeEditIngredientsView(LaunchpadView):
68 ... """View for editing recipe ingedients on the cookery facet."""
69- ... __used_for__ = IRecipe
70 ... implements(IRecipeEditMenuMarker)
71
72 >>> class RecipeReadJournalView(LaunchpadView):
73 ... """View for reading a recipe's journal on the cookery facet."""
74- ... __used_for__ = IRecipe
75 ... implements(IRecipeJournalMenuMarker)
76
77 >>> class RecipeQuestionsAllView(LaunchpadView):
78 ... """View for all questions of a recipe on the questions facet."""
79- ... __used_for__ = IRecipe
80
81 # Monkey patch the interfaces and views into the cookingexample module.
82 >>> cookingexample.IRecipeEditMenuMarker = IRecipeEditMenuMarker
83
84=== modified file 'lib/lp/answers/browser/faq.py'
85--- lib/lp/answers/browser/faq.py 2009-10-31 15:04:48 +0000
86+++ lib/lp/answers/browser/faq.py 2010-08-04 04:11:08 +0000
87@@ -57,8 +57,6 @@
88 class FAQView(LaunchpadView):
89 """View for the FAQ index."""
90
91- __used_for__ = IFAQ
92-
93 @property
94 def label(self):
95 return self.context.title
96
97=== modified file 'lib/lp/blueprints/browser/specification.py'
98--- lib/lp/blueprints/browser/specification.py 2009-11-11 15:54:20 +0000
99+++ lib/lp/blueprints/browser/specification.py 2010-08-04 04:11:08 +0000
100@@ -424,8 +424,6 @@
101 class SpecificationSimpleView(LaunchpadView):
102 """Used to render portlets and listing items that need browser code."""
103
104- __used_for__ = ISpecification
105-
106 @cachedproperty
107 def feedbackrequests(self):
108 if self.user is None:
109@@ -457,8 +455,6 @@
110 class SpecificationView(SpecificationSimpleView):
111 """Used to render the main view of a specification."""
112
113- __used_for__ = ISpecification
114-
115 @property
116 def label(self):
117 return self.context.title
118
119=== modified file 'lib/lp/blueprints/browser/sprint.py'
120--- lib/lp/blueprints/browser/sprint.py 2009-11-09 04:24:09 +0000
121+++ lib/lp/blueprints/browser/sprint.py 2010-08-04 04:11:08 +0000
122@@ -140,8 +140,6 @@
123
124 class SprintView(HasSpecificationsView, LaunchpadView):
125
126- __used_for__ = ISprint
127-
128 implements(IMajorHeadingView)
129
130 # XXX Michael Nelson 20090923 bug=435255
131@@ -149,7 +147,7 @@
132 # a second h1 to display. But as this view implements IMajorHeadingView
133 # it should not include an h1 below the app buttons.
134 label = None
135-
136+
137 @property
138 def page_title(self):
139 return '%s (sprint or meeting)' % self.context.title
140
141=== modified file 'lib/lp/blueprints/interfaces/specificationdependency.py'
142--- lib/lp/blueprints/interfaces/specificationdependency.py 2009-06-25 00:00:26 +0000
143+++ lib/lp/blueprints/interfaces/specificationdependency.py 2010-08-04 04:11:08 +0000
144@@ -46,7 +46,6 @@
145
146 class SpecDependencyIsAlsoRemoval:
147 implements(ISpecificationDependencyRemoval)
148- __used_for__ = ISpecificationDependency
149
150 def __init__(self, specdep):
151 self.specdep = specdep
152
153=== modified file 'lib/lp/bugs/browser/bugbranch.py'
154--- lib/lp/bugs/browser/bugbranch.py 2009-11-14 10:03:57 +0000
155+++ lib/lp/bugs/browser/bugbranch.py 2010-08-04 04:11:08 +0000
156@@ -95,8 +95,6 @@
157 class BugBranchView(LaunchpadView):
158 """Simple view to cache related branch information."""
159
160- __used_for__ = IBugBranch
161-
162 @cachedproperty
163 def merge_proposals(self):
164 """Return a list of active proposals for the branch."""
165
166=== modified file 'lib/lp/bugs/browser/cve.py'
167--- lib/lp/bugs/browser/cve.py 2010-05-21 13:45:56 +0000
168+++ lib/lp/bugs/browser/cve.py 2010-08-04 04:11:08 +0000
169@@ -116,8 +116,6 @@
170
171 class CveSetView:
172
173- __used_for__ = ICveSet
174-
175 def __init__(self, context, request):
176 self.context = context
177 self.request = request
178
179=== modified file 'lib/lp/code/browser/branch.py'
180--- lib/lp/code/browser/branch.py 2010-08-02 02:51:42 +0000
181+++ lib/lp/code/browser/branch.py 2010-08-04 04:11:08 +0000
182@@ -326,8 +326,6 @@
183
184 class BranchView(LaunchpadView, FeedsMixin):
185
186- __used_for__ = IBranch
187-
188 feed_types = (
189 BranchFeedLink,
190 )
191@@ -1155,8 +1153,6 @@
192 class BranchMergeQueueView(LaunchpadView):
193 """The view used to render the merge queue for a branch."""
194
195- __used_for__ = IBranch
196-
197 @cachedproperty
198 def merge_queue(self):
199 """Get the merge queue and check visibility."""
200
201=== modified file 'lib/lp/code/browser/branchlisting.py'
202--- lib/lp/code/browser/branchlisting.py 2010-05-28 01:44:13 +0000
203+++ lib/lp/code/browser/branchlisting.py 2010-08-04 04:11:08 +0000
204@@ -1037,14 +1037,10 @@
205 class PersonCodeSummaryView(LaunchpadView):
206 """A view to render the code page summary for a person."""
207
208- __used_for__ = IPerson
209-
210
211 class PersonProductCodeSummaryView(PersonCodeSummaryView):
212 """A view to render the code page summary for a `PersonProduct`."""
213
214- __used_for__ = IPersonProduct
215-
216 @property
217 def person(self):
218 """Return the person from the context."""
219
220=== modified file 'lib/lp/code/browser/branchmergeproposal.py'
221--- lib/lp/code/browser/branchmergeproposal.py 2010-06-17 01:16:30 +0000
222+++ lib/lp/code/browser/branchmergeproposal.py 2010-08-04 04:11:08 +0000
223@@ -550,7 +550,6 @@
224 implements(IBranchMergeProposalActionMenu)
225
226 label = "Proposal to merge branch"
227- __used_for__ = IBranchMergeProposal
228 schema = ClaimButton
229
230 @action('Claim', name='claim')
231@@ -782,8 +781,6 @@
232 class BranchMergeProposalVoteView(LaunchpadView):
233 """The view used for the tables of votes and requested reviews."""
234
235- __used_for__ = IBranchMergeProposal
236-
237 @property
238 def show_table(self):
239 """Should the reviewer table be shown at all?
240@@ -1238,8 +1235,6 @@
241 class BranchMergeProposalSubscribersView(LaunchpadView):
242 """Used to show the pagelet subscribers on the main proposal page."""
243
244- __used_for__ = IBranchMergeProposal
245-
246 def initialize(self):
247 """See `LaunchpadView`."""
248 # Get the subscribers and dump them into two sets.
249@@ -1451,8 +1446,6 @@
250 class FormatPreviewDiffView(LaunchpadView, DiffRenderingMixin):
251 """A simple view to render a diff formatted nicely."""
252
253- __used_for__ = IPreviewDiff
254-
255 @property
256 def preview_diff(self):
257 return self.context
258
259=== modified file 'lib/lp/code/browser/codeimport.py'
260--- lib/lp/code/browser/codeimport.py 2010-08-02 03:12:02 +0000
261+++ lib/lp/code/browser/codeimport.py 2010-08-04 04:11:08 +0000
262@@ -595,8 +595,6 @@
263 class CodeImportMachineView(LaunchpadView):
264 """The view for the page that shows all the import machines."""
265
266- __used_for__ = ICodeImportSet
267-
268 label = "Import machines for Launchpad"
269
270 @property
271
272=== modified file 'lib/lp/code/browser/codeimportmachine.py'
273--- lib/lp/code/browser/codeimportmachine.py 2010-04-23 03:36:24 +0000
274+++ lib/lp/code/browser/codeimportmachine.py 2010-08-04 04:11:08 +0000
275@@ -56,8 +56,6 @@
276 class CodeImportMachineSetView(LaunchpadView):
277 """The view for the page that shows all the import machines."""
278
279- __used_for__ = ICodeImportMachineSet
280-
281 label = "Import machines for Launchpad"
282
283 @property
284
285=== modified file 'lib/lp/code/browser/codereviewcomment.py'
286--- lib/lp/code/browser/codereviewcomment.py 2010-02-19 19:16:32 +0000
287+++ lib/lp/code/browser/codereviewcomment.py 2010-08-04 04:11:08 +0000
288@@ -113,7 +113,6 @@
289
290 class CodeReviewCommentView(LaunchpadView):
291 """Standard view of a CodeReviewComment"""
292- __used_for__ = ICodeReviewComment
293
294 page_title = "Code review comment"
295
296
297=== modified file 'lib/lp/code/browser/sourcepackagerecipelisting.py'
298--- lib/lp/code/browser/sourcepackagerecipelisting.py 2010-06-15 18:24:04 +0000
299+++ lib/lp/code/browser/sourcepackagerecipelisting.py 2010-08-04 04:11:08 +0000
300@@ -50,18 +50,13 @@
301
302 class BranchRecipeListingView(RecipeListingView):
303
304- __used_for__ = IBranch
305-
306 branch_enabled = False
307
308
309 class PersonRecipeListingView(RecipeListingView):
310
311- __used_for__ = IPerson
312-
313 owner_enabled = False
314
315
316 class ProductRecipeListingView(RecipeListingView):
317-
318- __used_for__ = IProduct
319+ pass
320
321=== modified file 'lib/lp/registry/browser/codeofconduct.py'
322--- lib/lp/registry/browser/codeofconduct.py 2009-09-15 20:20:20 +0000
323+++ lib/lp/registry/browser/codeofconduct.py 2010-08-04 04:11:08 +0000
324@@ -35,6 +35,8 @@
325 ICodeOfConduct, ICodeOfConductConf, ICodeOfConductSet,
326 ISignedCodeOfConduct, ISignedCodeOfConductSet)
327 from lp.registry.interfaces.person import IPerson
328+
329+
330 class SignedCodeOfConductSetNavigation(GetitemNavigation):
331
332 usedfor = ISignedCodeOfConductSet
333@@ -183,8 +185,6 @@
334 class SignedCodeOfConductAckView(AddView):
335 """Acknowledge a Paper Submitted CoC."""
336
337- __used_for__ = ICodeOfConduct
338-
339 def __init__(self, context, request):
340 self.context = context
341 self.request = request
342@@ -261,8 +261,6 @@
343 * set active.
344 """
345
346- __used_for__ = ISignedCodeOfConduct
347-
348 def __init__(self, context, request):
349 self.context = context
350 self.request = request
351@@ -304,8 +302,6 @@
352 * clear active.
353 """
354
355- __used_for__ = ISignedCodeOfConduct
356-
357 def __init__(self, context, request):
358 self.context = context
359 self.request = request
360
361=== modified file 'lib/lp/registry/browser/product.py'
362--- lib/lp/registry/browser/product.py 2010-08-03 12:41:29 +0000
363+++ lib/lp/registry/browser/product.py 2010-08-04 04:11:08 +0000
364@@ -909,7 +909,6 @@
365 class ProductView(HasAnnouncementsView, SortSeriesMixin, FeedsMixin,
366 ProductDownloadFileMixin, UsesLaunchpadMixin):
367
368- __used_for__ = IProduct
369 implements(IProductActionMenu, IEditableContextTitle)
370
371 def __init__(self, context, request):
372@@ -1239,7 +1238,6 @@
373 SortSeriesMixin,
374 ProductDownloadFileMixin):
375 """View class for the product's file downloads page."""
376- __used_for__ = IProduct
377
378 batch_size = config.launchpad.download_batch_size
379
380
381=== modified file 'lib/lp/registry/browser/productrelease.py'
382--- lib/lp/registry/browser/productrelease.py 2010-01-22 03:17:00 +0000
383+++ lib/lp/registry/browser/productrelease.py 2010-08-04 04:11:08 +0000
384@@ -333,7 +333,6 @@
385
386 class ProductReleaseView(LaunchpadView, ProductDownloadFileMixin):
387 """View for ProductRelease overview."""
388- __used_for__ = IProductRelease
389
390 def initialize(self):
391 self.form = self.request.form
392
393=== modified file 'lib/lp/soyuz/browser/archive.py'
394--- lib/lp/soyuz/browser/archive.py 2010-08-02 02:13:52 +0000
395+++ lib/lp/soyuz/browser/archive.py 2010-08-04 04:11:08 +0000
396@@ -807,7 +807,6 @@
397 Implements useful actions and collects useful sets for the page template.
398 """
399
400- __used_for__ = IArchive
401 implements(IArchiveIndexActionsMenu)
402
403 def initialize(self):
404@@ -1819,8 +1818,6 @@
405 class ArchiveBuildsView(ArchiveViewBase, BuildRecordsView):
406 """Build Records View for IArchive."""
407
408- __used_for__ = IHasBuildRecords
409-
410 # The archive builds view presents all package builds (binary
411 # or source package recipe builds).
412 binary_only = False
413
414=== modified file 'lib/lp/soyuz/browser/build.py'
415--- lib/lp/soyuz/browser/build.py 2010-08-02 02:23:26 +0000
416+++ lib/lp/soyuz/browser/build.py 2010-08-04 04:11:08 +0000
417@@ -143,7 +143,6 @@
418
419 class BuildView(LaunchpadView):
420 """Auxiliary view class for IBinaryPackageBuild"""
421- __used_for__ = IBinaryPackageBuild
422
423 @property
424 def label(self):
425@@ -234,8 +233,6 @@
426 class BuildRetryView(BuildView):
427 """View class for retrying `IBinaryPackageBuild`s"""
428
429- __used_for__ = IBinaryPackageBuild
430-
431 @property
432 def label(self):
433 return 'Retry %s' % self.context.title
434@@ -348,7 +345,6 @@
435 template/builds-list.pt and callsite details in Builder, Distribution,
436 DistroSeries, DistroArchSeries and SourcePackage view classes.
437 """
438- __used_for__ = IHasBuildRecords
439
440 page_title = 'Builds'
441
442
443=== modified file 'lib/lp/soyuz/browser/builder.py'
444--- lib/lp/soyuz/browser/builder.py 2010-08-02 02:13:52 +0000
445+++ lib/lp/soyuz/browser/builder.py 2010-08-04 04:11:08 +0000
446@@ -118,7 +118,6 @@
447
448 class BuilderSetView(LaunchpadView):
449 """Default BuilderSet view class."""
450- __used_for__ = IBuilderSet
451
452 @property
453 def label(self):
454@@ -235,7 +234,6 @@
455
456 Implements useful actions for the page template.
457 """
458- __used_for__ = IBuilder
459
460 @property
461 def current_build_duration(self):
462@@ -262,8 +260,6 @@
463 class BuilderHistoryView(BuildRecordsView):
464 """This class exists only to override the page_title."""
465
466- __used_for__ = IBuilder
467-
468 page_title = 'Build history'
469 binary_only = False
470
471
472=== modified file 'lib/lp/soyuz/browser/publishing.py'
473--- lib/lp/soyuz/browser/publishing.py 2010-05-14 08:45:43 +0000
474+++ lib/lp/soyuz/browser/publishing.py 2010-08-04 04:11:08 +0000
475@@ -194,7 +194,6 @@
476
477 class SourcePublishingRecordView(BasePublishingRecordView):
478 """View class for `ISourcePackagePublishingHistory`."""
479- __used_for__ = ISourcePackagePublishingHistory
480
481 @cachedproperty
482 def build_status_summary(self):
483@@ -354,7 +353,6 @@
484
485 class BinaryPublishingRecordView(BasePublishingRecordView):
486 """View class for `IBinaryPackagePublishingHistory`."""
487- __used_for__ = IBinaryPackagePublishingHistory
488
489 def wasCopied(self):
490 """Whether or not a binary is published in its original location.
491
492=== modified file 'lib/lp/soyuz/browser/queue.py'
493--- lib/lp/soyuz/browser/queue.py 2010-08-02 02:13:52 +0000
494+++ lib/lp/soyuz/browser/queue.py 2010-08-04 04:11:08 +0000
495@@ -46,7 +46,6 @@
496 template/distroseries-queue.pt and callsite details in DistroSeries
497 view classes.
498 """
499- __used_for__ = IHasQueueItems
500
501 def setupQueueList(self):
502 """Setup a batched queue list.
503
504=== modified file 'lib/lp/soyuz/browser/sourceslist.py'
505--- lib/lp/soyuz/browser/sourceslist.py 2009-09-07 14:54:34 +0000
506+++ lib/lp/soyuz/browser/sourceslist.py 2010-08-04 04:11:08 +0000
507@@ -31,7 +31,6 @@
508 class SourcesListEntriesView(LaunchpadView):
509 """Renders sources.list entries with a Javascript menu."""
510
511- __used_for__ = SourcesListEntries
512 template = ViewPageTemplateFile('../templates/sources-list-entries.pt')
513
514 def __init__(self, context, request, initially_without_selection=False,
515
516=== modified file 'lib/lp/translations/browser/product.py'
517--- lib/lp/translations/browser/product.py 2010-02-17 09:33:38 +0000
518+++ lib/lp/translations/browser/product.py 2010-08-04 04:11:08 +0000
519@@ -82,8 +82,6 @@
520
521 class ProductView(LaunchpadView):
522
523- __used_for__ = IProduct
524-
525 label = "Translation overview"
526
527 @cachedproperty