Merge lp:~mwhudson/launchpad/kill-launchbag.site into lp:launchpad

Proposed by Michael Hudson-Doyle
Status: Merged
Approved by: Tim Penhey
Approved revision: no longer in the source branch.
Merged at revision: 11259
Proposed branch: lp:~mwhudson/launchpad/kill-launchbag.site
Merge into: lp:launchpad
Diff against target: 62 lines (+2/-14)
3 files modified
lib/canonical/launchpad/webapp/interfaces.py (+0/-1)
lib/canonical/launchpad/webapp/launchbag.py (+1/-6)
lib/canonical/launchpad/webapp/publication.py (+1/-7)
To merge this branch: bzr merge lp:~mwhudson/launchpad/kill-launchbag.site
Reviewer Review Type Date Requested Status
Tim Penhey (community) Approve
Review via email: mp+31348@code.launchpad.net

Commit message

Remove the unused ILaunchBag['site'] attribute

Description of the change

Hi,

This branch removes the caching of the root object in the LaunchBag. Nothing seems to use it -- I've run the tests through ec2 and they passed.

Cheers,
mwh

To post a comment you must log in.
Revision history for this message
Tim Penhey (thumper) :
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/webapp/interfaces.py'
2--- lib/canonical/launchpad/webapp/interfaces.py 2010-07-21 08:15:57 +0000
3+++ lib/canonical/launchpad/webapp/interfaces.py 2010-07-30 04:08:46 +0000
4@@ -304,7 +304,6 @@
5 # is very Launchpad-specific. I suggest we split the interface and
6 # implementation into two parts, having a different name for the webapp/ bits.
7 class ILaunchBag(Interface):
8- site = Attribute('The application object, or None')
9 person = Attribute('IPerson, or None')
10 project = Attribute('IProjectGroup, or None')
11 product = Attribute('IProduct, or None')
12
13=== modified file 'lib/canonical/launchpad/webapp/launchbag.py'
14--- lib/canonical/launchpad/webapp/launchbag.py 2010-07-09 12:07:59 +0000
15+++ lib/canonical/launchpad/webapp/launchbag.py 2010-07-30 04:08:46 +0000
16@@ -21,7 +21,7 @@
17 ISpecification, IBugTask, ILaunchpadCelebrities)
18 from canonical.launchpad.webapp.interaction import get_current_principal
19 from canonical.launchpad.webapp.interfaces import (
20- ILaunchBag, ILaunchpadApplication, ILoggedInEvent, IOpenLaunchBag)
21+ ILaunchBag, ILoggedInEvent, IOpenLaunchBag)
22
23 _utc_tz = pytz.timezone('UTC')
24
25@@ -32,7 +32,6 @@
26
27 # Map Interface to attribute name.
28 _registry = {
29- ILaunchpadApplication: 'site',
30 IPerson: 'person',
31 IProjectGroup: 'project',
32 IProduct: 'product',
33@@ -87,10 +86,6 @@
34 store.time_zone = None
35
36 @property
37- def site(self):
38- return self._store.site
39-
40- @property
41 def person(self):
42 return self._store.person
43
44
45=== modified file 'lib/canonical/launchpad/webapp/publication.py'
46--- lib/canonical/launchpad/webapp/publication.py 2010-07-21 21:03:59 +0000
47+++ lib/canonical/launchpad/webapp/publication.py 2010-07-30 04:08:46 +0000
48@@ -118,13 +118,7 @@
49 if end_of_traversal_stack == ['+login']:
50 return LoginRoot()
51 else:
52- bag = getUtility(IOpenLaunchBag)
53- if bag.site is None:
54- root_object = getUtility(self.root_object_interface)
55- bag.add(root_object)
56- else:
57- root_object = bag.site
58- return root_object
59+ return getUtility(self.root_object_interface)
60
61 # The below overrides to zopepublication (callTraversalHooks,
62 # afterTraversal, and _maybePlacefullyAuthenticate) make the