Merge lp:~allenap/launchpad/cache-experiment-roll-out into lp:launchpad
- cache-experiment-roll-out
- Merge into devel
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Robert Collins | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 11495 | ||||
Proposed branch: | lp:~allenap/launchpad/cache-experiment-roll-out | ||||
Merge into: | lp:launchpad | ||||
Prerequisite: | lp:~allenap/launchpad/cache-experiment | ||||
Diff against target: |
2880 lines (+248/-457) 114 files modified
.ctags (+3/-0) lib/canonical/cachedproperty.py (+0/-229) lib/canonical/database/sqlbase.py (+0/-6) lib/canonical/launchpad/browser/launchpad.py (+1/-1) lib/canonical/launchpad/utilities/geoip.py (+1/-1) lib/canonical/launchpad/webapp/error.py (+1/-1) lib/canonical/launchpad/webapp/login.py (+1/-1) lib/canonical/launchpad/webapp/servers.py (+1/-1) lib/canonical/lazr/feed/feed.py (+17/-8) lib/canonical/tests/test_cachedproperty.py (+0/-15) lib/canonical/widgets/popup.py (+8/-7) lib/lp/answers/browser/faqcollection.py (+1/-1) lib/lp/answers/browser/question.py (+1/-1) lib/lp/answers/browser/questiontarget.py (+3/-3) lib/lp/answers/notification.py (+1/-1) lib/lp/app/browser/root.py (+1/-1) lib/lp/archivepublisher/diskpool.py (+1/-1) lib/lp/blueprints/browser/specification.py (+1/-1) lib/lp/blueprints/browser/specificationgoal.py (+1/-1) lib/lp/blueprints/browser/specificationtarget.py (+1/-1) lib/lp/blueprints/browser/sprint.py (+1/-1) lib/lp/bugs/browser/bug.py (+1/-1) lib/lp/bugs/browser/bugalsoaffects.py (+1/-1) lib/lp/bugs/browser/bugbranch.py (+1/-1) lib/lp/bugs/browser/bugtarget.py (+1/-1) lib/lp/bugs/browser/bugtask.py (+1/-1) lib/lp/bugs/browser/bugtracker.py (+1/-1) lib/lp/bugs/browser/cvereport.py (+1/-1) lib/lp/bugs/browser/distribution_upstream_bug_report.py (+1/-1) lib/lp/bugs/doc/externalbugtracker-mantis-csv.txt (+3/-1) lib/lp/bugs/externalbugtracker/mantis.py (+1/-1) lib/lp/bugs/externalbugtracker/rt.py (+1/-1) lib/lp/bugs/model/bug.py (+13/-12) lib/lp/bugs/model/bugattachment.py (+3/-3) lib/lp/bugs/model/bugtask.py (+2/-2) lib/lp/bugs/tests/externalbugtracker.py (+0/-8) lib/lp/buildmaster/model/builder.py (+1/-1) lib/lp/code/browser/bazaar.py (+1/-1) lib/lp/code/browser/branch.py (+1/-1) lib/lp/code/browser/branchlisting.py (+1/-1) lib/lp/code/browser/branchmergeproposal.py (+1/-1) lib/lp/code/browser/branchmergeproposallisting.py (+1/-1) lib/lp/code/browser/branchvisibilitypolicy.py (+1/-1) lib/lp/code/browser/codeimport.py (+1/-1) lib/lp/code/browser/codeimportmachine.py (+1/-1) lib/lp/code/browser/codereviewcomment.py (+1/-1) lib/lp/code/browser/decorations.py (+1/-1) lib/lp/code/browser/summary.py (+1/-1) lib/lp/code/feed/branch.py (+1/-1) lib/lp/code/model/branchvisibilitypolicy.py (+1/-1) lib/lp/codehosting/codeimport/worker.py (+1/-1) lib/lp/codehosting/puller/scheduler.py (+1/-1) lib/lp/hardwaredb/scripts/hwdbsubmissions.py (+1/-1) lib/lp/registry/browser/__init__.py (+1/-1) lib/lp/registry/browser/announcement.py (+1/-1) lib/lp/registry/browser/distribution.py (+2/-4) lib/lp/registry/browser/distributionmirror.py (+1/-1) lib/lp/registry/browser/distributionsourcepackage.py (+4/-3) lib/lp/registry/browser/distroseries.py (+1/-1) lib/lp/registry/browser/karma.py (+1/-1) lib/lp/registry/browser/mailinglists.py (+1/-1) lib/lp/registry/browser/milestone.py (+1/-1) lib/lp/registry/browser/person.py (+6/-6) lib/lp/registry/browser/pillar.py (+1/-1) lib/lp/registry/browser/product.py (+3/-3) lib/lp/registry/browser/productseries.py (+1/-1) lib/lp/registry/browser/project.py (+1/-1) lib/lp/registry/browser/structuralsubscription.py (+1/-1) lib/lp/registry/browser/team.py (+1/-1) lib/lp/registry/model/distribution.py (+5/-8) lib/lp/registry/model/distroseries.py (+3/-5) lib/lp/registry/model/mailinglist.py (+1/-1) lib/lp/registry/model/person.py (+4/-22) lib/lp/registry/model/product.py (+6/-3) lib/lp/registry/vocabularies.py (+1/-1) lib/lp/services/mailman/doc/staging.txt (+2/-1) lib/lp/services/openid/browser/openiddiscovery.py (+1/-1) lib/lp/services/propertycache.py (+41/-0) lib/lp/services/salesforce/proxy.py (+1/-1) lib/lp/services/tests/test_doc.py (+4/-2) lib/lp/shipit.py (+4/-0) lib/lp/soyuz/browser/archive.py (+2/-4) lib/lp/soyuz/browser/archivesubscription.py (+1/-1) lib/lp/soyuz/browser/build.py (+2/-2) lib/lp/soyuz/browser/builder.py (+1/-1) lib/lp/soyuz/browser/distributionsourcepackagerelease.py (+2/-2) lib/lp/soyuz/browser/packagesearch.py (+1/-1) lib/lp/soyuz/browser/publishing.py (+1/-1) lib/lp/soyuz/model/archive.py (+1/-3) lib/lp/soyuz/model/distroarchseriesbinarypackage.py (+2/-2) lib/lp/soyuz/model/distroseriesbinarypackage.py (+6/-3) lib/lp/soyuz/model/queue.py (+1/-1) lib/lp/soyuz/model/sourcepackagerelease.py (+2/-4) lib/lp/soyuz/scripts/ppareport.py (+1/-1) lib/lp/soyuz/scripts/queue.py (+1/-1) lib/lp/testing/__init__.py (+7/-2) lib/lp/testopenid/browser/server.py (+7/-3) lib/lp/translations/browser/distribution.py (+1/-1) lib/lp/translations/browser/distroseries.py (+1/-1) lib/lp/translations/browser/hastranslationimports.py (+1/-1) lib/lp/translations/browser/language.py (+1/-1) lib/lp/translations/browser/person.py (+1/-1) lib/lp/translations/browser/poexportrequest.py (+1/-1) lib/lp/translations/browser/pofile.py (+1/-1) lib/lp/translations/browser/product.py (+1/-1) lib/lp/translations/browser/productseries.py (+1/-1) lib/lp/translations/browser/serieslanguage.py (+1/-1) lib/lp/translations/browser/translationmessage.py (+1/-1) lib/lp/translations/browser/translations.py (+1/-1) lib/lp/translations/model/pofile.py (+1/-1) lib/lp/translations/model/potemplate.py (+1/-1) lib/lp/translations/model/translationmessage.py (+1/-1) lib/lp/translations/utilities/translation_import.py (+1/-1) utilities/sourcedeps.conf (+1/-1) |
||||
To merge this branch: | bzr merge lp:~allenap/launchpad/cache-experiment-roll-out | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Graham Binns (community) | code | Approve | |
Robert Collins (community) | Approve | ||
Review via email: mp+33542@code.launchpad.net |
Commit message
Roll out the propertycache API everywhere, remove canonical.
Description of the change
This rolls out the propertycache API - see lp:~allenap/launchpad/cache-experiment - everywhere and removes canonical.
It also provides hooks for shipit to import the propertycache bits it needs. See lp:~allenap/shipit/shipit-use-propertycache for the other side of that deal. Once the shipit branch has landed, utilities/
Gavin Panella (allenap) wrote : | # |
1 | === removed file 'lib/canonical/cachedproperty.py' | |||
2 | --- lib/canonical/cachedproperty.py 2010-08-17 07:03:25 +0000 | |||
3 | +++ lib/canonical/cachedproperty.py 1970-01-01 00:00:00 +0000 | |||
4 | @@ -1,229 +0,0 @@ | |||
5 | 1 | # Copyright 2009 Canonical Ltd. This software is licensed under the | ||
6 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | ||
7 | 3 | |||
8 | 4 | """Cached properties for situations where a property is computed once and | ||
9 | 5 | then returned each time it is asked for. | ||
10 | 6 | |||
11 | 7 | The clear_cachedproperties function can be used to wipe the cache of properties | ||
12 | 8 | from an instance. | ||
13 | 9 | """ | ||
14 | 10 | |||
15 | 11 | __metaclass__ = type | ||
16 | 12 | |||
17 | 13 | __all__ = [ | ||
18 | 14 | 'cache_property', | ||
19 | 15 | 'cachedproperty', | ||
20 | 16 | 'clear_cachedproperties', | ||
21 | 17 | 'clear_property', | ||
22 | 18 | ] | ||
23 | 19 | |||
24 | 20 | from zope.security.proxy import removeSecurityProxy | ||
25 | 21 | |||
26 | 22 | from canonical.lazr.utils import safe_hasattr | ||
27 | 23 | |||
28 | 24 | # XXX: JonathanLange 2010-01-11 bug=505731: Move this to lp.services. | ||
29 | 25 | |||
30 | 26 | def cachedproperty(attrname_or_fn): | ||
31 | 27 | """A decorator for methods that makes them properties with their return | ||
32 | 28 | value cached. | ||
33 | 29 | |||
34 | 30 | The value is cached on the instance, using the attribute name provided. | ||
35 | 31 | |||
36 | 32 | If you don't provide a name, the mangled name of the property is used. | ||
37 | 33 | |||
38 | 34 | cachedproperty is not threadsafe - it should not be used on objects which | ||
39 | 35 | are shared across threads / external locking should be used on those | ||
40 | 36 | objects. | ||
41 | 37 | |||
42 | 38 | >>> class CachedPropertyTest(object): | ||
43 | 39 | ... | ||
44 | 40 | ... @cachedproperty('_foo_cache') | ||
45 | 41 | ... def foo(self): | ||
46 | 42 | ... print 'foo computed' | ||
47 | 43 | ... return 23 | ||
48 | 44 | ... | ||
49 | 45 | ... @cachedproperty | ||
50 | 46 | ... def bar(self): | ||
51 | 47 | ... print 'bar computed' | ||
52 | 48 | ... return 69 | ||
53 | 49 | |||
54 | 50 | >>> cpt = CachedPropertyTest() | ||
55 | 51 | >>> getattr(cpt, '_foo_cache', None) is None | ||
56 | 52 | True | ||
57 | 53 | >>> cpt.foo | ||
58 | 54 | foo computed | ||
59 | 55 | 23 | ||
60 | 56 | >>> cpt.foo | ||
61 | 57 | 23 | ||
62 | 58 | >>> cpt._foo_cache | ||
63 | 59 | 23 | ||
64 | 60 | >>> cpt.bar | ||
65 | 61 | bar computed | ||
66 | 62 | 69 | ||
67 | 63 | >>> cpt._bar_cached_value | ||
68 | 64 | 69 | ||
69 | 65 | |||
70 | 66 | Cached properties are listed on instances. | ||
71 | 67 | >>> sorted(cpt._cached_properties) | ||
72 | 68 | ['_bar_cached_value', '_foo_cache'] | ||
73 | 69 | |||
74 | 70 | """ | ||
75 | 71 | if isinstance(attrname_or_fn, basestring): | ||
76 | 72 | attrname = attrname_or_fn | ||
77 | 73 | return CachedPropertyForAttr(attrname) | ||
78 | 74 | else: | ||
79 | 75 | fn = attrname_or_fn | ||
80 | 76 | attrname = '_%s_cached_value' % fn.__name__ | ||
81 | 77 | return CachedProperty(attrname, fn) | ||
82 | 78 | |||
83 | 79 | def cache_property(instance, attrname, value): | ||
84 | 80 | """Cache value on instance as attrname. | ||
85 | 81 | |||
86 | 82 | instance._cached_properties is updated with attrname. | ||
87 | 83 | |||
88 | 84 | >>> class CachedPropertyTest(object): | ||
89 | 85 | ... | ||
90 | 86 | ... @cachedproperty('_foo_cache') | ||
91 | 87 | ... def foo(self): | ||
92 | 88 | ... return 23 | ||
93 | 89 | ... | ||
94 | 90 | >>> instance = CachedPropertyTest() | ||
95 | 91 | >>> cache_property(instance, '_foo_cache', 42) | ||
96 | 92 | >>> instance.foo | ||
97 | 93 | 42 | ||
98 | 94 | >>> instance._cached_properties | ||
99 | 95 | ['_foo_cache'] | ||
100 | 96 | |||
101 | 97 | Caching a new value does not duplicate the cache keys. | ||
102 | 98 | |||
103 | 99 | >>> cache_property(instance, '_foo_cache', 84) | ||
104 | 100 | >>> instance._cached_properties | ||
105 | 101 | ['_foo_cache'] | ||
106 | 102 | |||
107 | 103 | And does update the cached value. | ||
108 | 104 | |||
109 | 105 | >>> instance.foo | ||
110 | 106 | 84 | ||
111 | 107 | """ | ||
112 | 108 | naked_instance = removeSecurityProxy(instance) | ||
113 | 109 | clear_property(naked_instance, attrname) | ||
114 | 110 | setattr(naked_instance, attrname, value) | ||
115 | 111 | cached_properties = getattr(naked_instance, '_cached_properties', []) | ||
116 | 112 | cached_properties.append(attrname) | ||
117 | 113 | naked_instance._cached_properties = cached_properties | ||
118 | 114 | |||
119 | 115 | |||
120 | 116 | def clear_property(instance, attrname): | ||
121 | 117 | """Remove a cached attribute from instance. | ||
122 | 118 | |||
123 | 119 | The attribute name is removed from instance._cached_properties. | ||
124 | 120 | |||
125 | 121 | If the property is not cached, nothing happens. | ||
126 | 122 | |||
127 | 123 | :seealso clear_cachedproperties: For clearing all cached items at once. | ||
128 | 124 | |||
129 | 125 | >>> class CachedPropertyTest(object): | ||
130 | 126 | ... | ||
131 | 127 | ... @cachedproperty('_foo_cache') | ||
132 | 128 | ... def foo(self): | ||
133 | 129 | ... return 23 | ||
134 | 130 | ... | ||
135 | 131 | >>> instance = CachedPropertyTest() | ||
136 | 132 | >>> instance.foo | ||
137 | 133 | 23 | ||
138 | 134 | >>> clear_property(instance, '_foo_cache') | ||
139 | 135 | >>> instance._cached_properties | ||
140 | 136 | [] | ||
141 | 137 | >>> is_cached(instance, '_foo_cache') | ||
142 | 138 | False | ||
143 | 139 | >>> clear_property(instance, '_foo_cache') | ||
144 | 140 | """ | ||
145 | 141 | naked_instance = removeSecurityProxy(instance) | ||
146 | 142 | if not is_cached(naked_instance, attrname): | ||
147 | 143 | return | ||
148 | 144 | delattr(naked_instance, attrname) | ||
149 | 145 | naked_instance._cached_properties.remove(attrname) | ||
150 | 146 | |||
151 | 147 | |||
152 | 148 | def clear_cachedproperties(instance): | ||
153 | 149 | """Clear cached properties from an object. | ||
154 | 150 | |||
155 | 151 | >>> class CachedPropertyTest(object): | ||
156 | 152 | ... | ||
157 | 153 | ... @cachedproperty('_foo_cache') | ||
158 | 154 | ... def foo(self): | ||
159 | 155 | ... return 23 | ||
160 | 156 | ... | ||
161 | 157 | >>> instance = CachedPropertyTest() | ||
162 | 158 | >>> instance.foo | ||
163 | 159 | 23 | ||
164 | 160 | >>> instance._cached_properties | ||
165 | 161 | ['_foo_cache'] | ||
166 | 162 | >>> clear_cachedproperties(instance) | ||
167 | 163 | >>> instance._cached_properties | ||
168 | 164 | [] | ||
169 | 165 | >>> hasattr(instance, '_foo_cache') | ||
170 | 166 | False | ||
171 | 167 | """ | ||
172 | 168 | naked_instance = removeSecurityProxy(instance) | ||
173 | 169 | cached_properties = getattr(naked_instance, '_cached_properties', []) | ||
174 | 170 | for property_name in cached_properties: | ||
175 | 171 | delattr(naked_instance, property_name) | ||
176 | 172 | naked_instance._cached_properties = [] | ||
177 | 173 | |||
178 | 174 | |||
179 | 175 | def is_cached(instance, attrname): | ||
180 | 176 | """Return True if attrname is cached on instance. | ||
181 | 177 | |||
182 | 178 | >>> class CachedPropertyTest(object): | ||
183 | 179 | ... | ||
184 | 180 | ... @cachedproperty('_foo_cache') | ||
185 | 181 | ... def foo(self): | ||
186 | 182 | ... return 23 | ||
187 | 183 | ... | ||
188 | 184 | >>> instance = CachedPropertyTest() | ||
189 | 185 | >>> instance.foo | ||
190 | 186 | 23 | ||
191 | 187 | >>> is_cached(instance, '_foo_cache') | ||
192 | 188 | True | ||
193 | 189 | >>> is_cached(instance, '_var_cache') | ||
194 | 190 | False | ||
195 | 191 | """ | ||
196 | 192 | naked_instance = removeSecurityProxy(instance) | ||
197 | 193 | return safe_hasattr(naked_instance, attrname) | ||
198 | 194 | |||
199 | 195 | |||
200 | 196 | class CachedPropertyForAttr: | ||
201 | 197 | """Curry a decorator to provide arguments to the CachedProperty.""" | ||
202 | 198 | |||
203 | 199 | def __init__(self, attrname): | ||
204 | 200 | self.attrname = attrname | ||
205 | 201 | |||
206 | 202 | def __call__(self, fn): | ||
207 | 203 | return CachedProperty(self.attrname, fn) | ||
208 | 204 | |||
209 | 205 | |||
210 | 206 | class CachedProperty: | ||
211 | 207 | |||
212 | 208 | # Used to detect not-yet-cached properties. | ||
213 | 209 | sentinel = object() | ||
214 | 210 | |||
215 | 211 | def __init__(self, attrname, fn): | ||
216 | 212 | self.fn = fn | ||
217 | 213 | self.attrname = attrname | ||
218 | 214 | |||
219 | 215 | def __get__(self, inst, cls=None): | ||
220 | 216 | if inst is None: | ||
221 | 217 | return self | ||
222 | 218 | cachedresult = getattr(inst, self.attrname, CachedProperty.sentinel) | ||
223 | 219 | if cachedresult is CachedProperty.sentinel: | ||
224 | 220 | result = self.fn(inst) | ||
225 | 221 | cache_property(inst, self.attrname, result) | ||
226 | 222 | return result | ||
227 | 223 | else: | ||
228 | 224 | return cachedresult | ||
229 | 225 | |||
230 | 226 | |||
231 | 227 | if __name__ == '__main__': | ||
232 | 228 | import doctest | ||
233 | 229 | doctest.testmod() | ||
234 | 230 | 0 | ||
235 | === modified file 'lib/canonical/database/sqlbase.py' | |||
236 | --- lib/canonical/database/sqlbase.py 2010-08-23 10:57:10 +0000 | |||
237 | +++ lib/canonical/database/sqlbase.py 2010-08-24 10:29:11 +0000 | |||
238 | @@ -65,7 +65,6 @@ | |||
239 | 65 | from zope.interface import implements | 65 | from zope.interface import implements |
240 | 66 | from zope.security.proxy import removeSecurityProxy | 66 | from zope.security.proxy import removeSecurityProxy |
241 | 67 | 67 | ||
242 | 68 | from canonical.cachedproperty import clear_cachedproperties | ||
243 | 69 | from canonical.config import ( | 68 | from canonical.config import ( |
244 | 70 | config, | 69 | config, |
245 | 71 | dbconfig, | 70 | dbconfig, |
246 | @@ -271,10 +270,6 @@ | |||
247 | 271 | # XXX: RobertCollins 2010-08-16 bug=622648: Note this is not directly | 270 | # XXX: RobertCollins 2010-08-16 bug=622648: Note this is not directly |
248 | 272 | # tested, but the entire test suite blows up awesomely if it's broken. | 271 | # tested, but the entire test suite blows up awesomely if it's broken. |
249 | 273 | # It's entirely unclear where tests for this should be. | 272 | # It's entirely unclear where tests for this should be. |
250 | 274 | |||
251 | 275 | # While canonical.cachedproperty and lp.services.propertycache are | ||
252 | 276 | # both in use, we must clear the caches for both. | ||
253 | 277 | clear_cachedproperties(self) | ||
254 | 278 | IPropertyCacheManager(self).clear() | 273 | IPropertyCacheManager(self).clear() |
255 | 279 | 274 | ||
256 | 280 | 275 | ||
257 | 281 | 276 | ||
258 | === removed file 'lib/canonical/tests/test_cachedproperty.py' | |||
259 | --- lib/canonical/tests/test_cachedproperty.py 2010-07-14 14:11:15 +0000 | |||
260 | +++ lib/canonical/tests/test_cachedproperty.py 1970-01-01 00:00:00 +0000 | |||
261 | @@ -1,15 +0,0 @@ | |||
262 | 1 | # Copyright 2009 Canonical Ltd. This software is licensed under the | ||
263 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | ||
264 | 3 | |||
265 | 4 | from doctest import DocTestSuite, ELLIPSIS | ||
266 | 5 | import unittest | ||
267 | 6 | |||
268 | 7 | import canonical.cachedproperty | ||
269 | 8 | |||
270 | 9 | def test_suite(): | ||
271 | 10 | suite = DocTestSuite(canonical.cachedproperty, optionflags=ELLIPSIS) | ||
272 | 11 | return suite | ||
273 | 12 | |||
274 | 13 | |||
275 | 14 | if __name__ == '__main__': | ||
276 | 15 | unittest.main(defaultTest='test_suite') | ||
277 | 16 | 0 | ||
278 | === modified file 'lib/lp/bugs/model/bug.py' | |||
279 | --- lib/lp/bugs/model/bug.py 2010-08-22 18:31:30 +0000 | |||
280 | +++ lib/lp/bugs/model/bug.py 2010-08-24 10:12:39 +0000 | |||
281 | @@ -70,9 +70,9 @@ | |||
282 | 70 | providedBy, | 70 | providedBy, |
283 | 71 | ) | 71 | ) |
284 | 72 | 72 | ||
286 | 73 | from canonical.cachedproperty import ( | 73 | from lp.services.propertycache import ( |
287 | 74 | cachedproperty, | 74 | cachedproperty, |
289 | 75 | clear_property, | 75 | IPropertyCache, |
290 | 76 | ) | 76 | ) |
291 | 77 | from canonical.config import config | 77 | from canonical.config import config |
292 | 78 | from canonical.database.constants import UTC_NOW | 78 | from canonical.database.constants import UTC_NOW |
293 | @@ -633,7 +633,7 @@ | |||
294 | 633 | # disabled see the change. | 633 | # disabled see the change. |
295 | 634 | store.flush() | 634 | store.flush() |
296 | 635 | self.updateHeat() | 635 | self.updateHeat() |
298 | 636 | clear_property(self, '_cached_viewers') | 636 | del IPropertyCache(self)._known_viewers |
299 | 637 | return | 637 | return |
300 | 638 | 638 | ||
301 | 639 | def unsubscribeFromDupes(self, person, unsubscribed_by): | 639 | def unsubscribeFromDupes(self, person, unsubscribed_by): |
302 | @@ -1626,7 +1626,7 @@ | |||
303 | 1626 | self, self.messages[comment_number]) | 1626 | self, self.messages[comment_number]) |
304 | 1627 | bug_message.visible = visible | 1627 | bug_message.visible = visible |
305 | 1628 | 1628 | ||
307 | 1629 | @cachedproperty('_cached_viewers') | 1629 | @cachedproperty |
308 | 1630 | def _known_viewers(self): | 1630 | def _known_viewers(self): |
309 | 1631 | """A dict of of known persons able to view this bug.""" | 1631 | """A dict of of known persons able to view this bug.""" |
310 | 1632 | return set() | 1632 | return set() |
311 | 1633 | 1633 | ||
312 | === modified file 'lib/lp/bugs/model/bugtask.py' | |||
313 | --- lib/lp/bugs/model/bugtask.py 2010-08-22 18:31:30 +0000 | |||
314 | +++ lib/lp/bugs/model/bugtask.py 2010-08-24 10:32:39 +0000 | |||
315 | @@ -59,7 +59,6 @@ | |||
316 | 59 | removeSecurityProxy, | 59 | removeSecurityProxy, |
317 | 60 | ) | 60 | ) |
318 | 61 | 61 | ||
319 | 62 | from canonical.cachedproperty import cache_property | ||
320 | 63 | from canonical.config import config | 62 | from canonical.config import config |
321 | 64 | from canonical.database.constants import UTC_NOW | 63 | from canonical.database.constants import UTC_NOW |
322 | 65 | from canonical.database.datetimecol import UtcDateTimeCol | 64 | from canonical.database.datetimecol import UtcDateTimeCol |
323 | @@ -156,6 +155,9 @@ | |||
324 | 156 | from lp.soyuz.interfaces.publishing import PackagePublishingStatus | 155 | from lp.soyuz.interfaces.publishing import PackagePublishingStatus |
325 | 157 | from lp.soyuz.model.publishing import SourcePackagePublishingHistory | 156 | from lp.soyuz.model.publishing import SourcePackagePublishingHistory |
326 | 158 | from lp.soyuz.model.sourcepackagerelease import SourcePackageRelease | 157 | from lp.soyuz.model.sourcepackagerelease import SourcePackageRelease |
327 | 158 | from lp.services.propertycache import ( | ||
328 | 159 | IPropertyCache, | ||
329 | 160 | ) | ||
330 | 159 | 161 | ||
331 | 160 | 162 | ||
332 | 161 | debbugsseveritymap = {None: BugTaskImportance.UNDECIDED, | 163 | debbugsseveritymap = {None: BugTaskImportance.UNDECIDED, |
333 | @@ -1324,7 +1326,7 @@ | |||
334 | 1324 | """ | 1326 | """ |
335 | 1325 | userid = user.id | 1327 | userid = user.id |
336 | 1326 | def cache_user_can_view_bug(bugtask): | 1328 | def cache_user_can_view_bug(bugtask): |
338 | 1327 | cache_property(bugtask.bug, '_cached_viewers', set([userid])) | 1329 | IPropertyCache(bugtask.bug)._known_viewers = set([userid]) |
339 | 1328 | return bugtask | 1330 | return bugtask |
340 | 1329 | return cache_user_can_view_bug | 1331 | return cache_user_can_view_bug |
341 | 1330 | 1332 | ||
342 | 1331 | 1333 | ||
343 | === modified file 'lib/lp/registry/browser/person.py' | |||
344 | --- lib/lp/registry/browser/person.py 2010-08-23 03:25:20 +0000 | |||
345 | +++ lib/lp/registry/browser/person.py 2010-08-24 10:19:26 +0000 | |||
346 | @@ -141,7 +141,10 @@ | |||
347 | 141 | from zope.security.interfaces import Unauthorized | 141 | from zope.security.interfaces import Unauthorized |
348 | 142 | from zope.security.proxy import removeSecurityProxy | 142 | from zope.security.proxy import removeSecurityProxy |
349 | 143 | 143 | ||
351 | 144 | from canonical.cachedproperty import cachedproperty | 144 | from lp.services.propertycache import ( |
352 | 145 | cachedproperty, | ||
353 | 146 | IPropertyCache, | ||
354 | 147 | ) | ||
355 | 145 | from canonical.config import config | 148 | from canonical.config import config |
356 | 146 | from canonical.database.sqlbase import flush_database_updates | 149 | from canonical.database.sqlbase import flush_database_updates |
357 | 147 | from canonical.launchpad import ( | 150 | from canonical.launchpad import ( |
358 | @@ -5693,10 +5696,7 @@ | |||
359 | 5693 | def _reset_state(self): | 5696 | def _reset_state(self): |
360 | 5694 | """Reset the cache because the recipients changed.""" | 5697 | """Reset the cache because the recipients changed.""" |
361 | 5695 | self._count_recipients = None | 5698 | self._count_recipients = None |
366 | 5696 | if safe_hasattr(self, '_all_recipients_cached'): | 5699 | del IPropertyCache(self)._all_recipients |
363 | 5697 | # The clear the cache of _all_recipients. The caching will fail | ||
364 | 5698 | # if this method creates the attribute before _all_recipients. | ||
365 | 5699 | del self._all_recipients_cached | ||
367 | 5700 | 5700 | ||
368 | 5701 | def _getPrimaryReason(self, person_or_team): | 5701 | def _getPrimaryReason(self, person_or_team): |
369 | 5702 | """Return the primary reason enumeration. | 5702 | """Return the primary reason enumeration. |
370 | @@ -5804,7 +5804,7 @@ | |||
371 | 5804 | 'You are contacting %s of the %s (%s) team directly.' | 5804 | 'You are contacting %s of the %s (%s) team directly.' |
372 | 5805 | % (text, person_or_team.displayname, person_or_team.name)) | 5805 | % (text, person_or_team.displayname, person_or_team.name)) |
373 | 5806 | 5806 | ||
375 | 5807 | @cachedproperty('_all_recipients_cached') | 5807 | @cachedproperty |
376 | 5808 | def _all_recipients(self): | 5808 | def _all_recipients(self): |
377 | 5809 | """Set the cache of all recipients.""" | 5809 | """Set the cache of all recipients.""" |
378 | 5810 | all_recipients = {} | 5810 | all_recipients = {} |
379 | 5811 | 5811 | ||
380 | === modified file 'lib/lp/registry/model/distroseries.py' | |||
381 | --- lib/lp/registry/model/distroseries.py 2010-08-22 18:31:30 +0000 | |||
382 | +++ lib/lp/registry/model/distroseries.py 2010-08-24 10:20:53 +0000 | |||
383 | @@ -547,7 +547,7 @@ | |||
384 | 547 | orderBy=["Language.englishname"]) | 547 | orderBy=["Language.englishname"]) |
385 | 548 | return result | 548 | return result |
386 | 549 | 549 | ||
388 | 550 | @cachedproperty('_previous_series_cached') | 550 | @cachedproperty |
389 | 551 | def previous_series(self): | 551 | def previous_series(self): |
390 | 552 | """See `IDistroSeries`.""" | 552 | """See `IDistroSeries`.""" |
391 | 553 | # This property is cached because it is used intensely inside | 553 | # This property is cached because it is used intensely inside |
392 | 554 | 554 | ||
393 | === modified file 'lib/lp/registry/model/product.py' | |||
394 | --- lib/lp/registry/model/product.py 2010-08-22 19:26:46 +0000 | |||
395 | +++ lib/lp/registry/model/product.py 2010-08-24 10:23:04 +0000 | |||
396 | @@ -38,7 +38,10 @@ | |||
397 | 38 | from zope.interface import implements | 38 | from zope.interface import implements |
398 | 39 | from zope.security.proxy import removeSecurityProxy | 39 | from zope.security.proxy import removeSecurityProxy |
399 | 40 | 40 | ||
401 | 41 | from canonical.cachedproperty import cachedproperty | 41 | from lp.services.propertycache import ( |
402 | 42 | cachedproperty, | ||
403 | 43 | IPropertyCache, | ||
404 | 44 | ) | ||
405 | 42 | from canonical.database.constants import UTC_NOW | 45 | from canonical.database.constants import UTC_NOW |
406 | 43 | from canonical.database.datetimecol import UtcDateTimeCol | 46 | from canonical.database.datetimecol import UtcDateTimeCol |
407 | 44 | from canonical.database.enumcol import EnumCol | 47 | from canonical.database.enumcol import EnumCol |
408 | @@ -428,7 +431,7 @@ | |||
409 | 428 | notNull=True, default=False, | 431 | notNull=True, default=False, |
410 | 429 | storm_validator=_validate_license_approved) | 432 | storm_validator=_validate_license_approved) |
411 | 430 | 433 | ||
413 | 431 | @cachedproperty('_commercial_subscription_cached') | 434 | @cachedproperty |
414 | 432 | def commercial_subscription(self): | 435 | def commercial_subscription(self): |
415 | 433 | return CommercialSubscription.selectOneBy(product=self) | 436 | return CommercialSubscription.selectOneBy(product=self) |
416 | 434 | 437 | ||
417 | @@ -475,7 +478,7 @@ | |||
418 | 475 | purchaser=purchaser, | 478 | purchaser=purchaser, |
419 | 476 | sales_system_id=voucher, | 479 | sales_system_id=voucher, |
420 | 477 | whiteboard=whiteboard) | 480 | whiteboard=whiteboard) |
422 | 478 | self._commercial_subscription_cached = subscription | 481 | IPropertyCache(self).commercial_subscription = subscription |
423 | 479 | else: | 482 | else: |
424 | 480 | if current_datetime <= self.commercial_subscription.date_expires: | 483 | if current_datetime <= self.commercial_subscription.date_expires: |
425 | 481 | # Extend current subscription. | 484 | # Extend current subscription. |
426 | 482 | 485 | ||
427 | === modified file 'lib/lp/soyuz/model/distroseriesbinarypackage.py' | |||
428 | --- lib/lp/soyuz/model/distroseriesbinarypackage.py 2010-08-20 20:31:18 +0000 | |||
429 | +++ lib/lp/soyuz/model/distroseriesbinarypackage.py 2010-08-24 10:25:36 +0000 | |||
430 | @@ -12,7 +12,10 @@ | |||
431 | 12 | from storm.store import Store | 12 | from storm.store import Store |
432 | 13 | from zope.interface import implements | 13 | from zope.interface import implements |
433 | 14 | 14 | ||
435 | 15 | from canonical.cachedproperty import cachedproperty | 15 | from lp.services.propertycache import ( |
436 | 16 | cachedproperty, | ||
437 | 17 | IPropertyCache, | ||
438 | 18 | ) | ||
439 | 16 | from canonical.database.sqlbase import sqlvalues | 19 | from canonical.database.sqlbase import sqlvalues |
440 | 17 | from lp.soyuz.interfaces.distroseriesbinarypackage import ( | 20 | from lp.soyuz.interfaces.distroseriesbinarypackage import ( |
441 | 18 | IDistroSeriesBinaryPackage, | 21 | IDistroSeriesBinaryPackage, |
442 | @@ -40,7 +43,7 @@ | |||
443 | 40 | self.distroseries = distroseries | 43 | self.distroseries = distroseries |
444 | 41 | self.binarypackagename = binarypackagename | 44 | self.binarypackagename = binarypackagename |
445 | 42 | if cache is not None: | 45 | if cache is not None: |
447 | 43 | self._cache = cache | 46 | IPropertyCache(self).cache = cache |
448 | 44 | 47 | ||
449 | 45 | @property | 48 | @property |
450 | 46 | def name(self): | 49 | def name(self): |
451 | @@ -58,7 +61,7 @@ | |||
452 | 58 | """See IDistroSeriesBinaryPackage.""" | 61 | """See IDistroSeriesBinaryPackage.""" |
453 | 59 | return self.distroseries.distribution | 62 | return self.distroseries.distribution |
454 | 60 | 63 | ||
456 | 61 | @cachedproperty('_cache') | 64 | @cachedproperty |
457 | 62 | def cache(self): | 65 | def cache(self): |
458 | 63 | """See IDistroSeriesBinaryPackage.""" | 66 | """See IDistroSeriesBinaryPackage.""" |
459 | 64 | store = Store.of(self.distroseries) | 67 | store = Store.of(self.distroseries) |
460 | 65 | 68 | ||
461 | === modified file 'lib/lp/testopenid/browser/server.py' | |||
462 | --- lib/lp/testopenid/browser/server.py 2010-08-20 20:31:18 +0000 | |||
463 | +++ lib/lp/testopenid/browser/server.py 2010-08-24 10:27:59 +0000 | |||
464 | @@ -32,7 +32,10 @@ | |||
465 | 32 | from zope.security.proxy import isinstance as zisinstance | 32 | from zope.security.proxy import isinstance as zisinstance |
466 | 33 | from zope.session.interfaces import ISession | 33 | from zope.session.interfaces import ISession |
467 | 34 | 34 | ||
469 | 35 | from canonical.cachedproperty import cachedproperty | 35 | from lp.services.propertycache import ( |
470 | 36 | cachedproperty, | ||
471 | 37 | IPropertyCache, | ||
472 | 38 | ) | ||
473 | 36 | from canonical.launchpad import _ | 39 | from canonical.launchpad import _ |
474 | 37 | from canonical.launchpad.interfaces.account import ( | 40 | from canonical.launchpad.interfaces.account import ( |
475 | 38 | AccountStatus, | 41 | AccountStatus, |
476 | @@ -142,7 +145,7 @@ | |||
477 | 142 | return (self.openid_request.idSelect() or | 145 | return (self.openid_request.idSelect() or |
478 | 143 | self.openid_request.identity == self.user_identity_url) | 146 | self.openid_request.identity == self.user_identity_url) |
479 | 144 | 147 | ||
481 | 145 | @cachedproperty('_openid_parameters') | 148 | @cachedproperty |
482 | 146 | def openid_parameters(self): | 149 | def openid_parameters(self): |
483 | 147 | """A dictionary of OpenID query parameters from request.""" | 150 | """A dictionary of OpenID query parameters from request.""" |
484 | 148 | query = {} | 151 | query = {} |
485 | @@ -165,8 +168,9 @@ | |||
486 | 165 | def restoreRequestFromSession(self): | 168 | def restoreRequestFromSession(self): |
487 | 166 | """Get the OpenIDRequest from our session.""" | 169 | """Get the OpenIDRequest from our session.""" |
488 | 167 | session = self.getSession() | 170 | session = self.getSession() |
489 | 171 | cache = IPropertyCache(self) | ||
490 | 168 | try: | 172 | try: |
492 | 169 | self._openid_parameters = session[OPENID_REQUEST_SESSION_KEY] | 173 | cache.openid_parameters = session[OPENID_REQUEST_SESSION_KEY] |
493 | 170 | except KeyError: | 174 | except KeyError: |
494 | 171 | raise UnexpectedFormData("No OpenID request in session") | 175 | raise UnexpectedFormData("No OpenID request in session") |
495 | 172 | 176 | ||
496 | 173 | 177 | ||
497 | === modified file 'lib/lp/shipit.py' | |||
498 | --- lib/lp/shipit.py 2010-08-20 20:31:18 +0000 | |||
499 | +++ lib/lp/shipit.py 2010-08-24 15:27:46 +0000 | |||
500 | @@ -106,6 +106,10 @@ | |||
501 | 106 | from lp.registry.model.person import Person | 106 | from lp.registry.model.person import Person |
502 | 107 | from lp.services.mail import stub | 107 | from lp.services.mail import stub |
503 | 108 | from lp.services.mail.sendmail import simple_sendmail | 108 | from lp.services.mail.sendmail import simple_sendmail |
504 | 109 | from lp.services.propertycache import ( | ||
505 | 110 | cachedproperty, | ||
506 | 111 | IPropertyCache, | ||
507 | 112 | ) | ||
508 | 109 | from lp.services.scripts.base import ( | 113 | from lp.services.scripts.base import ( |
509 | 110 | LaunchpadCronScript, | 114 | LaunchpadCronScript, |
510 | 111 | LaunchpadScript, | 115 | LaunchpadScript, |
Graham Binns (gmb) wrote : | # |
r=me on the changes made here: http://
Gavin Panella (allenap) wrote : | # |
Hi Rob,
If you get a chance, please could you review my workaround for bug
628762 (diff attached). It passes the full test suite, hurrah :)
Thanks, Gavin.
1 | === modified file 'lib/lp/services/propertycache.py' | |||
2 | --- lib/lp/services/propertycache.py 2010-08-31 11:03:41 +0000 | |||
3 | +++ lib/lp/services/propertycache.py 2010-09-02 12:52:40 +0000 | |||
4 | @@ -184,3 +184,32 @@ | |||
5 | 184 | name = name_or_function.__name__ | 184 | name = name_or_function.__name__ |
6 | 185 | populate = name_or_function | 185 | populate = name_or_function |
7 | 186 | return CachedProperty(name=name, populate=populate) | 186 | return CachedProperty(name=name, populate=populate) |
8 | 187 | |||
9 | 188 | |||
10 | 189 | # XXX: GavinPanella 2010-09-02 bug=628762: There are some weird adaption | ||
11 | 190 | # failures when running the full test suite. All that follows is a temporary, | ||
12 | 191 | # mostly non-Zope, workaround. | ||
13 | 192 | |||
14 | 193 | _IPropertyCache = IPropertyCache | ||
15 | 194 | _IPropertyCacheManager = IPropertyCacheManager | ||
16 | 195 | |||
17 | 196 | def IPropertyCache(target): | ||
18 | 197 | """Return the `IPropertyCache` for `target`. | ||
19 | 198 | |||
20 | 199 | Note: this is a workaround; see bug 628762. | ||
21 | 200 | """ | ||
22 | 201 | if _IPropertyCache.providedBy(target): | ||
23 | 202 | return target | ||
24 | 203 | else: | ||
25 | 204 | return get_default_cache(target) | ||
26 | 205 | |||
27 | 206 | def IPropertyCacheManager(target): | ||
28 | 207 | """Return the `IPropertyCacheManager` for `target`. | ||
29 | 208 | |||
30 | 209 | Note: this is a workaround; see bug 628762. | ||
31 | 210 | """ | ||
32 | 211 | cache = IPropertyCache(target) | ||
33 | 212 | if isinstance(cache, DefaultPropertyCache): | ||
34 | 213 | return DefaultPropertyCacheManager(cache) | ||
35 | 214 | else: | ||
36 | 215 | return PropertyCacheManager(cache) |
Robert Collins (lifeless) wrote : | # |
looks ok to me
Preview Diff
1 | === modified file '.ctags' | |||
2 | --- .ctags 2010-01-06 20:06:23 +0000 | |||
3 | +++ .ctags 2010-09-02 12:57:56 +0000 | |||
4 | @@ -1,1 +1,4 @@ | |||
5 | 1 | --python-kinds=-iv | 1 | --python-kinds=-iv |
6 | 2 | --exclude=*-min.js | ||
7 | 3 | --exclude=*-debug.js | ||
8 | 4 | --extra=+f | ||
9 | 2 | 5 | ||
10 | === removed file 'lib/canonical/cachedproperty.py' | |||
11 | --- lib/canonical/cachedproperty.py 2010-08-17 07:03:25 +0000 | |||
12 | +++ lib/canonical/cachedproperty.py 1970-01-01 00:00:00 +0000 | |||
13 | @@ -1,229 +0,0 @@ | |||
14 | 1 | # Copyright 2009 Canonical Ltd. This software is licensed under the | ||
15 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | ||
16 | 3 | |||
17 | 4 | """Cached properties for situations where a property is computed once and | ||
18 | 5 | then returned each time it is asked for. | ||
19 | 6 | |||
20 | 7 | The clear_cachedproperties function can be used to wipe the cache of properties | ||
21 | 8 | from an instance. | ||
22 | 9 | """ | ||
23 | 10 | |||
24 | 11 | __metaclass__ = type | ||
25 | 12 | |||
26 | 13 | __all__ = [ | ||
27 | 14 | 'cache_property', | ||
28 | 15 | 'cachedproperty', | ||
29 | 16 | 'clear_cachedproperties', | ||
30 | 17 | 'clear_property', | ||
31 | 18 | ] | ||
32 | 19 | |||
33 | 20 | from zope.security.proxy import removeSecurityProxy | ||
34 | 21 | |||
35 | 22 | from canonical.lazr.utils import safe_hasattr | ||
36 | 23 | |||
37 | 24 | # XXX: JonathanLange 2010-01-11 bug=505731: Move this to lp.services. | ||
38 | 25 | |||
39 | 26 | def cachedproperty(attrname_or_fn): | ||
40 | 27 | """A decorator for methods that makes them properties with their return | ||
41 | 28 | value cached. | ||
42 | 29 | |||
43 | 30 | The value is cached on the instance, using the attribute name provided. | ||
44 | 31 | |||
45 | 32 | If you don't provide a name, the mangled name of the property is used. | ||
46 | 33 | |||
47 | 34 | cachedproperty is not threadsafe - it should not be used on objects which | ||
48 | 35 | are shared across threads / external locking should be used on those | ||
49 | 36 | objects. | ||
50 | 37 | |||
51 | 38 | >>> class CachedPropertyTest(object): | ||
52 | 39 | ... | ||
53 | 40 | ... @cachedproperty('_foo_cache') | ||
54 | 41 | ... def foo(self): | ||
55 | 42 | ... print 'foo computed' | ||
56 | 43 | ... return 23 | ||
57 | 44 | ... | ||
58 | 45 | ... @cachedproperty | ||
59 | 46 | ... def bar(self): | ||
60 | 47 | ... print 'bar computed' | ||
61 | 48 | ... return 69 | ||
62 | 49 | |||
63 | 50 | >>> cpt = CachedPropertyTest() | ||
64 | 51 | >>> getattr(cpt, '_foo_cache', None) is None | ||
65 | 52 | True | ||
66 | 53 | >>> cpt.foo | ||
67 | 54 | foo computed | ||
68 | 55 | 23 | ||
69 | 56 | >>> cpt.foo | ||
70 | 57 | 23 | ||
71 | 58 | >>> cpt._foo_cache | ||
72 | 59 | 23 | ||
73 | 60 | >>> cpt.bar | ||
74 | 61 | bar computed | ||
75 | 62 | 69 | ||
76 | 63 | >>> cpt._bar_cached_value | ||
77 | 64 | 69 | ||
78 | 65 | |||
79 | 66 | Cached properties are listed on instances. | ||
80 | 67 | >>> sorted(cpt._cached_properties) | ||
81 | 68 | ['_bar_cached_value', '_foo_cache'] | ||
82 | 69 | |||
83 | 70 | """ | ||
84 | 71 | if isinstance(attrname_or_fn, basestring): | ||
85 | 72 | attrname = attrname_or_fn | ||
86 | 73 | return CachedPropertyForAttr(attrname) | ||
87 | 74 | else: | ||
88 | 75 | fn = attrname_or_fn | ||
89 | 76 | attrname = '_%s_cached_value' % fn.__name__ | ||
90 | 77 | return CachedProperty(attrname, fn) | ||
91 | 78 | |||
92 | 79 | def cache_property(instance, attrname, value): | ||
93 | 80 | """Cache value on instance as attrname. | ||
94 | 81 | |||
95 | 82 | instance._cached_properties is updated with attrname. | ||
96 | 83 | |||
97 | 84 | >>> class CachedPropertyTest(object): | ||
98 | 85 | ... | ||
99 | 86 | ... @cachedproperty('_foo_cache') | ||
100 | 87 | ... def foo(self): | ||
101 | 88 | ... return 23 | ||
102 | 89 | ... | ||
103 | 90 | >>> instance = CachedPropertyTest() | ||
104 | 91 | >>> cache_property(instance, '_foo_cache', 42) | ||
105 | 92 | >>> instance.foo | ||
106 | 93 | 42 | ||
107 | 94 | >>> instance._cached_properties | ||
108 | 95 | ['_foo_cache'] | ||
109 | 96 | |||
110 | 97 | Caching a new value does not duplicate the cache keys. | ||
111 | 98 | |||
112 | 99 | >>> cache_property(instance, '_foo_cache', 84) | ||
113 | 100 | >>> instance._cached_properties | ||
114 | 101 | ['_foo_cache'] | ||
115 | 102 | |||
116 | 103 | And does update the cached value. | ||
117 | 104 | |||
118 | 105 | >>> instance.foo | ||
119 | 106 | 84 | ||
120 | 107 | """ | ||
121 | 108 | naked_instance = removeSecurityProxy(instance) | ||
122 | 109 | clear_property(naked_instance, attrname) | ||
123 | 110 | setattr(naked_instance, attrname, value) | ||
124 | 111 | cached_properties = getattr(naked_instance, '_cached_properties', []) | ||
125 | 112 | cached_properties.append(attrname) | ||
126 | 113 | naked_instance._cached_properties = cached_properties | ||
127 | 114 | |||
128 | 115 | |||
129 | 116 | def clear_property(instance, attrname): | ||
130 | 117 | """Remove a cached attribute from instance. | ||
131 | 118 | |||
132 | 119 | The attribute name is removed from instance._cached_properties. | ||
133 | 120 | |||
134 | 121 | If the property is not cached, nothing happens. | ||
135 | 122 | |||
136 | 123 | :seealso clear_cachedproperties: For clearing all cached items at once. | ||
137 | 124 | |||
138 | 125 | >>> class CachedPropertyTest(object): | ||
139 | 126 | ... | ||
140 | 127 | ... @cachedproperty('_foo_cache') | ||
141 | 128 | ... def foo(self): | ||
142 | 129 | ... return 23 | ||
143 | 130 | ... | ||
144 | 131 | >>> instance = CachedPropertyTest() | ||
145 | 132 | >>> instance.foo | ||
146 | 133 | 23 | ||
147 | 134 | >>> clear_property(instance, '_foo_cache') | ||
148 | 135 | >>> instance._cached_properties | ||
149 | 136 | [] | ||
150 | 137 | >>> is_cached(instance, '_foo_cache') | ||
151 | 138 | False | ||
152 | 139 | >>> clear_property(instance, '_foo_cache') | ||
153 | 140 | """ | ||
154 | 141 | naked_instance = removeSecurityProxy(instance) | ||
155 | 142 | if not is_cached(naked_instance, attrname): | ||
156 | 143 | return | ||
157 | 144 | delattr(naked_instance, attrname) | ||
158 | 145 | naked_instance._cached_properties.remove(attrname) | ||
159 | 146 | |||
160 | 147 | |||
161 | 148 | def clear_cachedproperties(instance): | ||
162 | 149 | """Clear cached properties from an object. | ||
163 | 150 | |||
164 | 151 | >>> class CachedPropertyTest(object): | ||
165 | 152 | ... | ||
166 | 153 | ... @cachedproperty('_foo_cache') | ||
167 | 154 | ... def foo(self): | ||
168 | 155 | ... return 23 | ||
169 | 156 | ... | ||
170 | 157 | >>> instance = CachedPropertyTest() | ||
171 | 158 | >>> instance.foo | ||
172 | 159 | 23 | ||
173 | 160 | >>> instance._cached_properties | ||
174 | 161 | ['_foo_cache'] | ||
175 | 162 | >>> clear_cachedproperties(instance) | ||
176 | 163 | >>> instance._cached_properties | ||
177 | 164 | [] | ||
178 | 165 | >>> hasattr(instance, '_foo_cache') | ||
179 | 166 | False | ||
180 | 167 | """ | ||
181 | 168 | naked_instance = removeSecurityProxy(instance) | ||
182 | 169 | cached_properties = getattr(naked_instance, '_cached_properties', []) | ||
183 | 170 | for property_name in cached_properties: | ||
184 | 171 | delattr(naked_instance, property_name) | ||
185 | 172 | naked_instance._cached_properties = [] | ||
186 | 173 | |||
187 | 174 | |||
188 | 175 | def is_cached(instance, attrname): | ||
189 | 176 | """Return True if attrname is cached on instance. | ||
190 | 177 | |||
191 | 178 | >>> class CachedPropertyTest(object): | ||
192 | 179 | ... | ||
193 | 180 | ... @cachedproperty('_foo_cache') | ||
194 | 181 | ... def foo(self): | ||
195 | 182 | ... return 23 | ||
196 | 183 | ... | ||
197 | 184 | >>> instance = CachedPropertyTest() | ||
198 | 185 | >>> instance.foo | ||
199 | 186 | 23 | ||
200 | 187 | >>> is_cached(instance, '_foo_cache') | ||
201 | 188 | True | ||
202 | 189 | >>> is_cached(instance, '_var_cache') | ||
203 | 190 | False | ||
204 | 191 | """ | ||
205 | 192 | naked_instance = removeSecurityProxy(instance) | ||
206 | 193 | return safe_hasattr(naked_instance, attrname) | ||
207 | 194 | |||
208 | 195 | |||
209 | 196 | class CachedPropertyForAttr: | ||
210 | 197 | """Curry a decorator to provide arguments to the CachedProperty.""" | ||
211 | 198 | |||
212 | 199 | def __init__(self, attrname): | ||
213 | 200 | self.attrname = attrname | ||
214 | 201 | |||
215 | 202 | def __call__(self, fn): | ||
216 | 203 | return CachedProperty(self.attrname, fn) | ||
217 | 204 | |||
218 | 205 | |||
219 | 206 | class CachedProperty: | ||
220 | 207 | |||
221 | 208 | # Used to detect not-yet-cached properties. | ||
222 | 209 | sentinel = object() | ||
223 | 210 | |||
224 | 211 | def __init__(self, attrname, fn): | ||
225 | 212 | self.fn = fn | ||
226 | 213 | self.attrname = attrname | ||
227 | 214 | |||
228 | 215 | def __get__(self, inst, cls=None): | ||
229 | 216 | if inst is None: | ||
230 | 217 | return self | ||
231 | 218 | cachedresult = getattr(inst, self.attrname, CachedProperty.sentinel) | ||
232 | 219 | if cachedresult is CachedProperty.sentinel: | ||
233 | 220 | result = self.fn(inst) | ||
234 | 221 | cache_property(inst, self.attrname, result) | ||
235 | 222 | return result | ||
236 | 223 | else: | ||
237 | 224 | return cachedresult | ||
238 | 225 | |||
239 | 226 | |||
240 | 227 | if __name__ == '__main__': | ||
241 | 228 | import doctest | ||
242 | 229 | doctest.testmod() | ||
243 | 230 | 0 | ||
244 | === modified file 'lib/canonical/database/sqlbase.py' | |||
245 | --- lib/canonical/database/sqlbase.py 2010-09-02 12:57:52 +0000 | |||
246 | +++ lib/canonical/database/sqlbase.py 2010-09-02 12:57:56 +0000 | |||
247 | @@ -65,7 +65,6 @@ | |||
248 | 65 | from zope.interface import implements | 65 | from zope.interface import implements |
249 | 66 | from zope.security.proxy import removeSecurityProxy | 66 | from zope.security.proxy import removeSecurityProxy |
250 | 67 | 67 | ||
251 | 68 | from canonical.cachedproperty import clear_cachedproperties | ||
252 | 69 | from canonical.config import ( | 68 | from canonical.config import ( |
253 | 70 | config, | 69 | config, |
254 | 71 | dbconfig, | 70 | dbconfig, |
255 | @@ -73,7 +72,6 @@ | |||
256 | 73 | from canonical.database.interfaces import ISQLBase | 72 | from canonical.database.interfaces import ISQLBase |
257 | 74 | from lp.services.propertycache import IPropertyCacheManager | 73 | from lp.services.propertycache import IPropertyCacheManager |
258 | 75 | 74 | ||
259 | 76 | |||
260 | 77 | # Default we want for scripts, and the PostgreSQL default. Note psycopg1 will | 75 | # Default we want for scripts, and the PostgreSQL default. Note psycopg1 will |
261 | 78 | # use SERIALIZABLE unless we override, but psycopg2 will not. | 76 | # use SERIALIZABLE unless we override, but psycopg2 will not. |
262 | 79 | ISOLATION_LEVEL_DEFAULT = ISOLATION_LEVEL_READ_COMMITTED | 77 | ISOLATION_LEVEL_DEFAULT = ISOLATION_LEVEL_READ_COMMITTED |
263 | @@ -271,10 +269,6 @@ | |||
264 | 271 | # XXX: RobertCollins 2010-08-16 bug=622648: Note this is not directly | 269 | # XXX: RobertCollins 2010-08-16 bug=622648: Note this is not directly |
265 | 272 | # tested, but the entire test suite blows up awesomely if it's broken. | 270 | # tested, but the entire test suite blows up awesomely if it's broken. |
266 | 273 | # It's entirely unclear where tests for this should be. | 271 | # It's entirely unclear where tests for this should be. |
267 | 274 | |||
268 | 275 | # While canonical.cachedproperty and lp.services.propertycache are | ||
269 | 276 | # both in use, we must clear the caches for both. | ||
270 | 277 | clear_cachedproperties(self) | ||
271 | 278 | IPropertyCacheManager(self).clear() | 272 | IPropertyCacheManager(self).clear() |
272 | 279 | 273 | ||
273 | 280 | 274 | ||
274 | 281 | 275 | ||
275 | === modified file 'lib/canonical/launchpad/browser/launchpad.py' | |||
276 | --- lib/canonical/launchpad/browser/launchpad.py 2010-08-20 20:31:18 +0000 | |||
277 | +++ lib/canonical/launchpad/browser/launchpad.py 2010-09-02 12:57:56 +0000 | |||
278 | @@ -53,7 +53,6 @@ | |||
279 | 53 | from zope.publisher.interfaces.xmlrpc import IXMLRPCRequest | 53 | from zope.publisher.interfaces.xmlrpc import IXMLRPCRequest |
280 | 54 | from zope.security.interfaces import Unauthorized | 54 | from zope.security.interfaces import Unauthorized |
281 | 55 | 55 | ||
282 | 56 | from canonical.cachedproperty import cachedproperty | ||
283 | 57 | from canonical.config import config | 56 | from canonical.config import config |
284 | 58 | from canonical.launchpad.helpers import intOrZero | 57 | from canonical.launchpad.helpers import intOrZero |
285 | 59 | from canonical.launchpad.interfaces.account import AccountStatus | 58 | from canonical.launchpad.interfaces.account import AccountStatus |
286 | @@ -142,6 +141,7 @@ | |||
287 | 142 | ) | 141 | ) |
288 | 143 | from lp.registry.interfaces.projectgroup import IProjectGroupSet | 142 | from lp.registry.interfaces.projectgroup import IProjectGroupSet |
289 | 144 | from lp.registry.interfaces.sourcepackagename import ISourcePackageNameSet | 143 | from lp.registry.interfaces.sourcepackagename import ISourcePackageNameSet |
290 | 144 | from lp.services.propertycache import cachedproperty | ||
291 | 145 | from lp.services.worlddata.interfaces.country import ICountrySet | 145 | from lp.services.worlddata.interfaces.country import ICountrySet |
292 | 146 | from lp.services.worlddata.interfaces.language import ILanguageSet | 146 | from lp.services.worlddata.interfaces.language import ILanguageSet |
293 | 147 | from lp.soyuz.interfaces.binarypackagename import IBinaryPackageNameSet | 147 | from lp.soyuz.interfaces.binarypackagename import IBinaryPackageNameSet |
294 | 148 | 148 | ||
295 | === modified file 'lib/canonical/launchpad/utilities/geoip.py' | |||
296 | --- lib/canonical/launchpad/utilities/geoip.py 2010-08-20 20:31:18 +0000 | |||
297 | +++ lib/canonical/launchpad/utilities/geoip.py 2010-09-02 12:57:56 +0000 | |||
298 | @@ -15,7 +15,6 @@ | |||
299 | 15 | from zope.i18n.interfaces import IUserPreferredLanguages | 15 | from zope.i18n.interfaces import IUserPreferredLanguages |
300 | 16 | from zope.interface import implements | 16 | from zope.interface import implements |
301 | 17 | 17 | ||
302 | 18 | from canonical.cachedproperty import cachedproperty | ||
303 | 19 | from canonical.config import config | 18 | from canonical.config import config |
304 | 20 | from canonical.launchpad.components.request_country import ( | 19 | from canonical.launchpad.components.request_country import ( |
305 | 21 | ipaddress_from_request, | 20 | ipaddress_from_request, |
306 | @@ -26,6 +25,7 @@ | |||
307 | 26 | IRequestLocalLanguages, | 25 | IRequestLocalLanguages, |
308 | 27 | IRequestPreferredLanguages, | 26 | IRequestPreferredLanguages, |
309 | 28 | ) | 27 | ) |
310 | 28 | from lp.services.propertycache import cachedproperty | ||
311 | 29 | from lp.services.worlddata.interfaces.country import ICountrySet | 29 | from lp.services.worlddata.interfaces.country import ICountrySet |
312 | 30 | from lp.services.worlddata.interfaces.language import ILanguageSet | 30 | from lp.services.worlddata.interfaces.language import ILanguageSet |
313 | 31 | 31 | ||
314 | 32 | 32 | ||
315 | === modified file 'lib/canonical/launchpad/webapp/error.py' | |||
316 | --- lib/canonical/launchpad/webapp/error.py 2010-08-23 21:58:28 +0000 | |||
317 | +++ lib/canonical/launchpad/webapp/error.py 2010-09-02 12:57:56 +0000 | |||
318 | @@ -22,7 +22,6 @@ | |||
319 | 22 | from zope.exceptions.exceptionformatter import format_exception | 22 | from zope.exceptions.exceptionformatter import format_exception |
320 | 23 | from zope.interface import implements | 23 | from zope.interface import implements |
321 | 24 | 24 | ||
322 | 25 | from canonical.cachedproperty import cachedproperty | ||
323 | 26 | from canonical.config import config | 25 | from canonical.config import config |
324 | 27 | import canonical.launchpad.layers | 26 | import canonical.launchpad.layers |
325 | 28 | from canonical.launchpad.webapp.adapter import ( | 27 | from canonical.launchpad.webapp.adapter import ( |
326 | @@ -31,6 +30,7 @@ | |||
327 | 31 | ) | 30 | ) |
328 | 32 | from canonical.launchpad.webapp.interfaces import ILaunchBag | 31 | from canonical.launchpad.webapp.interfaces import ILaunchBag |
329 | 33 | from canonical.launchpad.webapp.publisher import LaunchpadView | 32 | from canonical.launchpad.webapp.publisher import LaunchpadView |
330 | 33 | from lp.services.propertycache import cachedproperty | ||
331 | 34 | 34 | ||
332 | 35 | 35 | ||
333 | 36 | class SystemErrorView(LaunchpadView): | 36 | class SystemErrorView(LaunchpadView): |
334 | 37 | 37 | ||
335 | === modified file 'lib/canonical/launchpad/webapp/login.py' | |||
336 | --- lib/canonical/launchpad/webapp/login.py 2010-08-20 20:31:18 +0000 | |||
337 | +++ lib/canonical/launchpad/webapp/login.py 2010-09-02 12:57:56 +0000 | |||
338 | @@ -42,7 +42,6 @@ | |||
339 | 42 | ISession, | 42 | ISession, |
340 | 43 | ) | 43 | ) |
341 | 44 | 44 | ||
342 | 45 | from canonical.cachedproperty import cachedproperty | ||
343 | 46 | from canonical.config import config | 45 | from canonical.config import config |
344 | 47 | from canonical.launchpad import _ | 46 | from canonical.launchpad import _ |
345 | 48 | from canonical.launchpad.interfaces.account import AccountSuspendedError | 47 | from canonical.launchpad.interfaces.account import AccountSuspendedError |
346 | @@ -65,6 +64,7 @@ | |||
347 | 65 | IPersonSet, | 64 | IPersonSet, |
348 | 66 | PersonCreationRationale, | 65 | PersonCreationRationale, |
349 | 67 | ) | 66 | ) |
350 | 67 | from lp.services.propertycache import cachedproperty | ||
351 | 68 | 68 | ||
352 | 69 | 69 | ||
353 | 70 | class UnauthorizedView(SystemErrorView): | 70 | class UnauthorizedView(SystemErrorView): |
354 | 71 | 71 | ||
355 | === modified file 'lib/canonical/launchpad/webapp/servers.py' | |||
356 | --- lib/canonical/launchpad/webapp/servers.py 2010-08-27 16:01:05 +0000 | |||
357 | +++ lib/canonical/launchpad/webapp/servers.py 2010-09-02 12:57:56 +0000 | |||
358 | @@ -62,7 +62,6 @@ | |||
359 | 62 | from zope.server.http.wsgihttpserver import PMDBWSGIHTTPServer | 62 | from zope.server.http.wsgihttpserver import PMDBWSGIHTTPServer |
360 | 63 | from zope.session.interfaces import ISession | 63 | from zope.session.interfaces import ISession |
361 | 64 | 64 | ||
362 | 65 | from canonical.cachedproperty import cachedproperty | ||
363 | 66 | from canonical.config import config | 65 | from canonical.config import config |
364 | 67 | from canonical.launchpad.interfaces.launchpad import ( | 66 | from canonical.launchpad.interfaces.launchpad import ( |
365 | 68 | IFeedsApplication, | 67 | IFeedsApplication, |
366 | @@ -117,6 +116,7 @@ | |||
367 | 117 | from canonical.lazr.timeout import set_default_timeout_function | 116 | from canonical.lazr.timeout import set_default_timeout_function |
368 | 118 | from lp.app.errors import UnexpectedFormData | 117 | from lp.app.errors import UnexpectedFormData |
369 | 119 | from lp.services.features.flags import NullFeatureController | 118 | from lp.services.features.flags import NullFeatureController |
370 | 119 | from lp.services.propertycache import cachedproperty | ||
371 | 120 | from lp.testopenid.interfaces.server import ITestOpenIDApplication | 120 | from lp.testopenid.interfaces.server import ITestOpenIDApplication |
372 | 121 | 121 | ||
373 | 122 | 122 | ||
374 | 123 | 123 | ||
375 | === modified file 'lib/canonical/lazr/feed/feed.py' | |||
376 | --- lib/canonical/lazr/feed/feed.py 2009-06-25 05:30:52 +0000 | |||
377 | +++ lib/canonical/lazr/feed/feed.py 2010-09-02 12:57:56 +0000 | |||
378 | @@ -17,32 +17,41 @@ | |||
379 | 17 | 'MINUTES', | 17 | 'MINUTES', |
380 | 18 | ] | 18 | ] |
381 | 19 | 19 | ||
382 | 20 | from BeautifulSoup import BeautifulSoup | ||
383 | 21 | from datetime import datetime | 20 | from datetime import datetime |
384 | 22 | import pytz | ||
385 | 23 | import operator | 21 | import operator |
386 | 24 | import os | 22 | import os |
387 | 25 | import time | 23 | import time |
388 | 26 | from urlparse import urljoin | 24 | from urlparse import urljoin |
389 | 27 | from xml.sax.saxutils import escape as xml_escape | 25 | from xml.sax.saxutils import escape as xml_escape |
390 | 28 | 26 | ||
391 | 27 | from BeautifulSoup import BeautifulSoup | ||
392 | 28 | import pytz | ||
393 | 29 | from z3c.ptcompat import ViewPageTemplateFile | ||
394 | 30 | from zope.component import getUtility | ||
395 | 29 | from zope.datetime import rfc1123_date | 31 | from zope.datetime import rfc1123_date |
396 | 30 | from zope.component import getUtility | ||
397 | 31 | from zope.interface import implements | 32 | from zope.interface import implements |
398 | 32 | 33 | ||
399 | 33 | from z3c.ptcompat import ViewPageTemplateFile | ||
400 | 34 | |||
401 | 35 | from canonical.cachedproperty import cachedproperty | ||
402 | 36 | from canonical.config import config | 34 | from canonical.config import config |
403 | 37 | # XXX: bac 2007-09-20 bug=153795: modules in canonical.lazr should not import | 35 | # XXX: bac 2007-09-20 bug=153795: modules in canonical.lazr should not import |
404 | 38 | # from canonical.launchpad, but we're doing it here as an expediency to get a | 36 | # from canonical.launchpad, but we're doing it here as an expediency to get a |
405 | 39 | # working prototype. | 37 | # working prototype. |
406 | 40 | from canonical.launchpad.interfaces import ILaunchpadRoot | 38 | from canonical.launchpad.interfaces import ILaunchpadRoot |
407 | 41 | from canonical.launchpad.webapp import ( | 39 | from canonical.launchpad.webapp import ( |
409 | 42 | LaunchpadView, canonical_url, urlappend, urlparse) | 40 | canonical_url, |
410 | 41 | LaunchpadView, | ||
411 | 42 | urlappend, | ||
412 | 43 | urlparse, | ||
413 | 44 | ) | ||
414 | 43 | from canonical.launchpad.webapp.vhosts import allvhosts | 45 | from canonical.launchpad.webapp.vhosts import allvhosts |
415 | 44 | from canonical.lazr.interfaces import ( | 46 | from canonical.lazr.interfaces import ( |
417 | 45 | IFeed, IFeedEntry, IFeedPerson, IFeedTypedData, UnsupportedFeedFormat) | 47 | IFeed, |
418 | 48 | IFeedEntry, | ||
419 | 49 | IFeedPerson, | ||
420 | 50 | IFeedTypedData, | ||
421 | 51 | UnsupportedFeedFormat, | ||
422 | 52 | ) | ||
423 | 53 | from lp.services.propertycache import cachedproperty | ||
424 | 54 | |||
425 | 46 | 55 | ||
426 | 47 | SUPPORTED_FEEDS = ('.atom', '.html') | 56 | SUPPORTED_FEEDS = ('.atom', '.html') |
427 | 48 | MINUTES = 60 # Seconds in a minute. | 57 | MINUTES = 60 # Seconds in a minute. |
428 | 49 | 58 | ||
429 | === removed file 'lib/canonical/tests/test_cachedproperty.py' | |||
430 | --- lib/canonical/tests/test_cachedproperty.py 2010-07-14 14:11:15 +0000 | |||
431 | +++ lib/canonical/tests/test_cachedproperty.py 1970-01-01 00:00:00 +0000 | |||
432 | @@ -1,15 +0,0 @@ | |||
433 | 1 | # Copyright 2009 Canonical Ltd. This software is licensed under the | ||
434 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | ||
435 | 3 | |||
436 | 4 | from doctest import DocTestSuite, ELLIPSIS | ||
437 | 5 | import unittest | ||
438 | 6 | |||
439 | 7 | import canonical.cachedproperty | ||
440 | 8 | |||
441 | 9 | def test_suite(): | ||
442 | 10 | suite = DocTestSuite(canonical.cachedproperty, optionflags=ELLIPSIS) | ||
443 | 11 | return suite | ||
444 | 12 | |||
445 | 13 | |||
446 | 14 | if __name__ == '__main__': | ||
447 | 15 | unittest.main(defaultTest='test_suite') | ||
448 | 16 | 0 | ||
449 | === modified file 'lib/canonical/widgets/popup.py' | |||
450 | --- lib/canonical/widgets/popup.py 2010-06-21 18:51:07 +0000 | |||
451 | +++ lib/canonical/widgets/popup.py 2010-09-02 12:57:56 +0000 | |||
452 | @@ -7,18 +7,19 @@ | |||
453 | 7 | 7 | ||
454 | 8 | __metaclass__ = type | 8 | __metaclass__ = type |
455 | 9 | 9 | ||
456 | 10 | import cgi | ||
457 | 10 | import os | 11 | import os |
459 | 11 | import cgi | 12 | |
460 | 12 | import simplejson | 13 | import simplejson |
462 | 13 | 14 | from z3c.ptcompat import ViewPageTemplateFile | |
463 | 15 | from zope.app.form.browser.itemswidgets import ( | ||
464 | 16 | ItemsWidgetBase, | ||
465 | 17 | SingleDataHelper, | ||
466 | 18 | ) | ||
467 | 14 | from zope.schema.interfaces import IChoice | 19 | from zope.schema.interfaces import IChoice |
468 | 15 | from zope.app.form.browser.itemswidgets import ( | ||
469 | 16 | ItemsWidgetBase, SingleDataHelper) | ||
470 | 17 | |||
471 | 18 | from z3c.ptcompat import ViewPageTemplateFile | ||
472 | 19 | 20 | ||
473 | 20 | from canonical.launchpad.webapp import canonical_url | 21 | from canonical.launchpad.webapp import canonical_url |
475 | 21 | from canonical.cachedproperty import cachedproperty | 22 | from lp.services.propertycache import cachedproperty |
476 | 22 | 23 | ||
477 | 23 | 24 | ||
478 | 24 | class VocabularyPickerWidget(SingleDataHelper, ItemsWidgetBase): | 25 | class VocabularyPickerWidget(SingleDataHelper, ItemsWidgetBase): |
479 | 25 | 26 | ||
480 | === modified file 'lib/lp/answers/browser/faqcollection.py' | |||
481 | --- lib/lp/answers/browser/faqcollection.py 2010-08-20 20:31:18 +0000 | |||
482 | +++ lib/lp/answers/browser/faqcollection.py 2010-09-02 12:57:56 +0000 | |||
483 | @@ -12,7 +12,6 @@ | |||
484 | 12 | 12 | ||
485 | 13 | from urllib import urlencode | 13 | from urllib import urlencode |
486 | 14 | 14 | ||
487 | 15 | from canonical.cachedproperty import cachedproperty | ||
488 | 16 | from canonical.launchpad import _ | 15 | from canonical.launchpad import _ |
489 | 17 | from canonical.launchpad.webapp import ( | 16 | from canonical.launchpad.webapp import ( |
490 | 18 | action, | 17 | action, |
491 | @@ -34,6 +33,7 @@ | |||
492 | 34 | ) | 33 | ) |
493 | 35 | from lp.answers.interfaces.questionenums import QuestionSort | 34 | from lp.answers.interfaces.questionenums import QuestionSort |
494 | 36 | from lp.registry.interfaces.projectgroup import IProjectGroup | 35 | from lp.registry.interfaces.projectgroup import IProjectGroup |
495 | 36 | from lp.services.propertycache import cachedproperty | ||
496 | 37 | 37 | ||
497 | 38 | 38 | ||
498 | 39 | class FAQCollectionMenu(NavigationMenu): | 39 | class FAQCollectionMenu(NavigationMenu): |
499 | 40 | 40 | ||
500 | === modified file 'lib/lp/answers/browser/question.py' | |||
501 | --- lib/lp/answers/browser/question.py 2010-08-20 20:31:18 +0000 | |||
502 | +++ lib/lp/answers/browser/question.py 2010-09-02 12:57:56 +0000 | |||
503 | @@ -55,7 +55,6 @@ | |||
504 | 55 | ) | 55 | ) |
505 | 56 | import zope.security | 56 | import zope.security |
506 | 57 | 57 | ||
507 | 58 | from canonical.cachedproperty import cachedproperty | ||
508 | 59 | from canonical.launchpad import _ | 58 | from canonical.launchpad import _ |
509 | 60 | from canonical.launchpad.helpers import ( | 59 | from canonical.launchpad.helpers import ( |
510 | 61 | is_english_variant, | 60 | is_english_variant, |
511 | @@ -116,6 +115,7 @@ | |||
512 | 116 | UnexpectedFormData, | 115 | UnexpectedFormData, |
513 | 117 | ) | 116 | ) |
514 | 118 | from lp.registry.interfaces.projectgroup import IProjectGroup | 117 | from lp.registry.interfaces.projectgroup import IProjectGroup |
515 | 118 | from lp.services.propertycache import cachedproperty | ||
516 | 119 | 119 | ||
517 | 120 | 120 | ||
518 | 121 | class QuestionLinksMixin: | 121 | class QuestionLinksMixin: |
519 | 122 | 122 | ||
520 | === modified file 'lib/lp/answers/browser/questiontarget.py' | |||
521 | --- lib/lp/answers/browser/questiontarget.py 2010-08-26 17:45:46 +0000 | |||
522 | +++ lib/lp/answers/browser/questiontarget.py 2010-09-02 12:57:56 +0000 | |||
523 | @@ -28,8 +28,8 @@ | |||
524 | 28 | from z3c.ptcompat import ViewPageTemplateFile | 28 | from z3c.ptcompat import ViewPageTemplateFile |
525 | 29 | from zope.app.form.browser import DropdownWidget | 29 | from zope.app.form.browser import DropdownWidget |
526 | 30 | from zope.component import ( | 30 | from zope.component import ( |
527 | 31 | getMultiAdapter, | ||
528 | 31 | getUtility, | 32 | getUtility, |
529 | 32 | getMultiAdapter, | ||
530 | 33 | queryMultiAdapter, | 33 | queryMultiAdapter, |
531 | 34 | ) | 34 | ) |
532 | 35 | from zope.formlib import form | 35 | from zope.formlib import form |
533 | @@ -43,7 +43,6 @@ | |||
534 | 43 | SimpleVocabulary, | 43 | SimpleVocabulary, |
535 | 44 | ) | 44 | ) |
536 | 45 | 45 | ||
537 | 46 | from canonical.cachedproperty import cachedproperty | ||
538 | 47 | from canonical.launchpad import _ | 46 | from canonical.launchpad import _ |
539 | 48 | from canonical.launchpad.helpers import ( | 47 | from canonical.launchpad.helpers import ( |
540 | 49 | browserLanguages, | 48 | browserLanguages, |
541 | @@ -67,7 +66,6 @@ | |||
542 | 67 | from canonical.launchpad.webapp.breadcrumb import Breadcrumb | 66 | from canonical.launchpad.webapp.breadcrumb import Breadcrumb |
543 | 68 | from canonical.launchpad.webapp.menu import structured | 67 | from canonical.launchpad.webapp.menu import structured |
544 | 69 | from canonical.widgets import LabeledMultiCheckBoxWidget | 68 | from canonical.widgets import LabeledMultiCheckBoxWidget |
545 | 70 | from lp.app.errors import NotFoundError | ||
546 | 71 | from lp.answers.browser.faqcollection import FAQCollectionMenu | 69 | from lp.answers.browser.faqcollection import FAQCollectionMenu |
547 | 72 | from lp.answers.interfaces.faqcollection import IFAQCollection | 70 | from lp.answers.interfaces.faqcollection import IFAQCollection |
548 | 73 | from lp.answers.interfaces.questioncollection import ( | 71 | from lp.answers.interfaces.questioncollection import ( |
549 | @@ -80,10 +78,12 @@ | |||
550 | 80 | IQuestionTarget, | 78 | IQuestionTarget, |
551 | 81 | ISearchQuestionsForm, | 79 | ISearchQuestionsForm, |
552 | 82 | ) | 80 | ) |
553 | 81 | from lp.app.errors import NotFoundError | ||
554 | 83 | from lp.registry.interfaces.distribution import IDistribution | 82 | from lp.registry.interfaces.distribution import IDistribution |
555 | 84 | from lp.registry.interfaces.product import IProduct | 83 | from lp.registry.interfaces.product import IProduct |
556 | 85 | from lp.registry.interfaces.projectgroup import IProjectGroup | 84 | from lp.registry.interfaces.projectgroup import IProjectGroup |
557 | 86 | from lp.services.fields import PublicPersonChoice | 85 | from lp.services.fields import PublicPersonChoice |
558 | 86 | from lp.services.propertycache import cachedproperty | ||
559 | 87 | from lp.services.worlddata.interfaces.language import ILanguageSet | 87 | from lp.services.worlddata.interfaces.language import ILanguageSet |
560 | 88 | 88 | ||
561 | 89 | 89 | ||
562 | 90 | 90 | ||
563 | === modified file 'lib/lp/answers/notification.py' | |||
564 | --- lib/lp/answers/notification.py 2010-08-20 20:31:18 +0000 | |||
565 | +++ lib/lp/answers/notification.py 2010-09-02 12:57:56 +0000 | |||
566 | @@ -10,7 +10,6 @@ | |||
567 | 10 | 10 | ||
568 | 11 | import os | 11 | import os |
569 | 12 | 12 | ||
570 | 13 | from canonical.cachedproperty import cachedproperty | ||
571 | 14 | from canonical.config import config | 13 | from canonical.config import config |
572 | 15 | from canonical.launchpad.mail import ( | 14 | from canonical.launchpad.mail import ( |
573 | 16 | format_address, | 15 | format_address, |
574 | @@ -21,6 +20,7 @@ | |||
575 | 21 | from lp.registry.interfaces.person import IPerson | 20 | from lp.registry.interfaces.person import IPerson |
576 | 22 | from lp.services.mail.mailwrapper import MailWrapper | 21 | from lp.services.mail.mailwrapper import MailWrapper |
577 | 23 | from lp.services.mail.notificationrecipientset import NotificationRecipientSet | 22 | from lp.services.mail.notificationrecipientset import NotificationRecipientSet |
578 | 23 | from lp.services.propertycache import cachedproperty | ||
579 | 24 | 24 | ||
580 | 25 | 25 | ||
581 | 26 | def get_email_template(filename): | 26 | def get_email_template(filename): |
582 | 27 | 27 | ||
583 | === modified file 'lib/lp/app/browser/root.py' | |||
584 | --- lib/lp/app/browser/root.py 2010-08-20 20:31:18 +0000 | |||
585 | +++ lib/lp/app/browser/root.py 2010-09-02 12:57:56 +0000 | |||
586 | @@ -20,7 +20,6 @@ | |||
587 | 20 | from zope.schema.interfaces import TooLong | 20 | from zope.schema.interfaces import TooLong |
588 | 21 | from zope.schema.vocabulary import getVocabularyRegistry | 21 | from zope.schema.vocabulary import getVocabularyRegistry |
589 | 22 | 22 | ||
590 | 23 | from canonical.cachedproperty import cachedproperty | ||
591 | 24 | from canonical.config import config | 23 | from canonical.config import config |
592 | 25 | from canonical.launchpad.interfaces.launchpad import ( | 24 | from canonical.launchpad.interfaces.launchpad import ( |
593 | 26 | ILaunchpadCelebrities, | 25 | ILaunchpadCelebrities, |
594 | @@ -54,6 +53,7 @@ | |||
595 | 54 | from lp.registry.interfaces.person import IPersonSet | 53 | from lp.registry.interfaces.person import IPersonSet |
596 | 55 | from lp.registry.interfaces.pillar import IPillarNameSet | 54 | from lp.registry.interfaces.pillar import IPillarNameSet |
597 | 56 | from lp.registry.interfaces.product import IProductSet | 55 | from lp.registry.interfaces.product import IProductSet |
598 | 56 | from lp.services.propertycache import cachedproperty | ||
599 | 57 | 57 | ||
600 | 58 | 58 | ||
601 | 59 | shipit_faq_url = 'http://www.ubuntu.com/getubuntu/shipit-faq' | 59 | shipit_faq_url = 'http://www.ubuntu.com/getubuntu/shipit-faq' |
602 | 60 | 60 | ||
603 | === modified file 'lib/lp/archivepublisher/diskpool.py' | |||
604 | --- lib/lp/archivepublisher/diskpool.py 2010-08-20 20:31:18 +0000 | |||
605 | +++ lib/lp/archivepublisher/diskpool.py 2010-09-02 12:57:56 +0000 | |||
606 | @@ -6,12 +6,12 @@ | |||
607 | 6 | import os | 6 | import os |
608 | 7 | import tempfile | 7 | import tempfile |
609 | 8 | 8 | ||
610 | 9 | from canonical.cachedproperty import cachedproperty | ||
611 | 10 | from canonical.librarian.utils import ( | 9 | from canonical.librarian.utils import ( |
612 | 11 | copy_and_close, | 10 | copy_and_close, |
613 | 12 | sha1_from_path, | 11 | sha1_from_path, |
614 | 13 | ) | 12 | ) |
615 | 14 | from lp.archivepublisher import HARDCODED_COMPONENT_ORDER | 13 | from lp.archivepublisher import HARDCODED_COMPONENT_ORDER |
616 | 14 | from lp.services.propertycache import cachedproperty | ||
617 | 15 | from lp.soyuz.interfaces.publishing import ( | 15 | from lp.soyuz.interfaces.publishing import ( |
618 | 16 | MissingSymlinkInPool, | 16 | MissingSymlinkInPool, |
619 | 17 | NotInPool, | 17 | NotInPool, |
620 | 18 | 18 | ||
621 | === modified file 'lib/lp/blueprints/browser/specification.py' | |||
622 | --- lib/lp/blueprints/browser/specification.py 2010-08-20 20:31:18 +0000 | |||
623 | +++ lib/lp/blueprints/browser/specification.py 2010-09-02 12:57:56 +0000 | |||
624 | @@ -61,7 +61,6 @@ | |||
625 | 61 | SimpleVocabulary, | 61 | SimpleVocabulary, |
626 | 62 | ) | 62 | ) |
627 | 63 | 63 | ||
628 | 64 | from canonical.cachedproperty import cachedproperty | ||
629 | 65 | from canonical.config import config | 64 | from canonical.config import config |
630 | 66 | from canonical.launchpad import _ | 65 | from canonical.launchpad import _ |
631 | 67 | from canonical.launchpad.browser.launchpad import AppFrontPageSearchView | 66 | from canonical.launchpad.browser.launchpad import AppFrontPageSearchView |
632 | @@ -100,6 +99,7 @@ | |||
633 | 100 | from lp.code.interfaces.branchnamespace import IBranchNamespaceSet | 99 | from lp.code.interfaces.branchnamespace import IBranchNamespaceSet |
634 | 101 | from lp.registry.interfaces.distribution import IDistribution | 100 | from lp.registry.interfaces.distribution import IDistribution |
635 | 102 | from lp.registry.interfaces.product import IProduct | 101 | from lp.registry.interfaces.product import IProduct |
636 | 102 | from lp.services.propertycache import cachedproperty | ||
637 | 103 | 103 | ||
638 | 104 | 104 | ||
639 | 105 | class NewSpecificationView(LaunchpadFormView): | 105 | class NewSpecificationView(LaunchpadFormView): |
640 | 106 | 106 | ||
641 | === modified file 'lib/lp/blueprints/browser/specificationgoal.py' | |||
642 | --- lib/lp/blueprints/browser/specificationgoal.py 2010-08-20 20:31:18 +0000 | |||
643 | +++ lib/lp/blueprints/browser/specificationgoal.py 2010-09-02 12:57:56 +0000 | |||
644 | @@ -12,7 +12,6 @@ | |||
645 | 12 | 12 | ||
646 | 13 | from zope.component import getUtility | 13 | from zope.component import getUtility |
647 | 14 | 14 | ||
648 | 15 | from canonical.cachedproperty import cachedproperty | ||
649 | 16 | from canonical.launchpad.webapp import ( | 15 | from canonical.launchpad.webapp import ( |
650 | 17 | canonical_url, | 16 | canonical_url, |
651 | 18 | LaunchpadView, | 17 | LaunchpadView, |
652 | @@ -20,6 +19,7 @@ | |||
653 | 20 | from canonical.launchpad.webapp.interfaces import ILaunchBag | 19 | from canonical.launchpad.webapp.interfaces import ILaunchBag |
654 | 21 | from lp.blueprints.browser.specificationtarget import HasSpecificationsView | 20 | from lp.blueprints.browser.specificationtarget import HasSpecificationsView |
655 | 22 | from lp.blueprints.interfaces.specification import SpecificationFilter | 21 | from lp.blueprints.interfaces.specification import SpecificationFilter |
656 | 22 | from lp.services.propertycache import cachedproperty | ||
657 | 23 | 23 | ||
658 | 24 | 24 | ||
659 | 25 | class GoalDecideView(HasSpecificationsView, LaunchpadView): | 25 | class GoalDecideView(HasSpecificationsView, LaunchpadView): |
660 | 26 | 26 | ||
661 | === modified file 'lib/lp/blueprints/browser/specificationtarget.py' | |||
662 | --- lib/lp/blueprints/browser/specificationtarget.py 2010-08-20 20:31:18 +0000 | |||
663 | +++ lib/lp/blueprints/browser/specificationtarget.py 2010-09-02 12:57:56 +0000 | |||
664 | @@ -17,7 +17,6 @@ | |||
665 | 17 | 17 | ||
666 | 18 | from zope.component import queryMultiAdapter | 18 | from zope.component import queryMultiAdapter |
667 | 19 | 19 | ||
668 | 20 | from canonical.cachedproperty import cachedproperty | ||
669 | 21 | from canonical.config import config | 20 | from canonical.config import config |
670 | 22 | from canonical.launchpad import _ | 21 | from canonical.launchpad import _ |
671 | 23 | from canonical.launchpad.helpers import shortlist | 22 | from canonical.launchpad.helpers import shortlist |
672 | @@ -48,6 +47,7 @@ | |||
673 | 48 | IProjectGroup, | 47 | IProjectGroup, |
674 | 49 | IProjectGroupSeries, | 48 | IProjectGroupSeries, |
675 | 50 | ) | 49 | ) |
676 | 50 | from lp.services.propertycache import cachedproperty | ||
677 | 51 | 51 | ||
678 | 52 | 52 | ||
679 | 53 | class HasSpecificationsMenuMixin: | 53 | class HasSpecificationsMenuMixin: |
680 | 54 | 54 | ||
681 | === modified file 'lib/lp/blueprints/browser/sprint.py' | |||
682 | --- lib/lp/blueprints/browser/sprint.py 2010-08-20 20:31:18 +0000 | |||
683 | +++ lib/lp/blueprints/browser/sprint.py 2010-09-02 12:57:56 +0000 | |||
684 | @@ -30,7 +30,6 @@ | |||
685 | 30 | from zope.component import getUtility | 30 | from zope.component import getUtility |
686 | 31 | from zope.interface import implements | 31 | from zope.interface import implements |
687 | 32 | 32 | ||
688 | 33 | from canonical.cachedproperty import cachedproperty | ||
689 | 34 | from canonical.launchpad import _ | 33 | from canonical.launchpad import _ |
690 | 35 | from canonical.launchpad.helpers import shortlist | 34 | from canonical.launchpad.helpers import shortlist |
691 | 36 | from canonical.launchpad.webapp import ( | 35 | from canonical.launchpad.webapp import ( |
692 | @@ -71,6 +70,7 @@ | |||
693 | 71 | IRegistryCollectionNavigationMenu, | 70 | IRegistryCollectionNavigationMenu, |
694 | 72 | RegistryCollectionActionMenuBase, | 71 | RegistryCollectionActionMenuBase, |
695 | 73 | ) | 72 | ) |
696 | 73 | from lp.services.propertycache import cachedproperty | ||
697 | 74 | 74 | ||
698 | 75 | 75 | ||
699 | 76 | class SprintFacets(StandardLaunchpadFacets): | 76 | class SprintFacets(StandardLaunchpadFacets): |
700 | 77 | 77 | ||
701 | === modified file 'lib/lp/bugs/browser/bug.py' | |||
702 | --- lib/lp/bugs/browser/bug.py 2010-08-27 05:34:32 +0000 | |||
703 | +++ lib/lp/bugs/browser/bug.py 2010-09-02 12:57:56 +0000 | |||
704 | @@ -63,7 +63,6 @@ | |||
705 | 63 | from zope.schema.interfaces import IText | 63 | from zope.schema.interfaces import IText |
706 | 64 | from zope.security.interfaces import Unauthorized | 64 | from zope.security.interfaces import Unauthorized |
707 | 65 | 65 | ||
708 | 66 | from canonical.cachedproperty import cachedproperty | ||
709 | 67 | from canonical.launchpad import _ | 66 | from canonical.launchpad import _ |
710 | 68 | from canonical.launchpad.browser.librarian import ProxiedLibraryFileAlias | 67 | from canonical.launchpad.browser.librarian import ProxiedLibraryFileAlias |
711 | 69 | from canonical.launchpad.mailnotification import MailWrapper | 68 | from canonical.launchpad.mailnotification import MailWrapper |
712 | @@ -115,6 +114,7 @@ | |||
713 | 115 | from lp.bugs.interfaces.cve import ICveSet | 114 | from lp.bugs.interfaces.cve import ICveSet |
714 | 116 | from lp.bugs.mail.bugnotificationbuilder import format_rfc2822_date | 115 | from lp.bugs.mail.bugnotificationbuilder import format_rfc2822_date |
715 | 117 | from lp.services.fields import DuplicateBug | 116 | from lp.services.fields import DuplicateBug |
716 | 117 | from lp.services.propertycache import cachedproperty | ||
717 | 118 | 118 | ||
718 | 119 | 119 | ||
719 | 120 | class BugNavigation(Navigation): | 120 | class BugNavigation(Navigation): |
720 | 121 | 121 | ||
721 | === modified file 'lib/lp/bugs/browser/bugalsoaffects.py' | |||
722 | --- lib/lp/bugs/browser/bugalsoaffects.py 2010-08-20 20:31:18 +0000 | |||
723 | +++ lib/lp/bugs/browser/bugalsoaffects.py 2010-09-02 12:57:56 +0000 | |||
724 | @@ -29,7 +29,6 @@ | |||
725 | 29 | SimpleVocabulary, | 29 | SimpleVocabulary, |
726 | 30 | ) | 30 | ) |
727 | 31 | 31 | ||
728 | 32 | from canonical.cachedproperty import cachedproperty | ||
729 | 33 | from canonical.launchpad import _ | 32 | from canonical.launchpad import _ |
730 | 34 | from canonical.launchpad.browser.multistep import ( | 33 | from canonical.launchpad.browser.multistep import ( |
731 | 35 | MultiStepView, | 34 | MultiStepView, |
732 | @@ -85,6 +84,7 @@ | |||
733 | 85 | License, | 84 | License, |
734 | 86 | ) | 85 | ) |
735 | 87 | from lp.services.fields import StrippedTextLine | 86 | from lp.services.fields import StrippedTextLine |
736 | 87 | from lp.services.propertycache import cachedproperty | ||
737 | 88 | 88 | ||
738 | 89 | 89 | ||
739 | 90 | class BugAlsoAffectsProductMetaView(MultiStepView): | 90 | class BugAlsoAffectsProductMetaView(MultiStepView): |
740 | 91 | 91 | ||
741 | === modified file 'lib/lp/bugs/browser/bugbranch.py' | |||
742 | --- lib/lp/bugs/browser/bugbranch.py 2010-08-20 20:31:18 +0000 | |||
743 | +++ lib/lp/bugs/browser/bugbranch.py 2010-09-02 12:57:56 +0000 | |||
744 | @@ -22,7 +22,6 @@ | |||
745 | 22 | Interface, | 22 | Interface, |
746 | 23 | ) | 23 | ) |
747 | 24 | 24 | ||
748 | 25 | from canonical.cachedproperty import cachedproperty | ||
749 | 26 | from canonical.launchpad import _ | 25 | from canonical.launchpad import _ |
750 | 27 | from canonical.launchpad.webapp import ( | 26 | from canonical.launchpad.webapp import ( |
751 | 28 | action, | 27 | action, |
752 | @@ -38,6 +37,7 @@ | |||
753 | 38 | latest_proposals_for_each_branch, | 37 | latest_proposals_for_each_branch, |
754 | 39 | ) | 38 | ) |
755 | 40 | from lp.code.enums import BranchLifecycleStatus | 39 | from lp.code.enums import BranchLifecycleStatus |
756 | 40 | from lp.services.propertycache import cachedproperty | ||
757 | 41 | 41 | ||
758 | 42 | 42 | ||
759 | 43 | class BugBranchPrimaryContext: | 43 | class BugBranchPrimaryContext: |
760 | 44 | 44 | ||
761 | === modified file 'lib/lp/bugs/browser/bugtarget.py' | |||
762 | --- lib/lp/bugs/browser/bugtarget.py 2010-08-22 18:31:30 +0000 | |||
763 | +++ lib/lp/bugs/browser/bugtarget.py 2010-09-02 12:57:56 +0000 | |||
764 | @@ -50,7 +50,6 @@ | |||
765 | 50 | from zope.schema.vocabulary import SimpleVocabulary | 50 | from zope.schema.vocabulary import SimpleVocabulary |
766 | 51 | from zope.security.proxy import removeSecurityProxy | 51 | from zope.security.proxy import removeSecurityProxy |
767 | 52 | 52 | ||
768 | 53 | from canonical.cachedproperty import cachedproperty | ||
769 | 54 | from canonical.config import config | 53 | from canonical.config import config |
770 | 55 | from canonical.launchpad import _ | 54 | from canonical.launchpad import _ |
771 | 56 | from canonical.launchpad.browser.feeds import ( | 55 | from canonical.launchpad.browser.feeds import ( |
772 | @@ -137,6 +136,7 @@ | |||
773 | 137 | from lp.registry.interfaces.sourcepackage import ISourcePackage | 136 | from lp.registry.interfaces.sourcepackage import ISourcePackage |
774 | 138 | from lp.registry.vocabularies import ValidPersonOrTeamVocabulary | 137 | from lp.registry.vocabularies import ValidPersonOrTeamVocabulary |
775 | 139 | from lp.services.job.interfaces.job import JobStatus | 138 | from lp.services.job.interfaces.job import JobStatus |
776 | 139 | from lp.services.propertycache import cachedproperty | ||
777 | 140 | 140 | ||
778 | 141 | # A simple vocabulary for the subscribe_to_existing_bug form field. | 141 | # A simple vocabulary for the subscribe_to_existing_bug form field. |
779 | 142 | SUBSCRIBE_TO_BUG_VOCABULARY = SimpleVocabulary.fromItems( | 142 | SUBSCRIBE_TO_BUG_VOCABULARY = SimpleVocabulary.fromItems( |
780 | 143 | 143 | ||
781 | === modified file 'lib/lp/bugs/browser/bugtask.py' | |||
782 | --- lib/lp/bugs/browser/bugtask.py 2010-08-31 18:15:15 +0000 | |||
783 | +++ lib/lp/bugs/browser/bugtask.py 2010-09-02 12:57:56 +0000 | |||
784 | @@ -125,7 +125,6 @@ | |||
785 | 125 | ) | 125 | ) |
786 | 126 | from zope.traversing.interfaces import IPathAdapter | 126 | from zope.traversing.interfaces import IPathAdapter |
787 | 127 | 127 | ||
788 | 128 | from canonical.cachedproperty import cachedproperty | ||
789 | 129 | from canonical.config import config | 128 | from canonical.config import config |
790 | 130 | from canonical.database.sqlbase import cursor | 129 | from canonical.database.sqlbase import cursor |
791 | 131 | from canonical.launchpad import ( | 130 | from canonical.launchpad import ( |
792 | @@ -260,6 +259,7 @@ | |||
793 | 260 | from lp.registry.interfaces.sourcepackage import ISourcePackage | 259 | from lp.registry.interfaces.sourcepackage import ISourcePackage |
794 | 261 | from lp.registry.vocabularies import MilestoneVocabulary | 260 | from lp.registry.vocabularies import MilestoneVocabulary |
795 | 262 | from lp.services.fields import PersonChoice | 261 | from lp.services.fields import PersonChoice |
796 | 262 | from lp.services.propertycache import cachedproperty | ||
797 | 263 | 263 | ||
798 | 264 | 264 | ||
799 | 265 | @component.adapter(IBugTask, IReferenceChoice, IWebServiceClientRequest) | 265 | @component.adapter(IBugTask, IReferenceChoice, IWebServiceClientRequest) |
800 | 266 | 266 | ||
801 | === modified file 'lib/lp/bugs/browser/bugtracker.py' | |||
802 | --- lib/lp/bugs/browser/bugtracker.py 2010-08-26 12:33:03 +0000 | |||
803 | +++ lib/lp/bugs/browser/bugtracker.py 2010-09-02 12:57:56 +0000 | |||
804 | @@ -29,7 +29,6 @@ | |||
805 | 29 | from zope.schema.vocabulary import SimpleVocabulary | 29 | from zope.schema.vocabulary import SimpleVocabulary |
806 | 30 | from zope.security.interfaces import Unauthorized | 30 | from zope.security.interfaces import Unauthorized |
807 | 31 | 31 | ||
808 | 32 | from canonical.cachedproperty import cachedproperty | ||
809 | 33 | from canonical.database.sqlbase import flush_database_updates | 32 | from canonical.database.sqlbase import flush_database_updates |
810 | 34 | from canonical.launchpad import _ | 33 | from canonical.launchpad import _ |
811 | 35 | from canonical.launchpad.helpers import ( | 34 | from canonical.launchpad.helpers import ( |
812 | @@ -69,6 +68,7 @@ | |||
813 | 69 | IBugTrackerSet, | 68 | IBugTrackerSet, |
814 | 70 | IRemoteBug, | 69 | IRemoteBug, |
815 | 71 | ) | 70 | ) |
816 | 71 | from lp.services.propertycache import cachedproperty | ||
817 | 72 | 72 | ||
818 | 73 | # A set of bug tracker types for which there can only ever be one bug | 73 | # A set of bug tracker types for which there can only ever be one bug |
819 | 74 | # tracker. | 74 | # tracker. |
820 | 75 | 75 | ||
821 | === modified file 'lib/lp/bugs/browser/cvereport.py' | |||
822 | --- lib/lp/bugs/browser/cvereport.py 2010-08-20 20:31:18 +0000 | |||
823 | +++ lib/lp/bugs/browser/cvereport.py 2010-09-02 12:57:56 +0000 | |||
824 | @@ -11,7 +11,6 @@ | |||
825 | 11 | 11 | ||
826 | 12 | from zope.component import getUtility | 12 | from zope.component import getUtility |
827 | 13 | 13 | ||
828 | 14 | from canonical.cachedproperty import cachedproperty | ||
829 | 15 | from canonical.launchpad.helpers import shortlist | 14 | from canonical.launchpad.helpers import shortlist |
830 | 16 | from canonical.launchpad.searchbuilder import any | 15 | from canonical.launchpad.searchbuilder import any |
831 | 17 | from canonical.launchpad.webapp import LaunchpadView | 16 | from canonical.launchpad.webapp import LaunchpadView |
832 | @@ -23,6 +22,7 @@ | |||
833 | 23 | UNRESOLVED_BUGTASK_STATUSES, | 22 | UNRESOLVED_BUGTASK_STATUSES, |
834 | 24 | ) | 23 | ) |
835 | 25 | from lp.bugs.interfaces.cve import ICveSet | 24 | from lp.bugs.interfaces.cve import ICveSet |
836 | 25 | from lp.services.propertycache import cachedproperty | ||
837 | 26 | 26 | ||
838 | 27 | 27 | ||
839 | 28 | class BugTaskCve: | 28 | class BugTaskCve: |
840 | 29 | 29 | ||
841 | === modified file 'lib/lp/bugs/browser/distribution_upstream_bug_report.py' | |||
842 | --- lib/lp/bugs/browser/distribution_upstream_bug_report.py 2010-08-20 20:31:18 +0000 | |||
843 | +++ lib/lp/bugs/browser/distribution_upstream_bug_report.py 2010-09-02 12:57:56 +0000 | |||
844 | @@ -11,13 +11,13 @@ | |||
845 | 11 | 11 | ||
846 | 12 | from operator import attrgetter | 12 | from operator import attrgetter |
847 | 13 | 13 | ||
848 | 14 | from canonical.cachedproperty import cachedproperty | ||
849 | 15 | from canonical.launchpad.webapp.publisher import ( | 14 | from canonical.launchpad.webapp.publisher import ( |
850 | 16 | canonical_url, | 15 | canonical_url, |
851 | 17 | LaunchpadView, | 16 | LaunchpadView, |
852 | 18 | ) | 17 | ) |
853 | 19 | from canonical.launchpad.webapp.url import urlappend | 18 | from canonical.launchpad.webapp.url import urlappend |
854 | 20 | from lp.bugs.browser.bugtask import get_buglisting_search_filter_url | 19 | from lp.bugs.browser.bugtask import get_buglisting_search_filter_url |
855 | 20 | from lp.services.propertycache import cachedproperty | ||
856 | 21 | 21 | ||
857 | 22 | # TODO: fix column sorting to work for the different colspans, or | 22 | # TODO: fix column sorting to work for the different colspans, or |
858 | 23 | # alternatively implement a sort option box. | 23 | # alternatively implement a sort option box. |
859 | 24 | 24 | ||
860 | === modified file 'lib/lp/bugs/doc/externalbugtracker-mantis-csv.txt' | |||
861 | --- lib/lp/bugs/doc/externalbugtracker-mantis-csv.txt 2010-04-21 10:30:24 +0000 | |||
862 | +++ lib/lp/bugs/doc/externalbugtracker-mantis-csv.txt 2010-09-02 12:57:56 +0000 | |||
863 | @@ -121,8 +121,10 @@ | |||
864 | 121 | Instead of issuing one request per bug watch, like was done before, | 121 | Instead of issuing one request per bug watch, like was done before, |
865 | 122 | updateBugWatches() issues only one request to update all watches: | 122 | updateBugWatches() issues only one request to update all watches: |
866 | 123 | 123 | ||
867 | 124 | >>> from lp.services.propertycache import IPropertyCache | ||
868 | 125 | >>> del IPropertyCache(example_ext_bug_tracker).csv_data | ||
869 | 126 | |||
870 | 124 | >>> example_ext_bug_tracker.trace_calls = True | 127 | >>> example_ext_bug_tracker.trace_calls = True |
871 | 125 | >>> example_ext_bug_tracker.cleanCache() | ||
872 | 126 | >>> bug_watch_updater.updateBugWatches( | 128 | >>> bug_watch_updater.updateBugWatches( |
873 | 127 | ... example_ext_bug_tracker, example_bug_tracker.watches) | 129 | ... example_ext_bug_tracker, example_bug_tracker.watches) |
874 | 128 | INFO:...:Updating 6 watches for 6 bugs on http://bugs.some.where | 130 | INFO:...:Updating 6 watches for 6 bugs on http://bugs.some.where |
875 | 129 | 131 | ||
876 | === modified file 'lib/lp/bugs/externalbugtracker/mantis.py' | |||
877 | --- lib/lp/bugs/externalbugtracker/mantis.py 2010-08-20 20:31:18 +0000 | |||
878 | +++ lib/lp/bugs/externalbugtracker/mantis.py 2010-09-02 12:57:56 +0000 | |||
879 | @@ -18,7 +18,6 @@ | |||
880 | 18 | SoupStrainer, | 18 | SoupStrainer, |
881 | 19 | ) | 19 | ) |
882 | 20 | 20 | ||
883 | 21 | from canonical.cachedproperty import cachedproperty | ||
884 | 22 | from canonical.launchpad.webapp.url import urlparse | 21 | from canonical.launchpad.webapp.url import urlparse |
885 | 23 | from lp.bugs.externalbugtracker import ( | 22 | from lp.bugs.externalbugtracker import ( |
886 | 24 | BugNotFound, | 23 | BugNotFound, |
887 | @@ -37,6 +36,7 @@ | |||
888 | 37 | BugTaskStatus, | 36 | BugTaskStatus, |
889 | 38 | ) | 37 | ) |
890 | 39 | from lp.bugs.interfaces.externalbugtracker import UNKNOWN_REMOTE_IMPORTANCE | 38 | from lp.bugs.interfaces.externalbugtracker import UNKNOWN_REMOTE_IMPORTANCE |
891 | 39 | from lp.services.propertycache import cachedproperty | ||
892 | 40 | 40 | ||
893 | 41 | 41 | ||
894 | 42 | class MantisLoginHandler(urllib2.HTTPRedirectHandler): | 42 | class MantisLoginHandler(urllib2.HTTPRedirectHandler): |
895 | 43 | 43 | ||
896 | === modified file 'lib/lp/bugs/externalbugtracker/rt.py' | |||
897 | --- lib/lp/bugs/externalbugtracker/rt.py 2010-08-20 20:31:18 +0000 | |||
898 | +++ lib/lp/bugs/externalbugtracker/rt.py 2010-09-02 12:57:56 +0000 | |||
899 | @@ -10,7 +10,6 @@ | |||
900 | 10 | import urllib | 10 | import urllib |
901 | 11 | import urllib2 | 11 | import urllib2 |
902 | 12 | 12 | ||
903 | 13 | from canonical.cachedproperty import cachedproperty | ||
904 | 14 | from canonical.config import config | 13 | from canonical.config import config |
905 | 15 | from canonical.launchpad.webapp.url import urlparse | 14 | from canonical.launchpad.webapp.url import urlparse |
906 | 16 | from lp.bugs.externalbugtracker import ( | 15 | from lp.bugs.externalbugtracker import ( |
907 | @@ -24,6 +23,7 @@ | |||
908 | 24 | from lp.bugs.externalbugtracker.isolation import ensure_no_transaction | 23 | from lp.bugs.externalbugtracker.isolation import ensure_no_transaction |
909 | 25 | from lp.bugs.interfaces.bugtask import BugTaskStatus | 24 | from lp.bugs.interfaces.bugtask import BugTaskStatus |
910 | 26 | from lp.bugs.interfaces.externalbugtracker import UNKNOWN_REMOTE_IMPORTANCE | 25 | from lp.bugs.interfaces.externalbugtracker import UNKNOWN_REMOTE_IMPORTANCE |
911 | 26 | from lp.services.propertycache import cachedproperty | ||
912 | 27 | 27 | ||
913 | 28 | 28 | ||
914 | 29 | class RequestTracker(ExternalBugTracker): | 29 | class RequestTracker(ExternalBugTracker): |
915 | 30 | 30 | ||
916 | === modified file 'lib/lp/bugs/model/bug.py' | |||
917 | --- lib/lp/bugs/model/bug.py 2010-08-31 23:22:19 +0000 | |||
918 | +++ lib/lp/bugs/model/bug.py 2010-09-02 12:57:56 +0000 | |||
919 | @@ -70,11 +70,6 @@ | |||
920 | 70 | providedBy, | 70 | providedBy, |
921 | 71 | ) | 71 | ) |
922 | 72 | 72 | ||
923 | 73 | from canonical.cachedproperty import ( | ||
924 | 74 | cachedproperty, | ||
925 | 75 | cache_property, | ||
926 | 76 | clear_property, | ||
927 | 77 | ) | ||
928 | 78 | from canonical.config import config | 73 | from canonical.config import config |
929 | 79 | from canonical.database.constants import UTC_NOW | 74 | from canonical.database.constants import UTC_NOW |
930 | 80 | from canonical.database.datetimecol import UtcDateTimeCol | 75 | from canonical.database.datetimecol import UtcDateTimeCol |
931 | @@ -83,7 +78,9 @@ | |||
932 | 83 | SQLBase, | 78 | SQLBase, |
933 | 84 | sqlvalues, | 79 | sqlvalues, |
934 | 85 | ) | 80 | ) |
936 | 86 | from canonical.launchpad.components.decoratedresultset import DecoratedResultSet | 81 | from canonical.launchpad.components.decoratedresultset import ( |
937 | 82 | DecoratedResultSet, | ||
938 | 83 | ) | ||
939 | 87 | from canonical.launchpad.database.librarian import LibraryFileAlias | 84 | from canonical.launchpad.database.librarian import LibraryFileAlias |
940 | 88 | from canonical.launchpad.database.message import ( | 85 | from canonical.launchpad.database.message import ( |
941 | 89 | Message, | 86 | Message, |
942 | @@ -189,6 +186,10 @@ | |||
943 | 189 | from lp.registry.model.pillar import pillar_sort_key | 186 | from lp.registry.model.pillar import pillar_sort_key |
944 | 190 | from lp.registry.model.teammembership import TeamParticipation | 187 | from lp.registry.model.teammembership import TeamParticipation |
945 | 191 | from lp.services.fields import DuplicateBug | 188 | from lp.services.fields import DuplicateBug |
946 | 189 | from lp.services.propertycache import ( | ||
947 | 190 | cachedproperty, | ||
948 | 191 | IPropertyCache, | ||
949 | 192 | ) | ||
950 | 192 | 193 | ||
951 | 193 | 194 | ||
952 | 194 | _bug_tag_query_template = """ | 195 | _bug_tag_query_template = """ |
953 | @@ -636,7 +637,7 @@ | |||
954 | 636 | # disabled see the change. | 637 | # disabled see the change. |
955 | 637 | store.flush() | 638 | store.flush() |
956 | 638 | self.updateHeat() | 639 | self.updateHeat() |
958 | 639 | clear_property(self, '_cached_viewers') | 640 | del IPropertyCache(self)._known_viewers |
959 | 640 | return | 641 | return |
960 | 641 | 642 | ||
961 | 642 | def unsubscribeFromDupes(self, person, unsubscribed_by): | 643 | def unsubscribeFromDupes(self, person, unsubscribed_by): |
962 | @@ -1658,7 +1659,7 @@ | |||
963 | 1658 | self, self.messages[comment_number]) | 1659 | self, self.messages[comment_number]) |
964 | 1659 | bug_message.visible = visible | 1660 | bug_message.visible = visible |
965 | 1660 | 1661 | ||
967 | 1661 | @cachedproperty('_cached_viewers') | 1662 | @cachedproperty |
968 | 1662 | def _known_viewers(self): | 1663 | def _known_viewers(self): |
969 | 1663 | """A dict of of known persons able to view this bug.""" | 1664 | """A dict of of known persons able to view this bug.""" |
970 | 1664 | return set() | 1665 | return set() |
971 | @@ -1775,7 +1776,7 @@ | |||
972 | 1775 | @property | 1776 | @property |
973 | 1776 | def attachments(self): | 1777 | def attachments(self): |
974 | 1777 | """See `IBug`. | 1778 | """See `IBug`. |
976 | 1778 | 1779 | ||
977 | 1779 | This property does eager loading of the index_messages so that the API | 1780 | This property does eager loading of the index_messages so that the API |
978 | 1780 | which wants the message_link for the attachment can answer that without | 1781 | which wants the message_link for the attachment can answer that without |
979 | 1781 | O(N^2) overhead. As such it is moderately expensive to call (it | 1782 | O(N^2) overhead. As such it is moderately expensive to call (it |
980 | @@ -1791,7 +1792,7 @@ | |||
981 | 1791 | # will be found without a query when dereferenced. | 1792 | # will be found without a query when dereferenced. |
982 | 1792 | indexed_message = message_to_indexed.get(attachment._messageID) | 1793 | indexed_message = message_to_indexed.get(attachment._messageID) |
983 | 1793 | if indexed_message is not None: | 1794 | if indexed_message is not None: |
985 | 1794 | cache_property(attachment, '_message_cached', indexed_message) | 1795 | IPropertyCache(attachment).message = indexed_message |
986 | 1795 | return attachment | 1796 | return attachment |
987 | 1796 | rawresults = self._attachments_query() | 1797 | rawresults = self._attachments_query() |
988 | 1797 | return DecoratedResultSet(rawresults, set_indexed_message) | 1798 | return DecoratedResultSet(rawresults, set_indexed_message) |
989 | @@ -1799,9 +1800,9 @@ | |||
990 | 1799 | @property | 1800 | @property |
991 | 1800 | def attachments_unpopulated(self): | 1801 | def attachments_unpopulated(self): |
992 | 1801 | """See `IBug`. | 1802 | """See `IBug`. |
994 | 1802 | 1803 | ||
995 | 1803 | This version does not pre-lookup messages and LibraryFileAliases. | 1804 | This version does not pre-lookup messages and LibraryFileAliases. |
997 | 1804 | 1805 | ||
998 | 1805 | The regular 'attachments' property does prepopulation because it is | 1806 | The regular 'attachments' property does prepopulation because it is |
999 | 1806 | exposed in the API. | 1807 | exposed in the API. |
1000 | 1807 | """ | 1808 | """ |
1001 | 1808 | 1809 | ||
1002 | === modified file 'lib/lp/bugs/model/bugattachment.py' | |||
1003 | --- lib/lp/bugs/model/bugattachment.py 2010-08-29 22:26:36 +0000 | |||
1004 | +++ lib/lp/bugs/model/bugattachment.py 2010-09-02 12:57:56 +0000 | |||
1005 | @@ -19,7 +19,6 @@ | |||
1006 | 19 | from zope.event import notify | 19 | from zope.event import notify |
1007 | 20 | from zope.interface import implements | 20 | from zope.interface import implements |
1008 | 21 | 21 | ||
1009 | 22 | from canonical.cachedproperty import cachedproperty | ||
1010 | 23 | from canonical.database.enumcol import EnumCol | 22 | from canonical.database.enumcol import EnumCol |
1011 | 24 | from canonical.database.sqlbase import SQLBase | 23 | from canonical.database.sqlbase import SQLBase |
1012 | 25 | from lp.app.errors import NotFoundError | 24 | from lp.app.errors import NotFoundError |
1013 | @@ -28,6 +27,7 @@ | |||
1014 | 28 | IBugAttachment, | 27 | IBugAttachment, |
1015 | 29 | IBugAttachmentSet, | 28 | IBugAttachmentSet, |
1016 | 30 | ) | 29 | ) |
1017 | 30 | from lp.services.propertycache import cachedproperty | ||
1018 | 31 | 31 | ||
1019 | 32 | 32 | ||
1020 | 33 | class BugAttachment(SQLBase): | 33 | class BugAttachment(SQLBase): |
1021 | @@ -50,10 +50,10 @@ | |||
1022 | 50 | _message = ForeignKey( | 50 | _message = ForeignKey( |
1023 | 51 | foreignKey='Message', dbName='message', notNull=True) | 51 | foreignKey='Message', dbName='message', notNull=True) |
1024 | 52 | 52 | ||
1026 | 53 | @cachedproperty('_message_cached') | 53 | @cachedproperty |
1027 | 54 | def message(self): | 54 | def message(self): |
1028 | 55 | """This is a cachedproperty to allow message to be an IIndexedMessage. | 55 | """This is a cachedproperty to allow message to be an IIndexedMessage. |
1030 | 56 | 56 | ||
1031 | 57 | This is needed for the bug/attachments API call which needs to index | 57 | This is needed for the bug/attachments API call which needs to index |
1032 | 58 | an IIndexedMessage rather than a simple DB model IMessage. See | 58 | an IIndexedMessage rather than a simple DB model IMessage. See |
1033 | 59 | Bug.attachments where the injection occurs. | 59 | Bug.attachments where the injection occurs. |
1034 | 60 | 60 | ||
1035 | === modified file 'lib/lp/bugs/model/bugtask.py' | |||
1036 | --- lib/lp/bugs/model/bugtask.py 2010-08-30 19:30:45 +0000 | |||
1037 | +++ lib/lp/bugs/model/bugtask.py 2010-09-02 12:57:56 +0000 | |||
1038 | @@ -58,7 +58,6 @@ | |||
1039 | 58 | removeSecurityProxy, | 58 | removeSecurityProxy, |
1040 | 59 | ) | 59 | ) |
1041 | 60 | 60 | ||
1042 | 61 | from canonical.cachedproperty import cache_property | ||
1043 | 62 | from canonical.config import config | 61 | from canonical.config import config |
1044 | 63 | from canonical.database.constants import UTC_NOW | 62 | from canonical.database.constants import UTC_NOW |
1045 | 64 | from canonical.database.datetimecol import UtcDateTimeCol | 63 | from canonical.database.datetimecol import UtcDateTimeCol |
1046 | @@ -153,6 +152,7 @@ | |||
1047 | 153 | from lp.registry.interfaces.sourcepackagename import ISourcePackageNameSet | 152 | from lp.registry.interfaces.sourcepackagename import ISourcePackageNameSet |
1048 | 154 | from lp.registry.model.pillar import pillar_sort_key | 153 | from lp.registry.model.pillar import pillar_sort_key |
1049 | 155 | from lp.registry.model.sourcepackagename import SourcePackageName | 154 | from lp.registry.model.sourcepackagename import SourcePackageName |
1050 | 155 | from lp.services.propertycache import IPropertyCache | ||
1051 | 156 | from lp.soyuz.enums import PackagePublishingStatus | 156 | from lp.soyuz.enums import PackagePublishingStatus |
1052 | 157 | from lp.soyuz.model.publishing import SourcePackagePublishingHistory | 157 | from lp.soyuz.model.publishing import SourcePackagePublishingHistory |
1053 | 158 | from lp.soyuz.model.sourcepackagerelease import SourcePackageRelease | 158 | from lp.soyuz.model.sourcepackagerelease import SourcePackageRelease |
1054 | @@ -1338,7 +1338,7 @@ | |||
1055 | 1338 | """ | 1338 | """ |
1056 | 1339 | userid = user.id | 1339 | userid = user.id |
1057 | 1340 | def cache_user_can_view_bug(bugtask): | 1340 | def cache_user_can_view_bug(bugtask): |
1059 | 1341 | cache_property(bugtask.bug, '_cached_viewers', set([userid])) | 1341 | IPropertyCache(bugtask.bug)._known_viewers = set([userid]) |
1060 | 1342 | return bugtask | 1342 | return bugtask |
1061 | 1343 | return cache_user_can_view_bug | 1343 | return cache_user_can_view_bug |
1062 | 1344 | 1344 | ||
1063 | 1345 | 1345 | ||
1064 | === modified file 'lib/lp/bugs/tests/externalbugtracker.py' | |||
1065 | --- lib/lp/bugs/tests/externalbugtracker.py 2010-08-21 07:31:45 +0000 | |||
1066 | +++ lib/lp/bugs/tests/externalbugtracker.py 2010-09-02 12:57:56 +0000 | |||
1067 | @@ -1102,14 +1102,6 @@ | |||
1068 | 1102 | print "CALLED _postPage(%r, ...)" % (page) | 1102 | print "CALLED _postPage(%r, ...)" % (page) |
1069 | 1103 | return '' | 1103 | return '' |
1070 | 1104 | 1104 | ||
1071 | 1105 | def cleanCache(self): | ||
1072 | 1106 | """Clean the csv_data cache.""" | ||
1073 | 1107 | # Remove the self._csv_data_cached_value if it exists. | ||
1074 | 1108 | try: | ||
1075 | 1109 | del self._csv_data_cached_value | ||
1076 | 1110 | except AttributeError: | ||
1077 | 1111 | pass | ||
1078 | 1112 | |||
1079 | 1113 | 1105 | ||
1080 | 1114 | class TestTrac(Trac): | 1106 | class TestTrac(Trac): |
1081 | 1115 | """Trac ExternalBugTracker for testing purposes. | 1107 | """Trac ExternalBugTracker for testing purposes. |
1082 | 1116 | 1108 | ||
1083 | === modified file 'lib/lp/buildmaster/model/builder.py' | |||
1084 | --- lib/lp/buildmaster/model/builder.py 2010-08-23 10:38:44 +0000 | |||
1085 | +++ lib/lp/buildmaster/model/builder.py 2010-09-02 12:57:56 +0000 | |||
1086 | @@ -38,7 +38,6 @@ | |||
1087 | 38 | from zope.interface import implements | 38 | from zope.interface import implements |
1088 | 39 | 39 | ||
1089 | 40 | from canonical.buildd.slave import BuilderStatus | 40 | from canonical.buildd.slave import BuilderStatus |
1090 | 41 | from canonical.cachedproperty import cachedproperty | ||
1091 | 42 | from canonical.config import config | 41 | from canonical.config import config |
1092 | 43 | from canonical.database.sqlbase import ( | 42 | from canonical.database.sqlbase import ( |
1093 | 44 | SQLBase, | 43 | SQLBase, |
1094 | @@ -80,6 +79,7 @@ | |||
1095 | 80 | from lp.services.job.interfaces.job import JobStatus | 79 | from lp.services.job.interfaces.job import JobStatus |
1096 | 81 | from lp.services.job.model.job import Job | 80 | from lp.services.job.model.job import Job |
1097 | 82 | from lp.services.osutils import until_no_eintr | 81 | from lp.services.osutils import until_no_eintr |
1098 | 82 | from lp.services.propertycache import cachedproperty | ||
1099 | 83 | # XXX Michael Nelson 2010-01-13 bug=491330 | 83 | # XXX Michael Nelson 2010-01-13 bug=491330 |
1100 | 84 | # These dependencies on soyuz will be removed when getBuildRecords() | 84 | # These dependencies on soyuz will be removed when getBuildRecords() |
1101 | 85 | # is moved. | 85 | # is moved. |
1102 | 86 | 86 | ||
1103 | === modified file 'lib/lp/code/browser/bazaar.py' | |||
1104 | --- lib/lp/code/browser/bazaar.py 2010-08-31 01:11:34 +0000 | |||
1105 | +++ lib/lp/code/browser/bazaar.py 2010-09-02 12:57:56 +0000 | |||
1106 | @@ -15,7 +15,6 @@ | |||
1107 | 15 | import bzrlib | 15 | import bzrlib |
1108 | 16 | from zope.component import getUtility | 16 | from zope.component import getUtility |
1109 | 17 | 17 | ||
1110 | 18 | from canonical.cachedproperty import cachedproperty | ||
1111 | 19 | from canonical.config import config | 18 | from canonical.config import config |
1112 | 20 | from canonical.launchpad.webapp import ( | 19 | from canonical.launchpad.webapp import ( |
1113 | 21 | canonical_url, | 20 | canonical_url, |
1114 | @@ -32,6 +31,7 @@ | |||
1115 | 32 | from lp.code.interfaces.branchcollection import IAllBranches | 31 | from lp.code.interfaces.branchcollection import IAllBranches |
1116 | 33 | from lp.code.interfaces.codeimport import ICodeImportSet | 32 | from lp.code.interfaces.codeimport import ICodeImportSet |
1117 | 34 | from lp.registry.interfaces.product import IProductSet | 33 | from lp.registry.interfaces.product import IProductSet |
1118 | 34 | from lp.services.propertycache import cachedproperty | ||
1119 | 35 | 35 | ||
1120 | 36 | 36 | ||
1121 | 37 | class BazaarApplicationView(LaunchpadView): | 37 | class BazaarApplicationView(LaunchpadView): |
1122 | 38 | 38 | ||
1123 | === modified file 'lib/lp/code/browser/branch.py' | |||
1124 | --- lib/lp/code/browser/branch.py 2010-08-20 20:31:18 +0000 | |||
1125 | +++ lib/lp/code/browser/branch.py 2010-09-02 12:57:56 +0000 | |||
1126 | @@ -72,7 +72,6 @@ | |||
1127 | 72 | ) | 72 | ) |
1128 | 73 | from zope.traversing.interfaces import IPathAdapter | 73 | from zope.traversing.interfaces import IPathAdapter |
1129 | 74 | 74 | ||
1130 | 75 | from canonical.cachedproperty import cachedproperty | ||
1131 | 76 | from canonical.config import config | 75 | from canonical.config import config |
1132 | 77 | from canonical.database.constants import UTC_NOW | 76 | from canonical.database.constants import UTC_NOW |
1133 | 78 | from canonical.launchpad import _ | 77 | from canonical.launchpad import _ |
1134 | @@ -145,6 +144,7 @@ | |||
1135 | 145 | ) | 144 | ) |
1136 | 146 | from lp.registry.interfaces.productseries import IProductSeries | 145 | from lp.registry.interfaces.productseries import IProductSeries |
1137 | 147 | from lp.registry.vocabularies import UserTeamsParticipationPlusSelfVocabulary | 146 | from lp.registry.vocabularies import UserTeamsParticipationPlusSelfVocabulary |
1138 | 147 | from lp.services.propertycache import cachedproperty | ||
1139 | 148 | 148 | ||
1140 | 149 | 149 | ||
1141 | 150 | def quote(text): | 150 | def quote(text): |
1142 | 151 | 151 | ||
1143 | === modified file 'lib/lp/code/browser/branchlisting.py' | |||
1144 | --- lib/lp/code/browser/branchlisting.py 2010-08-23 04:48:17 +0000 | |||
1145 | +++ lib/lp/code/browser/branchlisting.py 2010-09-02 12:57:56 +0000 | |||
1146 | @@ -52,7 +52,6 @@ | |||
1147 | 52 | ) | 52 | ) |
1148 | 53 | from zope.schema import Choice | 53 | from zope.schema import Choice |
1149 | 54 | 54 | ||
1150 | 55 | from canonical.cachedproperty import cachedproperty | ||
1151 | 56 | from canonical.config import config | 55 | from canonical.config import config |
1152 | 57 | from canonical.launchpad import _ | 56 | from canonical.launchpad import _ |
1153 | 58 | from canonical.launchpad.browser.feeds import ( | 57 | from canonical.launchpad.browser.feeds import ( |
1154 | @@ -131,6 +130,7 @@ | |||
1155 | 131 | from lp.registry.interfaces.sourcepackage import ISourcePackageFactory | 130 | from lp.registry.interfaces.sourcepackage import ISourcePackageFactory |
1156 | 132 | from lp.registry.model.sourcepackage import SourcePackage | 131 | from lp.registry.model.sourcepackage import SourcePackage |
1157 | 133 | from lp.services.browser_helpers import get_plural_text | 132 | from lp.services.browser_helpers import get_plural_text |
1158 | 133 | from lp.services.propertycache import cachedproperty | ||
1159 | 134 | 134 | ||
1160 | 135 | 135 | ||
1161 | 136 | class CodeVHostBreadcrumb(Breadcrumb): | 136 | class CodeVHostBreadcrumb(Breadcrumb): |
1162 | 137 | 137 | ||
1163 | === modified file 'lib/lp/code/browser/branchmergeproposal.py' | |||
1164 | --- lib/lp/code/browser/branchmergeproposal.py 2010-08-20 20:31:18 +0000 | |||
1165 | +++ lib/lp/code/browser/branchmergeproposal.py 2010-09-02 12:57:56 +0000 | |||
1166 | @@ -68,7 +68,6 @@ | |||
1167 | 68 | SimpleVocabulary, | 68 | SimpleVocabulary, |
1168 | 69 | ) | 69 | ) |
1169 | 70 | 70 | ||
1170 | 71 | from canonical.cachedproperty import cachedproperty | ||
1171 | 72 | from canonical.config import config | 71 | from canonical.config import config |
1172 | 73 | from canonical.launchpad import _ | 72 | from canonical.launchpad import _ |
1173 | 74 | from canonical.launchpad.interfaces.message import IMessageSet | 73 | from canonical.launchpad.interfaces.message import IMessageSet |
1174 | @@ -122,6 +121,7 @@ | |||
1175 | 122 | Summary, | 121 | Summary, |
1176 | 123 | Whiteboard, | 122 | Whiteboard, |
1177 | 124 | ) | 123 | ) |
1178 | 124 | from lp.services.propertycache import cachedproperty | ||
1179 | 125 | 125 | ||
1180 | 126 | 126 | ||
1181 | 127 | def latest_proposals_for_each_branch(proposals): | 127 | def latest_proposals_for_each_branch(proposals): |
1182 | 128 | 128 | ||
1183 | === modified file 'lib/lp/code/browser/branchmergeproposallisting.py' | |||
1184 | --- lib/lp/code/browser/branchmergeproposallisting.py 2010-08-20 20:31:18 +0000 | |||
1185 | +++ lib/lp/code/browser/branchmergeproposallisting.py 2010-09-02 12:57:56 +0000 | |||
1186 | @@ -29,7 +29,6 @@ | |||
1187 | 29 | ) | 29 | ) |
1188 | 30 | from zope.schema import Choice | 30 | from zope.schema import Choice |
1189 | 31 | 31 | ||
1190 | 32 | from canonical.cachedproperty import cachedproperty | ||
1191 | 33 | from canonical.config import config | 32 | from canonical.config import config |
1192 | 34 | from canonical.launchpad import _ | 33 | from canonical.launchpad import _ |
1193 | 35 | from canonical.launchpad.webapp import ( | 34 | from canonical.launchpad.webapp import ( |
1194 | @@ -53,6 +52,7 @@ | |||
1195 | 53 | IBranchMergeProposalListingBatchNavigator, | 52 | IBranchMergeProposalListingBatchNavigator, |
1196 | 54 | ) | 53 | ) |
1197 | 55 | from lp.code.interfaces.hasbranches import IHasMergeProposals | 54 | from lp.code.interfaces.hasbranches import IHasMergeProposals |
1198 | 55 | from lp.services.propertycache import cachedproperty | ||
1199 | 56 | 56 | ||
1200 | 57 | 57 | ||
1201 | 58 | class BranchMergeProposalListingItem: | 58 | class BranchMergeProposalListingItem: |
1202 | 59 | 59 | ||
1203 | === modified file 'lib/lp/code/browser/branchvisibilitypolicy.py' | |||
1204 | --- lib/lp/code/browser/branchvisibilitypolicy.py 2010-08-23 03:30:54 +0000 | |||
1205 | +++ lib/lp/code/browser/branchvisibilitypolicy.py 2010-09-02 12:57:56 +0000 | |||
1206 | @@ -22,7 +22,6 @@ | |||
1207 | 22 | SimpleVocabulary, | 22 | SimpleVocabulary, |
1208 | 23 | ) | 23 | ) |
1209 | 24 | 24 | ||
1210 | 25 | from canonical.cachedproperty import cachedproperty | ||
1211 | 26 | from canonical.launchpad import _ | 25 | from canonical.launchpad import _ |
1212 | 27 | from canonical.launchpad.webapp import ( | 26 | from canonical.launchpad.webapp import ( |
1213 | 28 | action, | 27 | action, |
1214 | @@ -42,6 +41,7 @@ | |||
1215 | 42 | from lp.code.interfaces.branchvisibilitypolicy import ( | 41 | from lp.code.interfaces.branchvisibilitypolicy import ( |
1216 | 43 | IBranchVisibilityTeamPolicy, | 42 | IBranchVisibilityTeamPolicy, |
1217 | 44 | ) | 43 | ) |
1218 | 44 | from lp.services.propertycache import cachedproperty | ||
1219 | 45 | 45 | ||
1220 | 46 | 46 | ||
1221 | 47 | class BaseBranchVisibilityTeamPolicyView(LaunchpadFormView): | 47 | class BaseBranchVisibilityTeamPolicyView(LaunchpadFormView): |
1222 | 48 | 48 | ||
1223 | === modified file 'lib/lp/code/browser/codeimport.py' | |||
1224 | --- lib/lp/code/browser/codeimport.py 2010-08-20 20:31:18 +0000 | |||
1225 | +++ lib/lp/code/browser/codeimport.py 2010-09-02 12:57:56 +0000 | |||
1226 | @@ -29,7 +29,6 @@ | |||
1227 | 29 | from zope.interface import Interface | 29 | from zope.interface import Interface |
1228 | 30 | from zope.schema import Choice | 30 | from zope.schema import Choice |
1229 | 31 | 31 | ||
1230 | 32 | from canonical.cachedproperty import cachedproperty | ||
1231 | 33 | from canonical.launchpad import _ | 32 | from canonical.launchpad import _ |
1232 | 34 | from canonical.launchpad.interfaces.launchpad import ILaunchpadCelebrities | 33 | from canonical.launchpad.interfaces.launchpad import ILaunchpadCelebrities |
1233 | 35 | from canonical.launchpad.webapp import ( | 34 | from canonical.launchpad.webapp import ( |
1234 | @@ -75,6 +74,7 @@ | |||
1235 | 75 | from lp.code.interfaces.codeimportmachine import ICodeImportMachineSet | 74 | from lp.code.interfaces.codeimportmachine import ICodeImportMachineSet |
1236 | 76 | from lp.registry.interfaces.product import IProduct | 75 | from lp.registry.interfaces.product import IProduct |
1237 | 77 | from lp.services.fields import URIField | 76 | from lp.services.fields import URIField |
1238 | 77 | from lp.services.propertycache import cachedproperty | ||
1239 | 78 | 78 | ||
1240 | 79 | 79 | ||
1241 | 80 | class CodeImportSetNavigation(Navigation): | 80 | class CodeImportSetNavigation(Navigation): |
1242 | 81 | 81 | ||
1243 | === modified file 'lib/lp/code/browser/codeimportmachine.py' | |||
1244 | --- lib/lp/code/browser/codeimportmachine.py 2010-08-20 20:31:18 +0000 | |||
1245 | +++ lib/lp/code/browser/codeimportmachine.py 2010-09-02 12:57:56 +0000 | |||
1246 | @@ -19,7 +19,6 @@ | |||
1247 | 19 | from zope.interface import Interface | 19 | from zope.interface import Interface |
1248 | 20 | from zope.schema import TextLine | 20 | from zope.schema import TextLine |
1249 | 21 | 21 | ||
1250 | 22 | from canonical.cachedproperty import cachedproperty | ||
1251 | 23 | from canonical.launchpad import _ | 22 | from canonical.launchpad import _ |
1252 | 24 | from canonical.launchpad.webapp import ( | 23 | from canonical.launchpad.webapp import ( |
1253 | 25 | action, | 24 | action, |
1254 | @@ -35,6 +34,7 @@ | |||
1255 | 35 | ) | 34 | ) |
1256 | 36 | from lp.code.interfaces.codeimportevent import ICodeImportEvent | 35 | from lp.code.interfaces.codeimportevent import ICodeImportEvent |
1257 | 37 | from lp.code.interfaces.codeimportmachine import ICodeImportMachineSet | 36 | from lp.code.interfaces.codeimportmachine import ICodeImportMachineSet |
1258 | 37 | from lp.services.propertycache import cachedproperty | ||
1259 | 38 | 38 | ||
1260 | 39 | 39 | ||
1261 | 40 | class CodeImportMachineBreadcrumb(Breadcrumb): | 40 | class CodeImportMachineBreadcrumb(Breadcrumb): |
1262 | 41 | 41 | ||
1263 | === modified file 'lib/lp/code/browser/codereviewcomment.py' | |||
1264 | --- lib/lp/code/browser/codereviewcomment.py 2010-08-20 20:31:18 +0000 | |||
1265 | +++ lib/lp/code/browser/codereviewcomment.py 2010-09-02 12:57:56 +0000 | |||
1266 | @@ -24,7 +24,6 @@ | |||
1267 | 24 | ) | 24 | ) |
1268 | 25 | from zope.schema import Text | 25 | from zope.schema import Text |
1269 | 26 | 26 | ||
1270 | 27 | from canonical.cachedproperty import cachedproperty | ||
1271 | 28 | from canonical.config import config | 27 | from canonical.config import config |
1272 | 29 | from canonical.launchpad import _ | 28 | from canonical.launchpad import _ |
1273 | 30 | from canonical.launchpad.interfaces import ILibraryFileAlias | 29 | from canonical.launchpad.interfaces import ILibraryFileAlias |
1274 | @@ -41,6 +40,7 @@ | |||
1275 | 41 | from lp.code.interfaces.codereviewcomment import ICodeReviewComment | 40 | from lp.code.interfaces.codereviewcomment import ICodeReviewComment |
1276 | 42 | from lp.code.interfaces.codereviewvote import ICodeReviewVoteReference | 41 | from lp.code.interfaces.codereviewvote import ICodeReviewVoteReference |
1277 | 43 | from lp.services.comments.interfaces.conversation import IComment | 42 | from lp.services.comments.interfaces.conversation import IComment |
1278 | 43 | from lp.services.propertycache import cachedproperty | ||
1279 | 44 | 44 | ||
1280 | 45 | 45 | ||
1281 | 46 | class CodeReviewDisplayComment: | 46 | class CodeReviewDisplayComment: |
1282 | 47 | 47 | ||
1283 | === modified file 'lib/lp/code/browser/decorations.py' | |||
1284 | --- lib/lp/code/browser/decorations.py 2010-08-20 20:31:18 +0000 | |||
1285 | +++ lib/lp/code/browser/decorations.py 2010-09-02 12:57:56 +0000 | |||
1286 | @@ -14,13 +14,13 @@ | |||
1287 | 14 | 14 | ||
1288 | 15 | from lazr.delegates import delegates | 15 | from lazr.delegates import delegates |
1289 | 16 | 16 | ||
1290 | 17 | from canonical.cachedproperty import cachedproperty | ||
1291 | 18 | from canonical.launchpad.webapp.authorization import check_permission | 17 | from canonical.launchpad.webapp.authorization import check_permission |
1292 | 19 | from lp.bugs.interfaces.bug import IBug | 18 | from lp.bugs.interfaces.bug import IBug |
1293 | 20 | from lp.code.interfaces.branch import ( | 19 | from lp.code.interfaces.branch import ( |
1294 | 21 | BzrIdentityMixin, | 20 | BzrIdentityMixin, |
1295 | 22 | IBranch, | 21 | IBranch, |
1296 | 23 | ) | 22 | ) |
1297 | 23 | from lp.services.propertycache import cachedproperty | ||
1298 | 24 | 24 | ||
1299 | 25 | 25 | ||
1300 | 26 | class DecoratedBug: | 26 | class DecoratedBug: |
1301 | 27 | 27 | ||
1302 | === modified file 'lib/lp/code/browser/summary.py' | |||
1303 | --- lib/lp/code/browser/summary.py 2010-08-20 20:31:18 +0000 | |||
1304 | +++ lib/lp/code/browser/summary.py 2010-09-02 12:57:56 +0000 | |||
1305 | @@ -9,13 +9,13 @@ | |||
1306 | 9 | ] | 9 | ] |
1307 | 10 | 10 | ||
1308 | 11 | 11 | ||
1309 | 12 | from canonical.cachedproperty import cachedproperty | ||
1310 | 13 | from canonical.launchpad import _ | 12 | from canonical.launchpad import _ |
1311 | 14 | from canonical.launchpad.webapp.publisher import LaunchpadView | 13 | from canonical.launchpad.webapp.publisher import LaunchpadView |
1312 | 15 | from lp.code.interfaces.branch import DEFAULT_BRANCH_STATUS_IN_LISTING | 14 | from lp.code.interfaces.branch import DEFAULT_BRANCH_STATUS_IN_LISTING |
1313 | 16 | from lp.code.interfaces.branchcollection import IBranchCollection | 15 | from lp.code.interfaces.branchcollection import IBranchCollection |
1314 | 17 | from lp.code.interfaces.revisioncache import IRevisionCache | 16 | from lp.code.interfaces.revisioncache import IRevisionCache |
1315 | 18 | from lp.services.browser_helpers import get_plural_text | 17 | from lp.services.browser_helpers import get_plural_text |
1316 | 18 | from lp.services.propertycache import cachedproperty | ||
1317 | 19 | 19 | ||
1318 | 20 | 20 | ||
1319 | 21 | class BranchCountSummaryView(LaunchpadView): | 21 | class BranchCountSummaryView(LaunchpadView): |
1320 | 22 | 22 | ||
1321 | === modified file 'lib/lp/code/feed/branch.py' | |||
1322 | --- lib/lp/code/feed/branch.py 2010-08-20 20:31:18 +0000 | |||
1323 | +++ lib/lp/code/feed/branch.py 2010-09-02 12:57:56 +0000 | |||
1324 | @@ -24,7 +24,6 @@ | |||
1325 | 24 | from zope.interface import implements | 24 | from zope.interface import implements |
1326 | 25 | from zope.security.interfaces import Unauthorized | 25 | from zope.security.interfaces import Unauthorized |
1327 | 26 | 26 | ||
1328 | 27 | from canonical.cachedproperty import cachedproperty | ||
1329 | 28 | from canonical.config import config | 27 | from canonical.config import config |
1330 | 29 | from canonical.launchpad.webapp import ( | 28 | from canonical.launchpad.webapp import ( |
1331 | 30 | canonical_url, | 29 | canonical_url, |
1332 | @@ -49,6 +48,7 @@ | |||
1333 | 49 | from lp.registry.interfaces.person import IPerson | 48 | from lp.registry.interfaces.person import IPerson |
1334 | 50 | from lp.registry.interfaces.product import IProduct | 49 | from lp.registry.interfaces.product import IProduct |
1335 | 51 | from lp.registry.interfaces.projectgroup import IProjectGroup | 50 | from lp.registry.interfaces.projectgroup import IProjectGroup |
1336 | 51 | from lp.services.propertycache import cachedproperty | ||
1337 | 52 | 52 | ||
1338 | 53 | 53 | ||
1339 | 54 | def revision_feed_id(revision): | 54 | def revision_feed_id(revision): |
1340 | 55 | 55 | ||
1341 | === modified file 'lib/lp/code/model/branchvisibilitypolicy.py' | |||
1342 | --- lib/lp/code/model/branchvisibilitypolicy.py 2010-08-20 20:31:18 +0000 | |||
1343 | +++ lib/lp/code/model/branchvisibilitypolicy.py 2010-09-02 12:57:56 +0000 | |||
1344 | @@ -15,7 +15,6 @@ | |||
1345 | 15 | from sqlobject import ForeignKey | 15 | from sqlobject import ForeignKey |
1346 | 16 | from zope.interface import implements | 16 | from zope.interface import implements |
1347 | 17 | 17 | ||
1348 | 18 | from canonical.cachedproperty import cachedproperty | ||
1349 | 19 | from canonical.database.enumcol import EnumCol | 18 | from canonical.database.enumcol import EnumCol |
1350 | 20 | from canonical.database.sqlbase import SQLBase | 19 | from canonical.database.sqlbase import SQLBase |
1351 | 21 | from canonical.launchpad.helpers import shortlist | 20 | from canonical.launchpad.helpers import shortlist |
1352 | @@ -27,6 +26,7 @@ | |||
1353 | 27 | from lp.registry.interfaces.person import validate_person | 26 | from lp.registry.interfaces.person import validate_person |
1354 | 28 | from lp.registry.interfaces.product import IProduct | 27 | from lp.registry.interfaces.product import IProduct |
1355 | 29 | from lp.registry.interfaces.projectgroup import IProjectGroup | 28 | from lp.registry.interfaces.projectgroup import IProjectGroup |
1356 | 29 | from lp.services.propertycache import cachedproperty | ||
1357 | 30 | 30 | ||
1358 | 31 | 31 | ||
1359 | 32 | class BranchVisibilityTeamPolicy(SQLBase): | 32 | class BranchVisibilityTeamPolicy(SQLBase): |
1360 | 33 | 33 | ||
1361 | === modified file 'lib/lp/codehosting/codeimport/worker.py' | |||
1362 | --- lib/lp/codehosting/codeimport/worker.py 2010-08-20 20:31:18 +0000 | |||
1363 | +++ lib/lp/codehosting/codeimport/worker.py 2010-09-02 12:57:56 +0000 | |||
1364 | @@ -45,7 +45,6 @@ | |||
1365 | 45 | import CVS | 45 | import CVS |
1366 | 46 | import SCM | 46 | import SCM |
1367 | 47 | 47 | ||
1368 | 48 | from canonical.cachedproperty import cachedproperty | ||
1369 | 49 | from canonical.config import config | 48 | from canonical.config import config |
1370 | 50 | from lp.code.enums import RevisionControlSystems | 49 | from lp.code.enums import RevisionControlSystems |
1371 | 51 | from lp.codehosting.codeimport.foreigntree import ( | 50 | from lp.codehosting.codeimport.foreigntree import ( |
1372 | @@ -57,6 +56,7 @@ | |||
1373 | 57 | extract_tarball, | 56 | extract_tarball, |
1374 | 58 | ) | 57 | ) |
1375 | 59 | from lp.codehosting.codeimport.uifactory import LoggingUIFactory | 58 | from lp.codehosting.codeimport.uifactory import LoggingUIFactory |
1376 | 59 | from lp.services.propertycache import cachedproperty | ||
1377 | 60 | 60 | ||
1378 | 61 | 61 | ||
1379 | 62 | class CodeImportWorkerExitCode: | 62 | class CodeImportWorkerExitCode: |
1380 | 63 | 63 | ||
1381 | === modified file 'lib/lp/codehosting/puller/scheduler.py' | |||
1382 | --- lib/lp/codehosting/puller/scheduler.py 2010-08-20 20:31:18 +0000 | |||
1383 | +++ lib/lp/codehosting/puller/scheduler.py 2010-09-02 12:57:56 +0000 | |||
1384 | @@ -34,12 +34,12 @@ | |||
1385 | 34 | log, | 34 | log, |
1386 | 35 | ) | 35 | ) |
1387 | 36 | 36 | ||
1388 | 37 | from canonical.cachedproperty import cachedproperty | ||
1389 | 38 | from canonical.config import config | 37 | from canonical.config import config |
1390 | 39 | from canonical.launchpad.webapp import errorlog | 38 | from canonical.launchpad.webapp import errorlog |
1391 | 40 | from lp.code.interfaces.codehosting import LAUNCHPAD_SERVICES | 39 | from lp.code.interfaces.codehosting import LAUNCHPAD_SERVICES |
1392 | 41 | from lp.codehosting.puller import get_lock_id_for_branch_id | 40 | from lp.codehosting.puller import get_lock_id_for_branch_id |
1393 | 42 | from lp.codehosting.puller.worker import get_canonical_url_for_branch_name | 41 | from lp.codehosting.puller.worker import get_canonical_url_for_branch_name |
1394 | 42 | from lp.services.propertycache import cachedproperty | ||
1395 | 43 | from lp.services.twistedsupport.processmonitor import ( | 43 | from lp.services.twistedsupport.processmonitor import ( |
1396 | 44 | ProcessMonitorProtocolWithTimeout, | 44 | ProcessMonitorProtocolWithTimeout, |
1397 | 45 | ) | 45 | ) |
1398 | 46 | 46 | ||
1399 | === modified file 'lib/lp/hardwaredb/scripts/hwdbsubmissions.py' | |||
1400 | --- lib/lp/hardwaredb/scripts/hwdbsubmissions.py 2010-08-20 20:31:18 +0000 | |||
1401 | +++ lib/lp/hardwaredb/scripts/hwdbsubmissions.py 2010-09-02 12:57:56 +0000 | |||
1402 | @@ -35,7 +35,7 @@ | |||
1403 | 35 | 35 | ||
1404 | 36 | from canonical.lazr.xml import RelaxNGValidator | 36 | from canonical.lazr.xml import RelaxNGValidator |
1405 | 37 | 37 | ||
1407 | 38 | from canonical.cachedproperty import cachedproperty | 38 | from lp.services.propertycache import cachedproperty |
1408 | 39 | from canonical.config import config | 39 | from canonical.config import config |
1409 | 40 | from canonical.librarian.interfaces import LibrarianServerError | 40 | from canonical.librarian.interfaces import LibrarianServerError |
1410 | 41 | from lp.hardwaredb.interfaces.hwdb import ( | 41 | from lp.hardwaredb.interfaces.hwdb import ( |
1411 | 42 | 42 | ||
1412 | === modified file 'lib/lp/registry/browser/__init__.py' | |||
1413 | --- lib/lp/registry/browser/__init__.py 2010-08-27 22:33:36 +0000 | |||
1414 | +++ lib/lp/registry/browser/__init__.py 2010-09-02 12:57:56 +0000 | |||
1415 | @@ -20,7 +20,6 @@ | |||
1416 | 20 | from storm.store import Store | 20 | from storm.store import Store |
1417 | 21 | from zope.component import getUtility | 21 | from zope.component import getUtility |
1418 | 22 | 22 | ||
1419 | 23 | from canonical.cachedproperty import cachedproperty | ||
1420 | 24 | from canonical.launchpad.interfaces.launchpad import ILaunchpadCelebrities | 23 | from canonical.launchpad.interfaces.launchpad import ILaunchpadCelebrities |
1421 | 25 | from canonical.launchpad.webapp.launchpadform import ( | 24 | from canonical.launchpad.webapp.launchpadform import ( |
1422 | 26 | action, | 25 | action, |
1423 | @@ -33,6 +32,7 @@ | |||
1424 | 33 | ) | 32 | ) |
1425 | 34 | from lp.registry.interfaces.productseries import IProductSeries | 33 | from lp.registry.interfaces.productseries import IProductSeries |
1426 | 35 | from lp.registry.interfaces.series import SeriesStatus | 34 | from lp.registry.interfaces.series import SeriesStatus |
1427 | 35 | from lp.services.propertycache import cachedproperty | ||
1428 | 36 | 36 | ||
1429 | 37 | 37 | ||
1430 | 38 | class StatusCount: | 38 | class StatusCount: |
1431 | 39 | 39 | ||
1432 | === modified file 'lib/lp/registry/browser/announcement.py' | |||
1433 | --- lib/lp/registry/browser/announcement.py 2010-08-20 20:31:18 +0000 | |||
1434 | +++ lib/lp/registry/browser/announcement.py 2010-09-02 12:57:56 +0000 | |||
1435 | @@ -26,7 +26,6 @@ | |||
1436 | 26 | TextLine, | 26 | TextLine, |
1437 | 27 | ) | 27 | ) |
1438 | 28 | 28 | ||
1439 | 29 | from canonical.cachedproperty import cachedproperty | ||
1440 | 30 | from canonical.config import config | 29 | from canonical.config import config |
1441 | 31 | from canonical.launchpad import _ | 30 | from canonical.launchpad import _ |
1442 | 32 | from canonical.launchpad.browser.feeds import ( | 31 | from canonical.launchpad.browser.feeds import ( |
1443 | @@ -58,6 +57,7 @@ | |||
1444 | 58 | Summary, | 57 | Summary, |
1445 | 59 | Title, | 58 | Title, |
1446 | 60 | ) | 59 | ) |
1447 | 60 | from lp.services.propertycache import cachedproperty | ||
1448 | 61 | 61 | ||
1449 | 62 | 62 | ||
1450 | 63 | class AnnouncementMenuMixin: | 63 | class AnnouncementMenuMixin: |
1451 | 64 | 64 | ||
1452 | === modified file 'lib/lp/registry/browser/distribution.py' | |||
1453 | --- lib/lp/registry/browser/distribution.py 2010-08-27 19:19:27 +0000 | |||
1454 | +++ lib/lp/registry/browser/distribution.py 2010-09-02 12:57:56 +0000 | |||
1455 | @@ -44,7 +44,6 @@ | |||
1456 | 44 | from zope.lifecycleevent import ObjectCreatedEvent | 44 | from zope.lifecycleevent import ObjectCreatedEvent |
1457 | 45 | from zope.security.interfaces import Unauthorized | 45 | from zope.security.interfaces import Unauthorized |
1458 | 46 | 46 | ||
1459 | 47 | from canonical.cachedproperty import cachedproperty | ||
1460 | 48 | from canonical.launchpad.browser.feeds import FeedsMixin | 47 | from canonical.launchpad.browser.feeds import FeedsMixin |
1461 | 49 | from canonical.launchpad.components.decoratedresultset import ( | 48 | from canonical.launchpad.components.decoratedresultset import ( |
1462 | 50 | DecoratedResultSet, | 49 | DecoratedResultSet, |
1463 | @@ -109,11 +108,10 @@ | |||
1464 | 109 | ) | 108 | ) |
1465 | 110 | from lp.registry.interfaces.product import IProduct | 109 | from lp.registry.interfaces.product import IProduct |
1466 | 111 | from lp.registry.interfaces.series import SeriesStatus | 110 | from lp.registry.interfaces.series import SeriesStatus |
1467 | 111 | from lp.services.propertycache import cachedproperty | ||
1468 | 112 | from lp.soyuz.browser.packagesearch import PackageSearchViewBase | 112 | from lp.soyuz.browser.packagesearch import PackageSearchViewBase |
1469 | 113 | from lp.soyuz.enums import ArchivePurpose | 113 | from lp.soyuz.enums import ArchivePurpose |
1473 | 114 | from lp.soyuz.interfaces.archive import ( | 114 | from lp.soyuz.interfaces.archive import IArchiveSet |
1471 | 115 | IArchiveSet, | ||
1472 | 116 | ) | ||
1474 | 117 | 115 | ||
1475 | 118 | 116 | ||
1476 | 119 | class UsesLaunchpadMixin: | 117 | class UsesLaunchpadMixin: |
1477 | 120 | 118 | ||
1478 | === modified file 'lib/lp/registry/browser/distributionmirror.py' | |||
1479 | --- lib/lp/registry/browser/distributionmirror.py 2010-08-20 20:31:18 +0000 | |||
1480 | +++ lib/lp/registry/browser/distributionmirror.py 2010-09-02 12:57:56 +0000 | |||
1481 | @@ -22,7 +22,6 @@ | |||
1482 | 22 | from zope.interface import implements | 22 | from zope.interface import implements |
1483 | 23 | from zope.lifecycleevent import ObjectCreatedEvent | 23 | from zope.lifecycleevent import ObjectCreatedEvent |
1484 | 24 | 24 | ||
1485 | 25 | from canonical.cachedproperty import cachedproperty | ||
1486 | 26 | from canonical.launchpad import _ | 25 | from canonical.launchpad import _ |
1487 | 27 | from canonical.launchpad.webapp import ( | 26 | from canonical.launchpad.webapp import ( |
1488 | 28 | action, | 27 | action, |
1489 | @@ -40,6 +39,7 @@ | |||
1490 | 40 | from lp.registry.browser.objectreassignment import ObjectReassignmentView | 39 | from lp.registry.browser.objectreassignment import ObjectReassignmentView |
1491 | 41 | from lp.registry.interfaces.distribution import IDistributionMirrorMenuMarker | 40 | from lp.registry.interfaces.distribution import IDistributionMirrorMenuMarker |
1492 | 42 | from lp.registry.interfaces.distributionmirror import IDistributionMirror | 41 | from lp.registry.interfaces.distributionmirror import IDistributionMirror |
1493 | 42 | from lp.services.propertycache import cachedproperty | ||
1494 | 43 | from lp.soyuz.browser.sourceslist import ( | 43 | from lp.soyuz.browser.sourceslist import ( |
1495 | 44 | SourcesListEntries, | 44 | SourcesListEntries, |
1496 | 45 | SourcesListEntriesView, | 45 | SourcesListEntriesView, |
1497 | 46 | 46 | ||
1498 | === modified file 'lib/lp/registry/browser/distributionsourcepackage.py' | |||
1499 | --- lib/lp/registry/browser/distributionsourcepackage.py 2010-08-26 13:42:56 +0000 | |||
1500 | +++ lib/lp/registry/browser/distributionsourcepackage.py 2010-09-02 12:57:56 +0000 | |||
1501 | @@ -26,7 +26,7 @@ | |||
1502 | 26 | Interface, | 26 | Interface, |
1503 | 27 | ) | 27 | ) |
1504 | 28 | 28 | ||
1506 | 29 | from canonical.cachedproperty import cachedproperty | 29 | from canonical.launchpad.helpers import shortlist |
1507 | 30 | from canonical.launchpad.webapp import ( | 30 | from canonical.launchpad.webapp import ( |
1508 | 31 | action, | 31 | action, |
1509 | 32 | canonical_url, | 32 | canonical_url, |
1510 | @@ -36,7 +36,6 @@ | |||
1511 | 36 | redirection, | 36 | redirection, |
1512 | 37 | StandardLaunchpadFacets, | 37 | StandardLaunchpadFacets, |
1513 | 38 | ) | 38 | ) |
1514 | 39 | from canonical.launchpad.helpers import shortlist | ||
1515 | 40 | from canonical.launchpad.webapp.breadcrumb import Breadcrumb | 39 | from canonical.launchpad.webapp.breadcrumb import Breadcrumb |
1516 | 41 | from canonical.launchpad.webapp.menu import ( | 40 | from canonical.launchpad.webapp.menu import ( |
1517 | 42 | ApplicationMenu, | 41 | ApplicationMenu, |
1518 | @@ -62,6 +61,7 @@ | |||
1519 | 62 | IDistributionSourcePackage, | 61 | IDistributionSourcePackage, |
1520 | 63 | ) | 62 | ) |
1521 | 64 | from lp.registry.interfaces.pocket import pocketsuffix | 63 | from lp.registry.interfaces.pocket import pocketsuffix |
1522 | 64 | from lp.services.propertycache import cachedproperty | ||
1523 | 65 | from lp.soyuz.browser.sourcepackagerelease import ( | 65 | from lp.soyuz.browser.sourcepackagerelease import ( |
1524 | 66 | extract_bug_numbers, | 66 | extract_bug_numbers, |
1525 | 67 | extract_email_addresses, | 67 | extract_email_addresses, |
1526 | @@ -73,7 +73,8 @@ | |||
1527 | 73 | ) | 73 | ) |
1528 | 74 | from lp.soyuz.interfaces.packagediff import IPackageDiffSet | 74 | from lp.soyuz.interfaces.packagediff import IPackageDiffSet |
1529 | 75 | from lp.translations.browser.customlanguagecode import ( | 75 | from lp.translations.browser.customlanguagecode import ( |
1531 | 76 | HasCustomLanguageCodesTraversalMixin) | 76 | HasCustomLanguageCodesTraversalMixin, |
1532 | 77 | ) | ||
1533 | 77 | 78 | ||
1534 | 78 | 79 | ||
1535 | 79 | class DistributionSourcePackageFormatterAPI(CustomizableFormatter): | 80 | class DistributionSourcePackageFormatterAPI(CustomizableFormatter): |
1536 | 80 | 81 | ||
1537 | === modified file 'lib/lp/registry/browser/distroseries.py' | |||
1538 | --- lib/lp/registry/browser/distroseries.py 2010-08-20 20:31:18 +0000 | |||
1539 | +++ lib/lp/registry/browser/distroseries.py 2010-09-02 12:57:56 +0000 | |||
1540 | @@ -27,7 +27,6 @@ | |||
1541 | 27 | SimpleVocabulary, | 27 | SimpleVocabulary, |
1542 | 28 | ) | 28 | ) |
1543 | 29 | 29 | ||
1544 | 30 | from canonical.cachedproperty import cachedproperty | ||
1545 | 31 | from canonical.database.constants import UTC_NOW | 30 | from canonical.database.constants import UTC_NOW |
1546 | 32 | from canonical.launchpad import ( | 31 | from canonical.launchpad import ( |
1547 | 33 | _, | 32 | _, |
1548 | @@ -72,6 +71,7 @@ | |||
1549 | 72 | ) | 71 | ) |
1550 | 73 | from lp.registry.interfaces.distroseries import IDistroSeries | 72 | from lp.registry.interfaces.distroseries import IDistroSeries |
1551 | 74 | from lp.registry.interfaces.series import SeriesStatus | 73 | from lp.registry.interfaces.series import SeriesStatus |
1552 | 74 | from lp.services.propertycache import cachedproperty | ||
1553 | 75 | from lp.services.worlddata.interfaces.country import ICountry | 75 | from lp.services.worlddata.interfaces.country import ICountry |
1554 | 76 | from lp.services.worlddata.interfaces.language import ILanguageSet | 76 | from lp.services.worlddata.interfaces.language import ILanguageSet |
1555 | 77 | from lp.soyuz.browser.packagesearch import PackageSearchViewBase | 77 | from lp.soyuz.browser.packagesearch import PackageSearchViewBase |
1556 | 78 | 78 | ||
1557 | === modified file 'lib/lp/registry/browser/karma.py' | |||
1558 | --- lib/lp/registry/browser/karma.py 2010-08-20 20:31:18 +0000 | |||
1559 | +++ lib/lp/registry/browser/karma.py 2010-09-02 12:57:56 +0000 | |||
1560 | @@ -13,7 +13,6 @@ | |||
1561 | 13 | 13 | ||
1562 | 14 | from zope.component import getUtility | 14 | from zope.component import getUtility |
1563 | 15 | 15 | ||
1564 | 16 | from canonical.cachedproperty import cachedproperty | ||
1565 | 17 | from canonical.launchpad import _ | 16 | from canonical.launchpad import _ |
1566 | 18 | from canonical.launchpad.webapp import ( | 17 | from canonical.launchpad.webapp import ( |
1567 | 19 | action, | 18 | action, |
1568 | @@ -29,6 +28,7 @@ | |||
1569 | 29 | ) | 28 | ) |
1570 | 30 | from lp.registry.interfaces.product import IProduct | 29 | from lp.registry.interfaces.product import IProduct |
1571 | 31 | from lp.registry.interfaces.projectgroup import IProjectGroup | 30 | from lp.registry.interfaces.projectgroup import IProjectGroup |
1572 | 31 | from lp.services.propertycache import cachedproperty | ||
1573 | 32 | 32 | ||
1574 | 33 | 33 | ||
1575 | 34 | TOP_CONTRIBUTORS_LIMIT = 20 | 34 | TOP_CONTRIBUTORS_LIMIT = 20 |
1576 | 35 | 35 | ||
1577 | === modified file 'lib/lp/registry/browser/mailinglists.py' | |||
1578 | --- lib/lp/registry/browser/mailinglists.py 2010-08-20 20:31:18 +0000 | |||
1579 | +++ lib/lp/registry/browser/mailinglists.py 2010-09-02 12:57:56 +0000 | |||
1580 | @@ -20,7 +20,6 @@ | |||
1581 | 20 | from zope.interface import Interface | 20 | from zope.interface import Interface |
1582 | 21 | from zope.security.proxy import removeSecurityProxy | 21 | from zope.security.proxy import removeSecurityProxy |
1583 | 22 | 22 | ||
1584 | 23 | from canonical.cachedproperty import cachedproperty | ||
1585 | 24 | from canonical.launchpad import _ | 23 | from canonical.launchpad import _ |
1586 | 25 | from canonical.launchpad.webapp import ( | 24 | from canonical.launchpad.webapp import ( |
1587 | 26 | action, | 25 | action, |
1588 | @@ -37,6 +36,7 @@ | |||
1589 | 37 | MailingListStatus, | 36 | MailingListStatus, |
1590 | 38 | ) | 37 | ) |
1591 | 39 | from lp.registry.interfaces.person import ITeam | 38 | from lp.registry.interfaces.person import ITeam |
1592 | 39 | from lp.services.propertycache import cachedproperty | ||
1593 | 40 | 40 | ||
1594 | 41 | 41 | ||
1595 | 42 | class ReviewForm(Interface): | 42 | class ReviewForm(Interface): |
1596 | 43 | 43 | ||
1597 | === modified file 'lib/lp/registry/browser/milestone.py' | |||
1598 | --- lib/lp/registry/browser/milestone.py 2010-08-20 20:31:18 +0000 | |||
1599 | +++ lib/lp/registry/browser/milestone.py 2010-09-02 12:57:56 +0000 | |||
1600 | @@ -29,7 +29,6 @@ | |||
1601 | 29 | ) | 29 | ) |
1602 | 30 | from zope.schema import Choice | 30 | from zope.schema import Choice |
1603 | 31 | 31 | ||
1604 | 32 | from canonical.cachedproperty import cachedproperty | ||
1605 | 33 | from canonical.launchpad import _ | 32 | from canonical.launchpad import _ |
1606 | 34 | from canonical.launchpad.webapp import ( | 33 | from canonical.launchpad.webapp import ( |
1607 | 35 | action, | 34 | action, |
1608 | @@ -75,6 +74,7 @@ | |||
1609 | 75 | IProjectGroupMilestone, | 74 | IProjectGroupMilestone, |
1610 | 76 | ) | 75 | ) |
1611 | 77 | from lp.registry.interfaces.product import IProduct | 76 | from lp.registry.interfaces.product import IProduct |
1612 | 77 | from lp.services.propertycache import cachedproperty | ||
1613 | 78 | 78 | ||
1614 | 79 | 79 | ||
1615 | 80 | class MilestoneSetNavigation(GetitemNavigation): | 80 | class MilestoneSetNavigation(GetitemNavigation): |
1616 | 81 | 81 | ||
1617 | === modified file 'lib/lp/registry/browser/person.py' | |||
1618 | --- lib/lp/registry/browser/person.py 2010-08-31 14:00:54 +0000 | |||
1619 | +++ lib/lp/registry/browser/person.py 2010-09-02 12:57:56 +0000 | |||
1620 | @@ -141,7 +141,6 @@ | |||
1621 | 141 | from zope.security.interfaces import Unauthorized | 141 | from zope.security.interfaces import Unauthorized |
1622 | 142 | from zope.security.proxy import removeSecurityProxy | 142 | from zope.security.proxy import removeSecurityProxy |
1623 | 143 | 143 | ||
1624 | 144 | from canonical.cachedproperty import cachedproperty | ||
1625 | 145 | from canonical.config import config | 144 | from canonical.config import config |
1626 | 146 | from canonical.database.sqlbase import flush_database_updates | 145 | from canonical.database.sqlbase import flush_database_updates |
1627 | 147 | from canonical.launchpad import ( | 146 | from canonical.launchpad import ( |
1628 | @@ -309,6 +308,10 @@ | |||
1629 | 309 | ) | 308 | ) |
1630 | 310 | from lp.services.openid.interfaces.openid import IOpenIDPersistentIdentity | 309 | from lp.services.openid.interfaces.openid import IOpenIDPersistentIdentity |
1631 | 311 | from lp.services.openid.interfaces.openidrpsummary import IOpenIDRPSummarySet | 310 | from lp.services.openid.interfaces.openidrpsummary import IOpenIDRPSummarySet |
1632 | 311 | from lp.services.propertycache import ( | ||
1633 | 312 | cachedproperty, | ||
1634 | 313 | IPropertyCache, | ||
1635 | 314 | ) | ||
1636 | 312 | from lp.services.salesforce.interfaces import ( | 315 | from lp.services.salesforce.interfaces import ( |
1637 | 313 | ISalesforceVoucherProxy, | 316 | ISalesforceVoucherProxy, |
1638 | 314 | SalesforceVoucherProxyException, | 317 | SalesforceVoucherProxyException, |
1639 | @@ -5743,10 +5746,7 @@ | |||
1640 | 5743 | def _reset_state(self): | 5746 | def _reset_state(self): |
1641 | 5744 | """Reset the cache because the recipients changed.""" | 5747 | """Reset the cache because the recipients changed.""" |
1642 | 5745 | self._count_recipients = None | 5748 | self._count_recipients = None |
1647 | 5746 | if safe_hasattr(self, '_all_recipients_cached'): | 5749 | del IPropertyCache(self)._all_recipients |
1644 | 5747 | # The clear the cache of _all_recipients. The caching will fail | ||
1645 | 5748 | # if this method creates the attribute before _all_recipients. | ||
1646 | 5749 | del self._all_recipients_cached | ||
1648 | 5750 | 5750 | ||
1649 | 5751 | def _getPrimaryReason(self, person_or_team): | 5751 | def _getPrimaryReason(self, person_or_team): |
1650 | 5752 | """Return the primary reason enumeration. | 5752 | """Return the primary reason enumeration. |
1651 | @@ -5854,7 +5854,7 @@ | |||
1652 | 5854 | 'You are contacting %s of the %s (%s) team directly.' | 5854 | 'You are contacting %s of the %s (%s) team directly.' |
1653 | 5855 | % (text, person_or_team.displayname, person_or_team.name)) | 5855 | % (text, person_or_team.displayname, person_or_team.name)) |
1654 | 5856 | 5856 | ||
1656 | 5857 | @cachedproperty('_all_recipients_cached') | 5857 | @cachedproperty |
1657 | 5858 | def _all_recipients(self): | 5858 | def _all_recipients(self): |
1658 | 5859 | """Set the cache of all recipients.""" | 5859 | """Set the cache of all recipients.""" |
1659 | 5860 | all_recipients = {} | 5860 | all_recipients = {} |
1660 | 5861 | 5861 | ||
1661 | === modified file 'lib/lp/registry/browser/pillar.py' | |||
1662 | --- lib/lp/registry/browser/pillar.py 2010-08-31 14:45:20 +0000 | |||
1663 | +++ lib/lp/registry/browser/pillar.py 2010-09-02 12:57:56 +0000 | |||
1664 | @@ -19,7 +19,6 @@ | |||
1665 | 19 | Interface, | 19 | Interface, |
1666 | 20 | ) | 20 | ) |
1667 | 21 | 21 | ||
1668 | 22 | from canonical.cachedproperty import cachedproperty | ||
1669 | 23 | from canonical.launchpad.webapp.menu import ( | 22 | from canonical.launchpad.webapp.menu import ( |
1670 | 24 | ApplicationMenu, | 23 | ApplicationMenu, |
1671 | 25 | enabled_with_permission, | 24 | enabled_with_permission, |
1672 | @@ -42,6 +41,7 @@ | |||
1673 | 42 | from lp.registry.interfaces.distroseries import IDistroSeries | 41 | from lp.registry.interfaces.distroseries import IDistroSeries |
1674 | 43 | from lp.registry.interfaces.pillar import IPillar | 42 | from lp.registry.interfaces.pillar import IPillar |
1675 | 44 | from lp.registry.interfaces.projectgroup import IProjectGroup | 43 | from lp.registry.interfaces.projectgroup import IProjectGroup |
1676 | 44 | from lp.services.propertycache import cachedproperty | ||
1677 | 45 | 45 | ||
1678 | 46 | 46 | ||
1679 | 47 | class IInvolved(Interface): | 47 | class IInvolved(Interface): |
1680 | 48 | 48 | ||
1681 | === modified file 'lib/lp/registry/browser/product.py' | |||
1682 | --- lib/lp/registry/browser/product.py 2010-08-25 23:43:13 +0000 | |||
1683 | +++ lib/lp/registry/browser/product.py 2010-09-02 12:57:56 +0000 | |||
1684 | @@ -50,6 +50,8 @@ | |||
1685 | 50 | ) | 50 | ) |
1686 | 51 | from operator import attrgetter | 51 | from operator import attrgetter |
1687 | 52 | 52 | ||
1688 | 53 | from lazr.delegates import delegates | ||
1689 | 54 | from lazr.restful.interface import copy_field | ||
1690 | 53 | import pytz | 55 | import pytz |
1691 | 54 | from z3c.ptcompat import ViewPageTemplateFile | 56 | from z3c.ptcompat import ViewPageTemplateFile |
1692 | 55 | from zope.app.form import CustomWidgetFactory | 57 | from zope.app.form import CustomWidgetFactory |
1693 | @@ -76,10 +78,7 @@ | |||
1694 | 76 | ) | 78 | ) |
1695 | 77 | from zope.security.proxy import removeSecurityProxy | 79 | from zope.security.proxy import removeSecurityProxy |
1696 | 78 | 80 | ||
1697 | 79 | from canonical.cachedproperty import cachedproperty | ||
1698 | 80 | from canonical.config import config | 81 | from canonical.config import config |
1699 | 81 | from lazr.delegates import delegates | ||
1700 | 82 | from lazr.restful.interface import copy_field | ||
1701 | 83 | from canonical.launchpad import ( | 82 | from canonical.launchpad import ( |
1702 | 84 | _, | 83 | _, |
1703 | 85 | helpers, | 84 | helpers, |
1704 | @@ -191,6 +190,7 @@ | |||
1705 | 191 | PillarAliases, | 190 | PillarAliases, |
1706 | 192 | PublicPersonChoice, | 191 | PublicPersonChoice, |
1707 | 193 | ) | 192 | ) |
1708 | 193 | from lp.services.propertycache import cachedproperty | ||
1709 | 194 | from lp.services.worlddata.interfaces.country import ICountry | 194 | from lp.services.worlddata.interfaces.country import ICountry |
1710 | 195 | from lp.translations.browser.customlanguagecode import ( | 195 | from lp.translations.browser.customlanguagecode import ( |
1711 | 196 | HasCustomLanguageCodesTraversalMixin, | 196 | HasCustomLanguageCodesTraversalMixin, |
1712 | 197 | 197 | ||
1713 | === modified file 'lib/lp/registry/browser/productseries.py' | |||
1714 | --- lib/lp/registry/browser/productseries.py 2010-08-27 19:19:27 +0000 | |||
1715 | +++ lib/lp/registry/browser/productseries.py 2010-09-02 12:57:56 +0000 | |||
1716 | @@ -54,7 +54,6 @@ | |||
1717 | 54 | SimpleVocabulary, | 54 | SimpleVocabulary, |
1718 | 55 | ) | 55 | ) |
1719 | 56 | 56 | ||
1720 | 57 | from canonical.cachedproperty import cachedproperty | ||
1721 | 58 | from canonical.launchpad import _ | 57 | from canonical.launchpad import _ |
1722 | 59 | from canonical.launchpad.helpers import browserLanguages | 58 | from canonical.launchpad.helpers import browserLanguages |
1723 | 60 | from canonical.launchpad.interfaces.launchpad import ILaunchpadCelebrities | 59 | from canonical.launchpad.interfaces.launchpad import ILaunchpadCelebrities |
1724 | @@ -137,6 +136,7 @@ | |||
1725 | 137 | from lp.registry.interfaces.productseries import IProductSeries | 136 | from lp.registry.interfaces.productseries import IProductSeries |
1726 | 138 | from lp.registry.interfaces.series import SeriesStatus | 137 | from lp.registry.interfaces.series import SeriesStatus |
1727 | 139 | from lp.services.fields import URIField | 138 | from lp.services.fields import URIField |
1728 | 139 | from lp.services.propertycache import cachedproperty | ||
1729 | 140 | from lp.services.worlddata.interfaces.country import ICountry | 140 | from lp.services.worlddata.interfaces.country import ICountry |
1730 | 141 | from lp.services.worlddata.interfaces.language import ILanguageSet | 141 | from lp.services.worlddata.interfaces.language import ILanguageSet |
1731 | 142 | from lp.translations.interfaces.potemplate import IPOTemplateSet | 142 | from lp.translations.interfaces.potemplate import IPOTemplateSet |
1732 | 143 | 143 | ||
1733 | === modified file 'lib/lp/registry/browser/project.py' | |||
1734 | --- lib/lp/registry/browser/project.py 2010-08-21 18:41:57 +0000 | |||
1735 | +++ lib/lp/registry/browser/project.py 2010-09-02 12:57:56 +0000 | |||
1736 | @@ -42,7 +42,6 @@ | |||
1737 | 42 | from zope.lifecycleevent import ObjectCreatedEvent | 42 | from zope.lifecycleevent import ObjectCreatedEvent |
1738 | 43 | from zope.schema import Choice | 43 | from zope.schema import Choice |
1739 | 44 | 44 | ||
1740 | 45 | from canonical.cachedproperty import cachedproperty | ||
1741 | 46 | from canonical.launchpad import _ | 45 | from canonical.launchpad import _ |
1742 | 47 | from canonical.launchpad.browser.feeds import FeedsMixin | 46 | from canonical.launchpad.browser.feeds import FeedsMixin |
1743 | 48 | from canonical.launchpad.webapp import ( | 47 | from canonical.launchpad.webapp import ( |
1744 | @@ -98,6 +97,7 @@ | |||
1745 | 98 | PillarAliases, | 97 | PillarAliases, |
1746 | 99 | PublicPersonChoice, | 98 | PublicPersonChoice, |
1747 | 100 | ) | 99 | ) |
1748 | 100 | from lp.services.propertycache import cachedproperty | ||
1749 | 101 | 101 | ||
1750 | 102 | 102 | ||
1751 | 103 | class ProjectNavigation(Navigation, | 103 | class ProjectNavigation(Navigation, |
1752 | 104 | 104 | ||
1753 | === modified file 'lib/lp/registry/browser/structuralsubscription.py' | |||
1754 | --- lib/lp/registry/browser/structuralsubscription.py 2010-08-20 20:31:18 +0000 | |||
1755 | +++ lib/lp/registry/browser/structuralsubscription.py 2010-09-02 12:57:56 +0000 | |||
1756 | @@ -22,7 +22,6 @@ | |||
1757 | 22 | SimpleVocabulary, | 22 | SimpleVocabulary, |
1758 | 23 | ) | 23 | ) |
1759 | 24 | 24 | ||
1760 | 25 | from canonical.cachedproperty import cachedproperty | ||
1761 | 26 | from canonical.launchpad.webapp import ( | 25 | from canonical.launchpad.webapp import ( |
1762 | 27 | action, | 26 | action, |
1763 | 28 | canonical_url, | 27 | canonical_url, |
1764 | @@ -43,6 +42,7 @@ | |||
1765 | 43 | IStructuralSubscriptionForm, | 42 | IStructuralSubscriptionForm, |
1766 | 44 | IStructuralSubscriptionTarget, | 43 | IStructuralSubscriptionTarget, |
1767 | 45 | ) | 44 | ) |
1768 | 45 | from lp.services.propertycache import cachedproperty | ||
1769 | 46 | 46 | ||
1770 | 47 | 47 | ||
1771 | 48 | class StructuralSubscriptionView(LaunchpadFormView): | 48 | class StructuralSubscriptionView(LaunchpadFormView): |
1772 | 49 | 49 | ||
1773 | === modified file 'lib/lp/registry/browser/team.py' | |||
1774 | --- lib/lp/registry/browser/team.py 2010-08-27 22:33:36 +0000 | |||
1775 | +++ lib/lp/registry/browser/team.py 2010-09-02 12:57:56 +0000 | |||
1776 | @@ -41,7 +41,6 @@ | |||
1777 | 41 | SimpleVocabulary, | 41 | SimpleVocabulary, |
1778 | 42 | ) | 42 | ) |
1779 | 43 | 43 | ||
1780 | 44 | from canonical.cachedproperty import cachedproperty | ||
1781 | 45 | from canonical.launchpad import _ | 44 | from canonical.launchpad import _ |
1782 | 46 | from canonical.launchpad.interfaces.authtoken import LoginTokenType | 45 | from canonical.launchpad.interfaces.authtoken import LoginTokenType |
1783 | 47 | from canonical.launchpad.interfaces.emailaddress import IEmailAddressSet | 46 | from canonical.launchpad.interfaces.emailaddress import IEmailAddressSet |
1784 | @@ -92,6 +91,7 @@ | |||
1785 | 92 | ) | 91 | ) |
1786 | 93 | from lp.registry.interfaces.teammembership import TeamMembershipStatus | 92 | from lp.registry.interfaces.teammembership import TeamMembershipStatus |
1787 | 94 | from lp.services.fields import PublicPersonChoice | 93 | from lp.services.fields import PublicPersonChoice |
1788 | 94 | from lp.services.propertycache import cachedproperty | ||
1789 | 95 | 95 | ||
1790 | 96 | 96 | ||
1791 | 97 | class TeamPrivacyAdapter: | 97 | class TeamPrivacyAdapter: |
1792 | 98 | 98 | ||
1793 | === modified file 'lib/lp/registry/model/distribution.py' | |||
1794 | --- lib/lp/registry/model/distribution.py 2010-09-02 12:57:52 +0000 | |||
1795 | +++ lib/lp/registry/model/distribution.py 2010-09-02 12:57:56 +0000 | |||
1796 | @@ -149,15 +149,11 @@ | |||
1797 | 149 | from lp.registry.model.structuralsubscription import ( | 149 | from lp.registry.model.structuralsubscription import ( |
1798 | 150 | StructuralSubscriptionTargetMixin, | 150 | StructuralSubscriptionTargetMixin, |
1799 | 151 | ) | 151 | ) |
1800 | 152 | <<<<<<< TREE | ||
1801 | 153 | from lp.soyuz.enums import ( | ||
1802 | 154 | ======= | ||
1803 | 155 | from lp.services.propertycache import ( | 152 | from lp.services.propertycache import ( |
1804 | 156 | cachedproperty, | 153 | cachedproperty, |
1805 | 157 | IPropertyCache, | 154 | IPropertyCache, |
1806 | 158 | ) | 155 | ) |
1809 | 159 | from lp.soyuz.interfaces.archive import ( | 156 | from lp.soyuz.enums import ( |
1808 | 160 | >>>>>>> MERGE-SOURCE | ||
1810 | 161 | ArchivePurpose, | 157 | ArchivePurpose, |
1811 | 162 | ArchiveStatus, | 158 | ArchiveStatus, |
1812 | 163 | PackagePublishingStatus, | 159 | PackagePublishingStatus, |
1813 | @@ -170,10 +166,11 @@ | |||
1814 | 170 | from lp.soyuz.interfaces.archivepermission import IArchivePermissionSet | 166 | from lp.soyuz.interfaces.archivepermission import IArchivePermissionSet |
1815 | 171 | from lp.soyuz.interfaces.binarypackagebuild import IBinaryPackageBuildSet | 167 | from lp.soyuz.interfaces.binarypackagebuild import IBinaryPackageBuildSet |
1816 | 172 | from lp.soyuz.interfaces.buildrecords import IHasBuildRecords | 168 | from lp.soyuz.interfaces.buildrecords import IHasBuildRecords |
1820 | 173 | from lp.soyuz.interfaces.publishing import ( | 169 | from lp.soyuz.interfaces.publishing import active_publishing_status |
1821 | 174 | active_publishing_status, | 170 | from lp.soyuz.model.archive import Archive |
1819 | 175 | ) | ||
1822 | 176 | from lp.soyuz.model.binarypackagebuild import BinaryPackageBuild | 171 | from lp.soyuz.model.binarypackagebuild import BinaryPackageBuild |
1823 | 172 | from lp.soyuz.model.binarypackagename import BinaryPackageName | ||
1824 | 173 | from lp.soyuz.model.binarypackagerelease import BinaryPackageRelease | ||
1825 | 177 | from lp.soyuz.model.distributionsourcepackagecache import ( | 174 | from lp.soyuz.model.distributionsourcepackagecache import ( |
1826 | 178 | DistributionSourcePackageCache, | 175 | DistributionSourcePackageCache, |
1827 | 179 | ) | 176 | ) |
1828 | 180 | 177 | ||
1829 | === modified file 'lib/lp/registry/model/distroseries.py' | |||
1830 | --- lib/lp/registry/model/distroseries.py 2010-08-26 08:02:08 +0000 | |||
1831 | +++ lib/lp/registry/model/distroseries.py 2010-09-02 12:57:56 +0000 | |||
1832 | @@ -36,7 +36,6 @@ | |||
1833 | 36 | from zope.component import getUtility | 36 | from zope.component import getUtility |
1834 | 37 | from zope.interface import implements | 37 | from zope.interface import implements |
1835 | 38 | 38 | ||
1836 | 39 | from canonical.cachedproperty import cachedproperty | ||
1837 | 40 | from canonical.database.constants import ( | 39 | from canonical.database.constants import ( |
1838 | 41 | DEFAULT, | 40 | DEFAULT, |
1839 | 42 | UTC_NOW, | 41 | UTC_NOW, |
1840 | @@ -114,15 +113,14 @@ | |||
1841 | 114 | from lp.registry.model.structuralsubscription import ( | 113 | from lp.registry.model.structuralsubscription import ( |
1842 | 115 | StructuralSubscriptionTargetMixin, | 114 | StructuralSubscriptionTargetMixin, |
1843 | 116 | ) | 115 | ) |
1844 | 116 | from lp.services.propertycache import cachedproperty | ||
1845 | 117 | from lp.services.worlddata.model.language import Language | 117 | from lp.services.worlddata.model.language import Language |
1846 | 118 | from lp.soyuz.enums import ( | 118 | from lp.soyuz.enums import ( |
1847 | 119 | ArchivePurpose, | 119 | ArchivePurpose, |
1848 | 120 | PackagePublishingStatus, | 120 | PackagePublishingStatus, |
1849 | 121 | PackageUploadStatus, | 121 | PackageUploadStatus, |
1850 | 122 | ) | 122 | ) |
1854 | 123 | from lp.soyuz.interfaces.archive import ( | 123 | from lp.soyuz.interfaces.archive import ALLOW_RELEASE_BUILDS |
1852 | 124 | ALLOW_RELEASE_BUILDS, | ||
1853 | 125 | ) | ||
1855 | 126 | from lp.soyuz.interfaces.binarypackagebuild import IBinaryPackageBuildSet | 124 | from lp.soyuz.interfaces.binarypackagebuild import IBinaryPackageBuildSet |
1856 | 127 | from lp.soyuz.interfaces.binarypackagename import IBinaryPackageName | 125 | from lp.soyuz.interfaces.binarypackagename import IBinaryPackageName |
1857 | 128 | from lp.soyuz.interfaces.buildrecords import IHasBuildRecords | 126 | from lp.soyuz.interfaces.buildrecords import IHasBuildRecords |
1858 | @@ -551,7 +549,7 @@ | |||
1859 | 551 | orderBy=["Language.englishname"]) | 549 | orderBy=["Language.englishname"]) |
1860 | 552 | return result | 550 | return result |
1861 | 553 | 551 | ||
1863 | 554 | @cachedproperty('_previous_series_cached') | 552 | @cachedproperty |
1864 | 555 | def previous_series(self): | 553 | def previous_series(self): |
1865 | 556 | """See `IDistroSeries`.""" | 554 | """See `IDistroSeries`.""" |
1866 | 557 | # This property is cached because it is used intensely inside | 555 | # This property is cached because it is used intensely inside |
1867 | 558 | 556 | ||
1868 | === modified file 'lib/lp/registry/model/mailinglist.py' | |||
1869 | --- lib/lp/registry/model/mailinglist.py 2010-08-22 19:14:23 +0000 | |||
1870 | +++ lib/lp/registry/model/mailinglist.py 2010-09-02 12:57:56 +0000 | |||
1871 | @@ -51,7 +51,6 @@ | |||
1872 | 51 | ) | 51 | ) |
1873 | 52 | from zope.security.proxy import removeSecurityProxy | 52 | from zope.security.proxy import removeSecurityProxy |
1874 | 53 | 53 | ||
1875 | 54 | from canonical.cachedproperty import cachedproperty | ||
1876 | 55 | from canonical.config import config | 54 | from canonical.config import config |
1877 | 56 | from canonical.database.constants import ( | 55 | from canonical.database.constants import ( |
1878 | 57 | DEFAULT, | 56 | DEFAULT, |
1879 | @@ -95,6 +94,7 @@ | |||
1880 | 95 | from lp.registry.interfaces.person import validate_public_person | 94 | from lp.registry.interfaces.person import validate_public_person |
1881 | 96 | from lp.registry.model.person import Person | 95 | from lp.registry.model.person import Person |
1882 | 97 | from lp.registry.model.teammembership import TeamParticipation | 96 | from lp.registry.model.teammembership import TeamParticipation |
1883 | 97 | from lp.services.propertycache import cachedproperty | ||
1884 | 98 | 98 | ||
1885 | 99 | 99 | ||
1886 | 100 | EMAIL_ADDRESS_STATUSES = ( | 100 | EMAIL_ADDRESS_STATUSES = ( |
1887 | 101 | 101 | ||
1888 | === modified file 'lib/lp/registry/model/person.py' | |||
1889 | --- lib/lp/registry/model/person.py 2010-09-02 12:57:52 +0000 | |||
1890 | +++ lib/lp/registry/model/person.py 2010-09-02 12:57:56 +0000 | |||
1891 | @@ -272,9 +272,7 @@ | |||
1892 | 272 | ) | 272 | ) |
1893 | 273 | from lp.services.worlddata.model.language import Language | 273 | from lp.services.worlddata.model.language import Language |
1894 | 274 | from lp.soyuz.enums import ArchivePurpose | 274 | from lp.soyuz.enums import ArchivePurpose |
1898 | 275 | from lp.soyuz.interfaces.archive import ( | 275 | from lp.soyuz.interfaces.archive import IArchiveSet |
1896 | 276 | IArchiveSet, | ||
1897 | 277 | ) | ||
1899 | 278 | from lp.soyuz.interfaces.archivepermission import IArchivePermissionSet | 276 | from lp.soyuz.interfaces.archivepermission import IArchivePermissionSet |
1900 | 279 | from lp.soyuz.interfaces.archivesubscriber import IArchiveSubscriberSet | 277 | from lp.soyuz.interfaces.archivesubscriber import IArchiveSubscriberSet |
1901 | 280 | from lp.soyuz.model.archive import Archive | 278 | from lp.soyuz.model.archive import Archive |
1902 | @@ -1620,7 +1618,7 @@ | |||
1903 | 1620 | if not person: | 1618 | if not person: |
1904 | 1621 | return | 1619 | return |
1905 | 1622 | email = column | 1620 | email = column |
1907 | 1623 | cache_property(person, '_preferredemail_cached', email) | 1621 | IPropertyCache(person).preferredemail = email |
1908 | 1624 | decorators.append(handleemail) | 1622 | decorators.append(handleemail) |
1909 | 1625 | def handleaccount(person, column): | 1623 | def handleaccount(person, column): |
1910 | 1626 | #-- validity caching | 1624 | #-- validity caching |
1911 | @@ -1632,7 +1630,7 @@ | |||
1912 | 1632 | column is not None | 1630 | column is not None |
1913 | 1633 | # -- preferred email found | 1631 | # -- preferred email found |
1914 | 1634 | and person.preferredemail is not None) | 1632 | and person.preferredemail is not None) |
1916 | 1635 | cache_property(person, '_is_valid_person_cached', valid) | 1633 | IPropertyCache(person).is_valid_person = valid |
1917 | 1636 | decorators.append(handleaccount) | 1634 | decorators.append(handleaccount) |
1918 | 1637 | return dict( | 1635 | return dict( |
1919 | 1638 | joins=origins, | 1636 | joins=origins, |
1920 | @@ -1752,27 +1750,11 @@ | |||
1921 | 1752 | if need_preferred_email and not need_validity: | 1750 | if need_preferred_email and not need_validity: |
1922 | 1753 | email = row[index] | 1751 | email = row[index] |
1923 | 1754 | index += 1 | 1752 | index += 1 |
1926 | 1755 | <<<<<<< TREE | 1753 | cache.preferredemail = email |
1925 | 1756 | cache_property(result, '_preferredemail_cached', email) | ||
1927 | 1757 | for decorator in decorators: | 1754 | for decorator in decorators: |
1928 | 1758 | column = row[index] | 1755 | column = row[index] |
1929 | 1759 | ======= | ||
1930 | 1760 | cache.preferredemail = email | ||
1931 | 1761 | #-- validity caching | ||
1932 | 1762 | if need_validity: | ||
1933 | 1763 | # valid if: | ||
1934 | 1764 | valid = ( | ||
1935 | 1765 | # -- valid account found | ||
1936 | 1766 | row[index] is not None | ||
1937 | 1767 | # -- preferred email found | ||
1938 | 1768 | and result.preferredemail is not None) | ||
1939 | 1769 | >>>>>>> MERGE-SOURCE | ||
1940 | 1770 | index += 1 | 1756 | index += 1 |
1941 | 1771 | <<<<<<< TREE | ||
1942 | 1772 | decorator(result, column) | 1757 | decorator(result, column) |
1943 | 1773 | ======= | ||
1944 | 1774 | cache.is_valid_person = valid | ||
1945 | 1775 | >>>>>>> MERGE-SOURCE | ||
1946 | 1776 | return result | 1758 | return result |
1947 | 1777 | return DecoratedResultSet(raw_result, | 1759 | return DecoratedResultSet(raw_result, |
1948 | 1778 | result_decorator=prepopulate_person) | 1760 | result_decorator=prepopulate_person) |
1949 | 1779 | 1761 | ||
1950 | === modified file 'lib/lp/registry/model/product.py' | |||
1951 | --- lib/lp/registry/model/product.py 2010-08-31 05:58:45 +0000 | |||
1952 | +++ lib/lp/registry/model/product.py 2010-09-02 12:57:56 +0000 | |||
1953 | @@ -38,7 +38,6 @@ | |||
1954 | 38 | from zope.interface import implements | 38 | from zope.interface import implements |
1955 | 39 | from zope.security.proxy import removeSecurityProxy | 39 | from zope.security.proxy import removeSecurityProxy |
1956 | 40 | 40 | ||
1957 | 41 | from canonical.cachedproperty import cachedproperty | ||
1958 | 42 | from canonical.database.constants import UTC_NOW | 41 | from canonical.database.constants import UTC_NOW |
1959 | 43 | from canonical.database.datetimecol import UtcDateTimeCol | 42 | from canonical.database.datetimecol import UtcDateTimeCol |
1960 | 44 | from canonical.database.enumcol import EnumCol | 43 | from canonical.database.enumcol import EnumCol |
1961 | @@ -150,6 +149,10 @@ | |||
1962 | 150 | StructuralSubscriptionTargetMixin, | 149 | StructuralSubscriptionTargetMixin, |
1963 | 151 | ) | 150 | ) |
1964 | 152 | from lp.services.database.prejoin import prejoin | 151 | from lp.services.database.prejoin import prejoin |
1965 | 152 | from lp.services.propertycache import ( | ||
1966 | 153 | cachedproperty, | ||
1967 | 154 | IPropertyCache, | ||
1968 | 155 | ) | ||
1969 | 153 | from lp.translations.interfaces.customlanguagecode import ( | 156 | from lp.translations.interfaces.customlanguagecode import ( |
1970 | 154 | IHasCustomLanguageCodes, | 157 | IHasCustomLanguageCodes, |
1971 | 155 | ) | 158 | ) |
1972 | @@ -428,7 +431,7 @@ | |||
1973 | 428 | notNull=True, default=False, | 431 | notNull=True, default=False, |
1974 | 429 | storm_validator=_validate_license_approved) | 432 | storm_validator=_validate_license_approved) |
1975 | 430 | 433 | ||
1977 | 431 | @cachedproperty('_commercial_subscription_cached') | 434 | @cachedproperty |
1978 | 432 | def commercial_subscription(self): | 435 | def commercial_subscription(self): |
1979 | 433 | return CommercialSubscription.selectOneBy(product=self) | 436 | return CommercialSubscription.selectOneBy(product=self) |
1980 | 434 | 437 | ||
1981 | @@ -475,7 +478,7 @@ | |||
1982 | 475 | purchaser=purchaser, | 478 | purchaser=purchaser, |
1983 | 476 | sales_system_id=voucher, | 479 | sales_system_id=voucher, |
1984 | 477 | whiteboard=whiteboard) | 480 | whiteboard=whiteboard) |
1986 | 478 | self._commercial_subscription_cached = subscription | 481 | IPropertyCache(self).commercial_subscription = subscription |
1987 | 479 | else: | 482 | else: |
1988 | 480 | if current_datetime <= self.commercial_subscription.date_expires: | 483 | if current_datetime <= self.commercial_subscription.date_expires: |
1989 | 481 | # Extend current subscription. | 484 | # Extend current subscription. |
1990 | 482 | 485 | ||
1991 | === modified file 'lib/lp/registry/vocabularies.py' | |||
1992 | --- lib/lp/registry/vocabularies.py 2010-08-24 07:51:22 +0000 | |||
1993 | +++ lib/lp/registry/vocabularies.py 2010-09-02 12:57:56 +0000 | |||
1994 | @@ -88,7 +88,6 @@ | |||
1995 | 88 | removeSecurityProxy, | 88 | removeSecurityProxy, |
1996 | 89 | ) | 89 | ) |
1997 | 90 | 90 | ||
1998 | 91 | from canonical.cachedproperty import cachedproperty | ||
1999 | 92 | from canonical.database.sqlbase import ( | 91 | from canonical.database.sqlbase import ( |
2000 | 93 | quote, | 92 | quote, |
2001 | 94 | quote_like, | 93 | quote_like, |
2002 | @@ -169,6 +168,7 @@ | |||
2003 | 169 | from lp.registry.model.projectgroup import ProjectGroup | 168 | from lp.registry.model.projectgroup import ProjectGroup |
2004 | 170 | from lp.registry.model.sourcepackagename import SourcePackageName | 169 | from lp.registry.model.sourcepackagename import SourcePackageName |
2005 | 171 | from lp.registry.model.teammembership import TeamParticipation | 170 | from lp.registry.model.teammembership import TeamParticipation |
2006 | 171 | from lp.services.propertycache import cachedproperty | ||
2007 | 172 | 172 | ||
2008 | 173 | 173 | ||
2009 | 174 | class BasePersonVocabulary: | 174 | class BasePersonVocabulary: |
2010 | 175 | 175 | ||
2011 | === modified file 'lib/lp/services/mailman/doc/staging.txt' | |||
2012 | --- lib/lp/services/mailman/doc/staging.txt 2010-06-09 03:38:46 +0000 | |||
2013 | +++ lib/lp/services/mailman/doc/staging.txt 2010-09-02 12:57:56 +0000 | |||
2014 | @@ -30,8 +30,9 @@ | |||
2015 | 30 | >>> logout() | 30 | >>> logout() |
2016 | 31 | 31 | ||
2017 | 32 | >>> from canonical.launchpad.testing.pages import setupBrowser | 32 | >>> from canonical.launchpad.testing.pages import setupBrowser |
2018 | 33 | >>> from lp.services.propertycache import IPropertyCache | ||
2019 | 33 | >>> browser = setupBrowser('Basic %s:%s' % | 34 | >>> browser = setupBrowser('Basic %s:%s' % |
2021 | 34 | ... (owner._preferredemail_cached.email, | 35 | ... (IPropertyCache(owner).preferredemail.email, |
2022 | 35 | ... owner._password_cleartext_cached)) | 36 | ... owner._password_cleartext_cached)) |
2023 | 36 | 37 | ||
2024 | 37 | >>> from lp.services.mailman.testing import helpers | 38 | >>> from lp.services.mailman.testing import helpers |
2025 | 38 | 39 | ||
2026 | === modified file 'lib/lp/services/openid/browser/openiddiscovery.py' | |||
2027 | --- lib/lp/services/openid/browser/openiddiscovery.py 2010-08-20 20:31:18 +0000 | |||
2028 | +++ lib/lp/services/openid/browser/openiddiscovery.py 2010-09-02 12:57:56 +0000 | |||
2029 | @@ -14,9 +14,9 @@ | |||
2030 | 14 | YADIS_HEADER_NAME, | 14 | YADIS_HEADER_NAME, |
2031 | 15 | ) | 15 | ) |
2032 | 16 | 16 | ||
2033 | 17 | from canonical.cachedproperty import cachedproperty | ||
2034 | 18 | from canonical.launchpad.webapp import canonical_url | 17 | from canonical.launchpad.webapp import canonical_url |
2035 | 19 | from lp.services.openid.adapters.openid import CurrentOpenIDEndPoint | 18 | from lp.services.openid.adapters.openid import CurrentOpenIDEndPoint |
2036 | 19 | from lp.services.propertycache import cachedproperty | ||
2037 | 20 | 20 | ||
2038 | 21 | 21 | ||
2039 | 22 | class XRDSContentNegotiationMixin: | 22 | class XRDSContentNegotiationMixin: |
2040 | 23 | 23 | ||
2041 | === modified file 'lib/lp/services/propertycache.py' | |||
2042 | --- lib/lp/services/propertycache.py 2010-09-02 12:57:52 +0000 | |||
2043 | +++ lib/lp/services/propertycache.py 2010-09-02 12:57:56 +0000 | |||
2044 | @@ -20,6 +20,7 @@ | |||
2045 | 20 | from zope.component import ( | 20 | from zope.component import ( |
2046 | 21 | adapter, | 21 | adapter, |
2047 | 22 | adapts, | 22 | adapts, |
2048 | 23 | getGlobalSiteManager, | ||
2049 | 23 | ) | 24 | ) |
2050 | 24 | from zope.interface import ( | 25 | from zope.interface import ( |
2051 | 25 | implementer, | 26 | implementer, |
2052 | @@ -62,6 +63,11 @@ | |||
2053 | 62 | """Empty the cache.""" | 63 | """Empty the cache.""" |
2054 | 63 | 64 | ||
2055 | 64 | 65 | ||
2056 | 66 | # Register adapters with the global site manager so that they work even when | ||
2057 | 67 | # ZCML has not been executed. | ||
2058 | 68 | registerAdapter = getGlobalSiteManager().registerAdapter | ||
2059 | 69 | |||
2060 | 70 | |||
2061 | 65 | class DefaultPropertyCache: | 71 | class DefaultPropertyCache: |
2062 | 66 | """A simple cache.""" | 72 | """A simple cache.""" |
2063 | 67 | 73 | ||
2064 | @@ -94,6 +100,8 @@ | |||
2065 | 94 | naked_target._property_cache = DefaultPropertyCache() | 100 | naked_target._property_cache = DefaultPropertyCache() |
2066 | 95 | return naked_target._property_cache | 101 | return naked_target._property_cache |
2067 | 96 | 102 | ||
2068 | 103 | registerAdapter(get_default_cache) | ||
2069 | 104 | |||
2070 | 97 | 105 | ||
2071 | 98 | class PropertyCacheManager: | 106 | class PropertyCacheManager: |
2072 | 99 | """A simple `IPropertyCacheManager`. | 107 | """A simple `IPropertyCacheManager`. |
2073 | @@ -112,6 +120,8 @@ | |||
2074 | 112 | for name in list(self.cache): | 120 | for name in list(self.cache): |
2075 | 113 | delattr(self.cache, name) | 121 | delattr(self.cache, name) |
2076 | 114 | 122 | ||
2077 | 123 | registerAdapter(PropertyCacheManager) | ||
2078 | 124 | |||
2079 | 115 | 125 | ||
2080 | 116 | class DefaultPropertyCacheManager: | 126 | class DefaultPropertyCacheManager: |
2081 | 117 | """A `IPropertyCacheManager` specifically for `DefaultPropertyCache`. | 127 | """A `IPropertyCacheManager` specifically for `DefaultPropertyCache`. |
2082 | @@ -128,6 +138,8 @@ | |||
2083 | 128 | def clear(self): | 138 | def clear(self): |
2084 | 129 | self.cache.__dict__.clear() | 139 | self.cache.__dict__.clear() |
2085 | 130 | 140 | ||
2086 | 141 | registerAdapter(DefaultPropertyCacheManager) | ||
2087 | 142 | |||
2088 | 131 | 143 | ||
2089 | 132 | class CachedProperty: | 144 | class CachedProperty: |
2090 | 133 | """Cached property descriptor. | 145 | """Cached property descriptor. |
2091 | @@ -172,3 +184,32 @@ | |||
2092 | 172 | name = name_or_function.__name__ | 184 | name = name_or_function.__name__ |
2093 | 173 | populate = name_or_function | 185 | populate = name_or_function |
2094 | 174 | return CachedProperty(name=name, populate=populate) | 186 | return CachedProperty(name=name, populate=populate) |
2095 | 187 | |||
2096 | 188 | |||
2097 | 189 | # XXX: GavinPanella 2010-09-02 bug=628762: There are some weird adaption | ||
2098 | 190 | # failures when running the full test suite. All that follows is a temporary, | ||
2099 | 191 | # mostly non-Zope, workaround. | ||
2100 | 192 | |||
2101 | 193 | _IPropertyCache = IPropertyCache | ||
2102 | 194 | _IPropertyCacheManager = IPropertyCacheManager | ||
2103 | 195 | |||
2104 | 196 | def IPropertyCache(target): | ||
2105 | 197 | """Return the `IPropertyCache` for `target`. | ||
2106 | 198 | |||
2107 | 199 | Note: this is a workaround; see bug 628762. | ||
2108 | 200 | """ | ||
2109 | 201 | if _IPropertyCache.providedBy(target): | ||
2110 | 202 | return target | ||
2111 | 203 | else: | ||
2112 | 204 | return get_default_cache(target) | ||
2113 | 205 | |||
2114 | 206 | def IPropertyCacheManager(target): | ||
2115 | 207 | """Return the `IPropertyCacheManager` for `target`. | ||
2116 | 208 | |||
2117 | 209 | Note: this is a workaround; see bug 628762. | ||
2118 | 210 | """ | ||
2119 | 211 | cache = IPropertyCache(target) | ||
2120 | 212 | if isinstance(cache, DefaultPropertyCache): | ||
2121 | 213 | return DefaultPropertyCacheManager(cache) | ||
2122 | 214 | else: | ||
2123 | 215 | return PropertyCacheManager(cache) | ||
2124 | 175 | 216 | ||
2125 | === modified file 'lib/lp/services/salesforce/proxy.py' | |||
2126 | --- lib/lp/services/salesforce/proxy.py 2010-08-20 20:31:18 +0000 | |||
2127 | +++ lib/lp/services/salesforce/proxy.py 2010-09-02 12:57:56 +0000 | |||
2128 | @@ -20,10 +20,10 @@ | |||
2129 | 20 | from zope.component import getUtility | 20 | from zope.component import getUtility |
2130 | 21 | from zope.interface import implements | 21 | from zope.interface import implements |
2131 | 22 | 22 | ||
2132 | 23 | from canonical.cachedproperty import cachedproperty | ||
2133 | 24 | from canonical.config import config | 23 | from canonical.config import config |
2134 | 25 | from canonical.lazr.timeout import SafeTransportWithTimeout | 24 | from canonical.lazr.timeout import SafeTransportWithTimeout |
2135 | 26 | from lp.registry.interfaces.product import IProductSet | 25 | from lp.registry.interfaces.product import IProductSet |
2136 | 26 | from lp.services.propertycache import cachedproperty | ||
2137 | 27 | from lp.services.salesforce.interfaces import ( | 27 | from lp.services.salesforce.interfaces import ( |
2138 | 28 | ISalesforceVoucher, | 28 | ISalesforceVoucher, |
2139 | 29 | ISalesforceVoucherProxy, | 29 | ISalesforceVoucherProxy, |
2140 | 30 | 30 | ||
2141 | === modified file 'lib/lp/services/tests/test_doc.py' | |||
2142 | --- lib/lp/services/tests/test_doc.py 2010-09-02 12:57:52 +0000 | |||
2143 | +++ lib/lp/services/tests/test_doc.py 2010-09-02 12:57:56 +0000 | |||
2144 | @@ -8,8 +8,10 @@ | |||
2145 | 8 | import os | 8 | import os |
2146 | 9 | 9 | ||
2147 | 10 | from canonical.launchpad.testing.systemdocs import LayeredDocFileSuite | 10 | from canonical.launchpad.testing.systemdocs import LayeredDocFileSuite |
2150 | 11 | from canonical.testing import BaseLayer | 11 | from canonical.testing import ( |
2151 | 12 | from canonical.testing import LaunchpadZopelessLayer | 12 | BaseLayer, |
2152 | 13 | LaunchpadZopelessLayer, | ||
2153 | 14 | ) | ||
2154 | 13 | from lp.services.testing import build_test_suite | 15 | from lp.services.testing import build_test_suite |
2155 | 14 | 16 | ||
2156 | 15 | 17 | ||
2157 | 16 | 18 | ||
2158 | === modified file 'lib/lp/shipit.py' | |||
2159 | --- lib/lp/shipit.py 2010-08-20 20:31:18 +0000 | |||
2160 | +++ lib/lp/shipit.py 2010-09-02 12:57:56 +0000 | |||
2161 | @@ -106,6 +106,10 @@ | |||
2162 | 106 | from lp.registry.model.person import Person | 106 | from lp.registry.model.person import Person |
2163 | 107 | from lp.services.mail import stub | 107 | from lp.services.mail import stub |
2164 | 108 | from lp.services.mail.sendmail import simple_sendmail | 108 | from lp.services.mail.sendmail import simple_sendmail |
2165 | 109 | from lp.services.propertycache import ( | ||
2166 | 110 | cachedproperty, | ||
2167 | 111 | IPropertyCache, | ||
2168 | 112 | ) | ||
2169 | 109 | from lp.services.scripts.base import ( | 113 | from lp.services.scripts.base import ( |
2170 | 110 | LaunchpadCronScript, | 114 | LaunchpadCronScript, |
2171 | 111 | LaunchpadScript, | 115 | LaunchpadScript, |
2172 | 112 | 116 | ||
2173 | === modified file 'lib/lp/soyuz/browser/archive.py' | |||
2174 | --- lib/lp/soyuz/browser/archive.py 2010-08-27 11:19:54 +0000 | |||
2175 | +++ lib/lp/soyuz/browser/archive.py 2010-09-02 12:57:56 +0000 | |||
2176 | @@ -56,7 +56,6 @@ | |||
2177 | 56 | from zope.security.interfaces import Unauthorized | 56 | from zope.security.interfaces import Unauthorized |
2178 | 57 | from zope.security.proxy import removeSecurityProxy | 57 | from zope.security.proxy import removeSecurityProxy |
2179 | 58 | 58 | ||
2180 | 59 | from canonical.cachedproperty import cachedproperty | ||
2181 | 60 | from canonical.launchpad import _ | 59 | from canonical.launchpad import _ |
2182 | 61 | from canonical.launchpad.browser.librarian import FileNavigationMixin | 60 | from canonical.launchpad.browser.librarian import FileNavigationMixin |
2183 | 62 | from canonical.launchpad.components.tokens import create_token | 61 | from canonical.launchpad.components.tokens import create_token |
2184 | @@ -107,6 +106,7 @@ | |||
2185 | 107 | from lp.registry.interfaces.series import SeriesStatus | 106 | from lp.registry.interfaces.series import SeriesStatus |
2186 | 108 | from lp.registry.interfaces.sourcepackagename import ISourcePackageNameSet | 107 | from lp.registry.interfaces.sourcepackagename import ISourcePackageNameSet |
2187 | 109 | from lp.services.browser_helpers import get_user_agent_distroseries | 108 | from lp.services.browser_helpers import get_user_agent_distroseries |
2188 | 109 | from lp.services.propertycache import cachedproperty | ||
2189 | 110 | from lp.services.worlddata.interfaces.country import ICountrySet | 110 | from lp.services.worlddata.interfaces.country import ICountrySet |
2190 | 111 | from lp.soyuz.adapters.archivedependencies import ( | 111 | from lp.soyuz.adapters.archivedependencies import ( |
2191 | 112 | default_component_dependency_name, | 112 | default_component_dependency_name, |
2192 | @@ -134,9 +134,7 @@ | |||
2193 | 134 | IPPAActivateForm, | 134 | IPPAActivateForm, |
2194 | 135 | NoSuchPPA, | 135 | NoSuchPPA, |
2195 | 136 | ) | 136 | ) |
2199 | 137 | from lp.soyuz.interfaces.archivepermission import ( | 137 | from lp.soyuz.interfaces.archivepermission import IArchivePermissionSet |
2197 | 138 | IArchivePermissionSet, | ||
2198 | 139 | ) | ||
2200 | 140 | from lp.soyuz.interfaces.archivesubscriber import IArchiveSubscriberSet | 138 | from lp.soyuz.interfaces.archivesubscriber import IArchiveSubscriberSet |
2201 | 141 | from lp.soyuz.interfaces.binarypackagebuild import ( | 139 | from lp.soyuz.interfaces.binarypackagebuild import ( |
2202 | 142 | BuildSetStatus, | 140 | BuildSetStatus, |
2203 | 143 | 141 | ||
2204 | === modified file 'lib/lp/soyuz/browser/archivesubscription.py' | |||
2205 | --- lib/lp/soyuz/browser/archivesubscription.py 2010-08-20 20:31:18 +0000 | |||
2206 | +++ lib/lp/soyuz/browser/archivesubscription.py 2010-09-02 12:57:56 +0000 | |||
2207 | @@ -30,7 +30,6 @@ | |||
2208 | 30 | Text, | 30 | Text, |
2209 | 31 | ) | 31 | ) |
2210 | 32 | 32 | ||
2211 | 33 | from canonical.cachedproperty import cachedproperty | ||
2212 | 34 | from canonical.launchpad import _ | 33 | from canonical.launchpad import _ |
2213 | 35 | from canonical.launchpad.webapp.launchpadform import ( | 34 | from canonical.launchpad.webapp.launchpadform import ( |
2214 | 36 | action, | 35 | action, |
2215 | @@ -45,6 +44,7 @@ | |||
2216 | 45 | from canonical.widgets import DateWidget | 44 | from canonical.widgets import DateWidget |
2217 | 46 | from canonical.widgets.popup import PersonPickerWidget | 45 | from canonical.widgets.popup import PersonPickerWidget |
2218 | 47 | from lp.services.fields import PersonChoice | 46 | from lp.services.fields import PersonChoice |
2219 | 47 | from lp.services.propertycache import cachedproperty | ||
2220 | 48 | from lp.soyuz.browser.sourceslist import ( | 48 | from lp.soyuz.browser.sourceslist import ( |
2221 | 49 | SourcesListEntries, | 49 | SourcesListEntries, |
2222 | 50 | SourcesListEntriesView, | 50 | SourcesListEntriesView, |
2223 | 51 | 51 | ||
2224 | === modified file 'lib/lp/soyuz/browser/build.py' | |||
2225 | --- lib/lp/soyuz/browser/build.py 2010-08-27 11:19:54 +0000 | |||
2226 | +++ lib/lp/soyuz/browser/build.py 2010-09-02 12:57:56 +0000 | |||
2227 | @@ -19,7 +19,6 @@ | |||
2228 | 19 | from zope.component import getUtility | 19 | from zope.component import getUtility |
2229 | 20 | from zope.interface import implements | 20 | from zope.interface import implements |
2230 | 21 | 21 | ||
2231 | 22 | from canonical.cachedproperty import cachedproperty | ||
2232 | 23 | from canonical.launchpad import _ | 22 | from canonical.launchpad import _ |
2233 | 24 | from canonical.launchpad.browser.librarian import ( | 23 | from canonical.launchpad.browser.librarian import ( |
2234 | 25 | FileNavigationMixin, | 24 | FileNavigationMixin, |
2235 | @@ -44,12 +43,13 @@ | |||
2236 | 44 | from lp.app.errors import UnexpectedFormData | 43 | from lp.app.errors import UnexpectedFormData |
2237 | 45 | from lp.buildmaster.enums import BuildStatus | 44 | from lp.buildmaster.enums import BuildStatus |
2238 | 46 | from lp.services.job.interfaces.job import JobStatus | 45 | from lp.services.job.interfaces.job import JobStatus |
2239 | 46 | from lp.services.propertycache import cachedproperty | ||
2240 | 47 | from lp.soyuz.enums import PackageUploadStatus | ||
2241 | 47 | from lp.soyuz.interfaces.binarypackagebuild import ( | 48 | from lp.soyuz.interfaces.binarypackagebuild import ( |
2242 | 48 | IBinaryPackageBuild, | 49 | IBinaryPackageBuild, |
2243 | 49 | IBinaryPackageBuildSet, | 50 | IBinaryPackageBuildSet, |
2244 | 50 | IBuildRescoreForm, | 51 | IBuildRescoreForm, |
2245 | 51 | ) | 52 | ) |
2246 | 52 | from lp.soyuz.enums import PackageUploadStatus | ||
2247 | 53 | 53 | ||
2248 | 54 | 54 | ||
2249 | 55 | class BuildUrl: | 55 | class BuildUrl: |
2250 | 56 | 56 | ||
2251 | === modified file 'lib/lp/soyuz/browser/builder.py' | |||
2252 | --- lib/lp/soyuz/browser/builder.py 2010-08-20 20:31:18 +0000 | |||
2253 | +++ lib/lp/soyuz/browser/builder.py 2010-09-02 12:57:56 +0000 | |||
2254 | @@ -28,7 +28,6 @@ | |||
2255 | 28 | from zope.event import notify | 28 | from zope.event import notify |
2256 | 29 | from zope.lifecycleevent import ObjectCreatedEvent | 29 | from zope.lifecycleevent import ObjectCreatedEvent |
2257 | 30 | 30 | ||
2258 | 31 | from canonical.cachedproperty import cachedproperty | ||
2259 | 32 | from canonical.launchpad import _ | 31 | from canonical.launchpad import _ |
2260 | 33 | from canonical.launchpad.webapp import ( | 32 | from canonical.launchpad.webapp import ( |
2261 | 34 | action, | 33 | action, |
2262 | @@ -53,6 +52,7 @@ | |||
2263 | 53 | IBuilder, | 52 | IBuilder, |
2264 | 54 | IBuilderSet, | 53 | IBuilderSet, |
2265 | 55 | ) | 54 | ) |
2266 | 55 | from lp.services.propertycache import cachedproperty | ||
2267 | 56 | from lp.soyuz.browser.build import BuildRecordsView | 56 | from lp.soyuz.browser.build import BuildRecordsView |
2268 | 57 | from lp.soyuz.interfaces.binarypackagebuild import IBinaryPackageBuildSet | 57 | from lp.soyuz.interfaces.binarypackagebuild import IBinaryPackageBuildSet |
2269 | 58 | 58 | ||
2270 | 59 | 59 | ||
2271 | === modified file 'lib/lp/soyuz/browser/distributionsourcepackagerelease.py' | |||
2272 | --- lib/lp/soyuz/browser/distributionsourcepackagerelease.py 2010-08-24 15:29:01 +0000 | |||
2273 | +++ lib/lp/soyuz/browser/distributionsourcepackagerelease.py 2010-09-02 12:57:56 +0000 | |||
2274 | @@ -14,7 +14,6 @@ | |||
2275 | 14 | 14 | ||
2276 | 15 | from zope.component import getUtility | 15 | from zope.component import getUtility |
2277 | 16 | 16 | ||
2278 | 17 | from canonical.cachedproperty import cachedproperty | ||
2279 | 18 | from canonical.launchpad.browser.librarian import ProxiedLibraryFileAlias | 17 | from canonical.launchpad.browser.librarian import ProxiedLibraryFileAlias |
2280 | 19 | from canonical.launchpad.webapp import ( | 18 | from canonical.launchpad.webapp import ( |
2281 | 20 | LaunchpadView, | 19 | LaunchpadView, |
2282 | @@ -25,11 +24,12 @@ | |||
2283 | 25 | from canonical.lazr.utils import smartquote | 24 | from canonical.lazr.utils import smartquote |
2284 | 26 | from lp.app.errors import NotFoundError | 25 | from lp.app.errors import NotFoundError |
2285 | 27 | from lp.archivepublisher.debversion import Version | 26 | from lp.archivepublisher.debversion import Version |
2286 | 27 | from lp.services.propertycache import cachedproperty | ||
2287 | 28 | from lp.soyuz.enums import PackagePublishingStatus | ||
2288 | 28 | from lp.soyuz.interfaces.binarypackagebuild import IBinaryPackageBuildSet | 29 | from lp.soyuz.interfaces.binarypackagebuild import IBinaryPackageBuildSet |
2289 | 29 | from lp.soyuz.interfaces.distributionsourcepackagerelease import ( | 30 | from lp.soyuz.interfaces.distributionsourcepackagerelease import ( |
2290 | 30 | IDistributionSourcePackageRelease, | 31 | IDistributionSourcePackageRelease, |
2291 | 31 | ) | 32 | ) |
2292 | 32 | from lp.soyuz.enums import PackagePublishingStatus | ||
2293 | 33 | 33 | ||
2294 | 34 | 34 | ||
2295 | 35 | class DistributionSourcePackageReleaseBreadcrumb(Breadcrumb): | 35 | class DistributionSourcePackageReleaseBreadcrumb(Breadcrumb): |
2296 | 36 | 36 | ||
2297 | === modified file 'lib/lp/soyuz/browser/packagesearch.py' | |||
2298 | --- lib/lp/soyuz/browser/packagesearch.py 2010-03-04 22:11:34 +0000 | |||
2299 | +++ lib/lp/soyuz/browser/packagesearch.py 2010-09-02 12:57:56 +0000 | |||
2300 | @@ -7,9 +7,9 @@ | |||
2301 | 7 | 'PackageSearchViewBase' | 7 | 'PackageSearchViewBase' |
2302 | 8 | ] | 8 | ] |
2303 | 9 | 9 | ||
2304 | 10 | from canonical.cachedproperty import cachedproperty | ||
2305 | 11 | from canonical.launchpad.webapp.batching import BatchNavigator | 10 | from canonical.launchpad.webapp.batching import BatchNavigator |
2306 | 12 | from canonical.launchpad.webapp.publisher import LaunchpadView | 11 | from canonical.launchpad.webapp.publisher import LaunchpadView |
2307 | 12 | from lp.services.propertycache import cachedproperty | ||
2308 | 13 | 13 | ||
2309 | 14 | 14 | ||
2310 | 15 | class PackageSearchViewBase(LaunchpadView): | 15 | class PackageSearchViewBase(LaunchpadView): |
2311 | 16 | 16 | ||
2312 | === modified file 'lib/lp/soyuz/browser/publishing.py' | |||
2313 | --- lib/lp/soyuz/browser/publishing.py 2010-08-24 15:29:01 +0000 | |||
2314 | +++ lib/lp/soyuz/browser/publishing.py 2010-09-02 12:57:56 +0000 | |||
2315 | @@ -17,11 +17,11 @@ | |||
2316 | 17 | from lazr.delegates import delegates | 17 | from lazr.delegates import delegates |
2317 | 18 | from zope.interface import implements | 18 | from zope.interface import implements |
2318 | 19 | 19 | ||
2319 | 20 | from canonical.cachedproperty import cachedproperty | ||
2320 | 21 | from canonical.launchpad.browser.librarian import ProxiedLibraryFileAlias | 20 | from canonical.launchpad.browser.librarian import ProxiedLibraryFileAlias |
2321 | 22 | from canonical.launchpad.webapp.authorization import check_permission | 21 | from canonical.launchpad.webapp.authorization import check_permission |
2322 | 23 | from canonical.launchpad.webapp.interfaces import ICanonicalUrlData | 22 | from canonical.launchpad.webapp.interfaces import ICanonicalUrlData |
2323 | 24 | from canonical.launchpad.webapp.publisher import LaunchpadView | 23 | from canonical.launchpad.webapp.publisher import LaunchpadView |
2324 | 24 | from lp.services.propertycache import cachedproperty | ||
2325 | 25 | from lp.soyuz.enums import PackagePublishingStatus | 25 | from lp.soyuz.enums import PackagePublishingStatus |
2326 | 26 | from lp.soyuz.interfaces.binarypackagebuild import BuildSetStatus | 26 | from lp.soyuz.interfaces.binarypackagebuild import BuildSetStatus |
2327 | 27 | from lp.soyuz.interfaces.packagediff import IPackageDiff | 27 | from lp.soyuz.interfaces.packagediff import IPackageDiff |
2328 | 28 | 28 | ||
2329 | === modified file 'lib/lp/soyuz/model/archive.py' | |||
2330 | --- lib/lp/soyuz/model/archive.py 2010-09-02 12:57:52 +0000 | |||
2331 | +++ lib/lp/soyuz/model/archive.py 2010-09-02 12:57:56 +0000 | |||
2332 | @@ -129,9 +129,7 @@ | |||
2333 | 129 | ) | 129 | ) |
2334 | 130 | from lp.soyuz.interfaces.archivearch import IArchiveArchSet | 130 | from lp.soyuz.interfaces.archivearch import IArchiveArchSet |
2335 | 131 | from lp.soyuz.interfaces.archiveauthtoken import IArchiveAuthTokenSet | 131 | from lp.soyuz.interfaces.archiveauthtoken import IArchiveAuthTokenSet |
2339 | 132 | from lp.soyuz.interfaces.archivepermission import ( | 132 | from lp.soyuz.interfaces.archivepermission import IArchivePermissionSet |
2337 | 133 | IArchivePermissionSet, | ||
2338 | 134 | ) | ||
2340 | 135 | from lp.soyuz.interfaces.archivesubscriber import ( | 133 | from lp.soyuz.interfaces.archivesubscriber import ( |
2341 | 136 | ArchiveSubscriptionError, | 134 | ArchiveSubscriptionError, |
2342 | 137 | IArchiveSubscriberSet, | 135 | IArchiveSubscriberSet, |
2343 | 138 | 136 | ||
2344 | === modified file 'lib/lp/soyuz/model/distroarchseriesbinarypackage.py' | |||
2345 | --- lib/lp/soyuz/model/distroarchseriesbinarypackage.py 2010-08-24 15:29:01 +0000 | |||
2346 | +++ lib/lp/soyuz/model/distroarchseriesbinarypackage.py 2010-09-02 12:57:56 +0000 | |||
2347 | @@ -17,14 +17,14 @@ | |||
2348 | 17 | ) | 17 | ) |
2349 | 18 | from zope.interface import implements | 18 | from zope.interface import implements |
2350 | 19 | 19 | ||
2351 | 20 | from canonical.cachedproperty import cachedproperty | ||
2352 | 21 | from canonical.database.sqlbase import sqlvalues | 20 | from canonical.database.sqlbase import sqlvalues |
2353 | 22 | from canonical.launchpad.interfaces import IStore | 21 | from canonical.launchpad.interfaces import IStore |
2354 | 23 | from lp.app.errors import NotFoundError | 22 | from lp.app.errors import NotFoundError |
2355 | 23 | from lp.services.propertycache import cachedproperty | ||
2356 | 24 | from lp.soyuz.enums import PackagePublishingStatus | ||
2357 | 24 | from lp.soyuz.interfaces.distroarchseriesbinarypackage import ( | 25 | from lp.soyuz.interfaces.distroarchseriesbinarypackage import ( |
2358 | 25 | IDistroArchSeriesBinaryPackage, | 26 | IDistroArchSeriesBinaryPackage, |
2359 | 26 | ) | 27 | ) |
2360 | 27 | from lp.soyuz.enums import PackagePublishingStatus | ||
2361 | 28 | from lp.soyuz.model.binarypackagerelease import BinaryPackageRelease | 28 | from lp.soyuz.model.binarypackagerelease import BinaryPackageRelease |
2362 | 29 | from lp.soyuz.model.distroarchseriesbinarypackagerelease import ( | 29 | from lp.soyuz.model.distroarchseriesbinarypackagerelease import ( |
2363 | 30 | DistroArchSeriesBinaryPackageRelease, | 30 | DistroArchSeriesBinaryPackageRelease, |
2364 | 31 | 31 | ||
2365 | === modified file 'lib/lp/soyuz/model/distroseriesbinarypackage.py' | |||
2366 | --- lib/lp/soyuz/model/distroseriesbinarypackage.py 2010-08-20 20:31:18 +0000 | |||
2367 | +++ lib/lp/soyuz/model/distroseriesbinarypackage.py 2010-09-02 12:57:56 +0000 | |||
2368 | @@ -12,8 +12,11 @@ | |||
2369 | 12 | from storm.store import Store | 12 | from storm.store import Store |
2370 | 13 | from zope.interface import implements | 13 | from zope.interface import implements |
2371 | 14 | 14 | ||
2372 | 15 | from canonical.cachedproperty import cachedproperty | ||
2373 | 16 | from canonical.database.sqlbase import sqlvalues | 15 | from canonical.database.sqlbase import sqlvalues |
2374 | 16 | from lp.services.propertycache import ( | ||
2375 | 17 | cachedproperty, | ||
2376 | 18 | IPropertyCache, | ||
2377 | 19 | ) | ||
2378 | 17 | from lp.soyuz.interfaces.distroseriesbinarypackage import ( | 20 | from lp.soyuz.interfaces.distroseriesbinarypackage import ( |
2379 | 18 | IDistroSeriesBinaryPackage, | 21 | IDistroSeriesBinaryPackage, |
2380 | 19 | ) | 22 | ) |
2381 | @@ -40,7 +43,7 @@ | |||
2382 | 40 | self.distroseries = distroseries | 43 | self.distroseries = distroseries |
2383 | 41 | self.binarypackagename = binarypackagename | 44 | self.binarypackagename = binarypackagename |
2384 | 42 | if cache is not None: | 45 | if cache is not None: |
2386 | 43 | self._cache = cache | 46 | IPropertyCache(self).cache = cache |
2387 | 44 | 47 | ||
2388 | 45 | @property | 48 | @property |
2389 | 46 | def name(self): | 49 | def name(self): |
2390 | @@ -58,7 +61,7 @@ | |||
2391 | 58 | """See IDistroSeriesBinaryPackage.""" | 61 | """See IDistroSeriesBinaryPackage.""" |
2392 | 59 | return self.distroseries.distribution | 62 | return self.distroseries.distribution |
2393 | 60 | 63 | ||
2395 | 61 | @cachedproperty('_cache') | 64 | @cachedproperty |
2396 | 62 | def cache(self): | 65 | def cache(self): |
2397 | 63 | """See IDistroSeriesBinaryPackage.""" | 66 | """See IDistroSeriesBinaryPackage.""" |
2398 | 64 | store = Store.of(self.distroseries) | 67 | store = Store.of(self.distroseries) |
2399 | 65 | 68 | ||
2400 | === modified file 'lib/lp/soyuz/model/queue.py' | |||
2401 | --- lib/lp/soyuz/model/queue.py 2010-08-24 12:25:48 +0000 | |||
2402 | +++ lib/lp/soyuz/model/queue.py 2010-09-02 12:57:56 +0000 | |||
2403 | @@ -33,7 +33,6 @@ | |||
2404 | 33 | from zope.component import getUtility | 33 | from zope.component import getUtility |
2405 | 34 | from zope.interface import implements | 34 | from zope.interface import implements |
2406 | 35 | 35 | ||
2407 | 36 | from canonical.cachedproperty import cachedproperty | ||
2408 | 37 | from canonical.config import config | 36 | from canonical.config import config |
2409 | 38 | from canonical.database.constants import UTC_NOW | 37 | from canonical.database.constants import UTC_NOW |
2410 | 39 | from canonical.database.datetimecol import UtcDateTimeCol | 38 | from canonical.database.datetimecol import UtcDateTimeCol |
2411 | @@ -72,6 +71,7 @@ | |||
2412 | 72 | PackagePublishingPocket, | 71 | PackagePublishingPocket, |
2413 | 73 | pocketsuffix, | 72 | pocketsuffix, |
2414 | 74 | ) | 73 | ) |
2415 | 74 | from lp.services.propertycache import cachedproperty | ||
2416 | 75 | from lp.soyuz.enums import ( | 75 | from lp.soyuz.enums import ( |
2417 | 76 | BinaryPackageFormat, | 76 | BinaryPackageFormat, |
2418 | 77 | PackageUploadCustomFormat, | 77 | PackageUploadCustomFormat, |
2419 | 78 | 78 | ||
2420 | === modified file 'lib/lp/soyuz/model/sourcepackagerelease.py' | |||
2421 | --- lib/lp/soyuz/model/sourcepackagerelease.py 2010-08-27 11:19:54 +0000 | |||
2422 | +++ lib/lp/soyuz/model/sourcepackagerelease.py 2010-09-02 12:57:56 +0000 | |||
2423 | @@ -30,7 +30,6 @@ | |||
2424 | 30 | from zope.component import getUtility | 30 | from zope.component import getUtility |
2425 | 31 | from zope.interface import implements | 31 | from zope.interface import implements |
2426 | 32 | 32 | ||
2427 | 33 | from canonical.cachedproperty import cachedproperty | ||
2428 | 34 | from canonical.database.constants import ( | 33 | from canonical.database.constants import ( |
2429 | 35 | DEFAULT, | 34 | DEFAULT, |
2430 | 36 | UTC_NOW, | 35 | UTC_NOW, |
2431 | @@ -59,6 +58,7 @@ | |||
2432 | 59 | SourcePackageType, | 58 | SourcePackageType, |
2433 | 60 | SourcePackageUrgency, | 59 | SourcePackageUrgency, |
2434 | 61 | ) | 60 | ) |
2435 | 61 | from lp.services.propertycache import cachedproperty | ||
2436 | 62 | from lp.soyuz.enums import ( | 62 | from lp.soyuz.enums import ( |
2437 | 63 | PackageDiffStatus, | 63 | PackageDiffStatus, |
2438 | 64 | PackagePublishingStatus, | 64 | PackagePublishingStatus, |
2439 | @@ -68,9 +68,7 @@ | |||
2440 | 68 | MAIN_ARCHIVE_PURPOSES, | 68 | MAIN_ARCHIVE_PURPOSES, |
2441 | 69 | ) | 69 | ) |
2442 | 70 | from lp.soyuz.interfaces.binarypackagebuild import IBinaryPackageBuildSet | 70 | from lp.soyuz.interfaces.binarypackagebuild import IBinaryPackageBuildSet |
2446 | 71 | from lp.soyuz.interfaces.packagediff import ( | 71 | from lp.soyuz.interfaces.packagediff import PackageDiffAlreadyRequested |
2444 | 72 | PackageDiffAlreadyRequested, | ||
2445 | 73 | ) | ||
2447 | 74 | from lp.soyuz.interfaces.sourcepackagerelease import ISourcePackageRelease | 72 | from lp.soyuz.interfaces.sourcepackagerelease import ISourcePackageRelease |
2448 | 75 | from lp.soyuz.model.binarypackagebuild import BinaryPackageBuild | 73 | from lp.soyuz.model.binarypackagebuild import BinaryPackageBuild |
2449 | 76 | from lp.soyuz.model.files import SourcePackageReleaseFile | 74 | from lp.soyuz.model.files import SourcePackageReleaseFile |
2450 | 77 | 75 | ||
2451 | === modified file 'lib/lp/soyuz/scripts/ppareport.py' | |||
2452 | --- lib/lp/soyuz/scripts/ppareport.py 2010-08-23 16:51:11 +0000 | |||
2453 | +++ lib/lp/soyuz/scripts/ppareport.py 2010-09-02 12:57:56 +0000 | |||
2454 | @@ -19,11 +19,11 @@ | |||
2455 | 19 | from storm.store import Store | 19 | from storm.store import Store |
2456 | 20 | from zope.component import getUtility | 20 | from zope.component import getUtility |
2457 | 21 | 21 | ||
2458 | 22 | from canonical.cachedproperty import cachedproperty | ||
2459 | 23 | from canonical.config import config | 22 | from canonical.config import config |
2460 | 24 | from canonical.launchpad.helpers import emailPeople | 23 | from canonical.launchpad.helpers import emailPeople |
2461 | 25 | from canonical.launchpad.webapp import canonical_url | 24 | from canonical.launchpad.webapp import canonical_url |
2462 | 26 | from lp.registry.interfaces.distribution import IDistributionSet | 25 | from lp.registry.interfaces.distribution import IDistributionSet |
2463 | 26 | from lp.services.propertycache import cachedproperty | ||
2464 | 27 | from lp.services.scripts.base import ( | 27 | from lp.services.scripts.base import ( |
2465 | 28 | LaunchpadScript, | 28 | LaunchpadScript, |
2466 | 29 | LaunchpadScriptFailure, | 29 | LaunchpadScriptFailure, |
2467 | 30 | 30 | ||
2468 | === modified file 'lib/lp/soyuz/scripts/queue.py' | |||
2469 | --- lib/lp/soyuz/scripts/queue.py 2010-08-24 12:25:48 +0000 | |||
2470 | +++ lib/lp/soyuz/scripts/queue.py 2010-09-02 12:57:56 +0000 | |||
2471 | @@ -24,11 +24,11 @@ | |||
2472 | 24 | import pytz | 24 | import pytz |
2473 | 25 | from zope.component import getUtility | 25 | from zope.component import getUtility |
2474 | 26 | 26 | ||
2475 | 27 | from canonical.cachedproperty import cachedproperty | ||
2476 | 28 | from canonical.config import config | 27 | from canonical.config import config |
2477 | 29 | from canonical.launchpad.webapp.tales import DurationFormatterAPI | 28 | from canonical.launchpad.webapp.tales import DurationFormatterAPI |
2478 | 30 | from canonical.librarian.utils import filechunks | 29 | from canonical.librarian.utils import filechunks |
2479 | 31 | from lp.app.errors import NotFoundError | 30 | from lp.app.errors import NotFoundError |
2480 | 31 | from lp.services.propertycache import cachedproperty | ||
2481 | 32 | from lp.soyuz.enums import PackageUploadStatus | 32 | from lp.soyuz.enums import PackageUploadStatus |
2482 | 33 | from lp.soyuz.interfaces.component import IComponentSet | 33 | from lp.soyuz.interfaces.component import IComponentSet |
2483 | 34 | from lp.soyuz.interfaces.queue import ( | 34 | from lp.soyuz.interfaces.queue import ( |
2484 | 35 | 35 | ||
2485 | === modified file 'lib/lp/testing/__init__.py' | |||
2486 | --- lib/lp/testing/__init__.py 2010-08-30 21:10:54 +0000 | |||
2487 | +++ lib/lp/testing/__init__.py 2010-09-02 12:57:56 +0000 | |||
2488 | @@ -56,7 +56,6 @@ | |||
2489 | 56 | ) | 56 | ) |
2490 | 57 | from inspect import ( | 57 | from inspect import ( |
2491 | 58 | getargspec, | 58 | getargspec, |
2492 | 59 | getmembers, | ||
2493 | 60 | getmro, | 59 | getmro, |
2494 | 61 | isclass, | 60 | isclass, |
2495 | 62 | ismethod, | 61 | ismethod, |
2496 | @@ -1023,7 +1022,13 @@ | |||
2497 | 1023 | assert isclass(mock_class), ( | 1022 | assert isclass(mock_class), ( |
2498 | 1024 | "validate_mock_class() must be called for a class") | 1023 | "validate_mock_class() must be called for a class") |
2499 | 1025 | base_classes = getmro(mock_class) | 1024 | base_classes = getmro(mock_class) |
2501 | 1026 | for name, obj in getmembers(mock_class): | 1025 | # Don't use inspect.getmembers() here because it fails on __provides__, a |
2502 | 1026 | # descriptor added by zope.interface as part of its caching strategy. See | ||
2503 | 1027 | # http://comments.gmane.org/gmane.comp.python.zope.interface/241. | ||
2504 | 1028 | for name in dir(mock_class): | ||
2505 | 1029 | if name == '__provides__': | ||
2506 | 1030 | continue | ||
2507 | 1031 | obj = getattr(mock_class, name) | ||
2508 | 1027 | if ismethod(obj): | 1032 | if ismethod(obj): |
2509 | 1028 | for base_class in base_classes[1:]: | 1033 | for base_class in base_classes[1:]: |
2510 | 1029 | if name in base_class.__dict__: | 1034 | if name in base_class.__dict__: |
2511 | 1030 | 1035 | ||
2512 | === modified file 'lib/lp/testopenid/browser/server.py' | |||
2513 | --- lib/lp/testopenid/browser/server.py 2010-08-20 20:31:18 +0000 | |||
2514 | +++ lib/lp/testopenid/browser/server.py 2010-09-02 12:57:56 +0000 | |||
2515 | @@ -32,7 +32,6 @@ | |||
2516 | 32 | from zope.security.proxy import isinstance as zisinstance | 32 | from zope.security.proxy import isinstance as zisinstance |
2517 | 33 | from zope.session.interfaces import ISession | 33 | from zope.session.interfaces import ISession |
2518 | 34 | 34 | ||
2519 | 35 | from canonical.cachedproperty import cachedproperty | ||
2520 | 36 | from canonical.launchpad import _ | 35 | from canonical.launchpad import _ |
2521 | 37 | from canonical.launchpad.interfaces.account import ( | 36 | from canonical.launchpad.interfaces.account import ( |
2522 | 38 | AccountStatus, | 37 | AccountStatus, |
2523 | @@ -61,6 +60,10 @@ | |||
2524 | 61 | from lp.services.openid.browser.openiddiscovery import ( | 60 | from lp.services.openid.browser.openiddiscovery import ( |
2525 | 62 | XRDSContentNegotiationMixin, | 61 | XRDSContentNegotiationMixin, |
2526 | 63 | ) | 62 | ) |
2527 | 63 | from lp.services.propertycache import ( | ||
2528 | 64 | cachedproperty, | ||
2529 | 65 | IPropertyCache, | ||
2530 | 66 | ) | ||
2531 | 64 | from lp.testopenid.interfaces.server import ( | 67 | from lp.testopenid.interfaces.server import ( |
2532 | 65 | get_server_url, | 68 | get_server_url, |
2533 | 66 | ITestOpenIDApplication, | 69 | ITestOpenIDApplication, |
2534 | @@ -142,7 +145,7 @@ | |||
2535 | 142 | return (self.openid_request.idSelect() or | 145 | return (self.openid_request.idSelect() or |
2536 | 143 | self.openid_request.identity == self.user_identity_url) | 146 | self.openid_request.identity == self.user_identity_url) |
2537 | 144 | 147 | ||
2539 | 145 | @cachedproperty('_openid_parameters') | 148 | @cachedproperty |
2540 | 146 | def openid_parameters(self): | 149 | def openid_parameters(self): |
2541 | 147 | """A dictionary of OpenID query parameters from request.""" | 150 | """A dictionary of OpenID query parameters from request.""" |
2542 | 148 | query = {} | 151 | query = {} |
2543 | @@ -165,8 +168,9 @@ | |||
2544 | 165 | def restoreRequestFromSession(self): | 168 | def restoreRequestFromSession(self): |
2545 | 166 | """Get the OpenIDRequest from our session.""" | 169 | """Get the OpenIDRequest from our session.""" |
2546 | 167 | session = self.getSession() | 170 | session = self.getSession() |
2547 | 171 | cache = IPropertyCache(self) | ||
2548 | 168 | try: | 172 | try: |
2550 | 169 | self._openid_parameters = session[OPENID_REQUEST_SESSION_KEY] | 173 | cache.openid_parameters = session[OPENID_REQUEST_SESSION_KEY] |
2551 | 170 | except KeyError: | 174 | except KeyError: |
2552 | 171 | raise UnexpectedFormData("No OpenID request in session") | 175 | raise UnexpectedFormData("No OpenID request in session") |
2553 | 172 | 176 | ||
2554 | 173 | 177 | ||
2555 | === modified file 'lib/lp/translations/browser/distribution.py' | |||
2556 | --- lib/lp/translations/browser/distribution.py 2010-08-20 20:31:18 +0000 | |||
2557 | +++ lib/lp/translations/browser/distribution.py 2010-09-02 12:57:56 +0000 | |||
2558 | @@ -13,7 +13,6 @@ | |||
2559 | 13 | 13 | ||
2560 | 14 | import operator | 14 | import operator |
2561 | 15 | 15 | ||
2562 | 16 | from canonical.cachedproperty import cachedproperty | ||
2563 | 17 | from canonical.launchpad.webapp import ( | 16 | from canonical.launchpad.webapp import ( |
2564 | 18 | action, | 17 | action, |
2565 | 19 | canonical_url, | 18 | canonical_url, |
2566 | @@ -26,6 +25,7 @@ | |||
2567 | 26 | from lp.registry.browser.distribution import DistributionEditView | 25 | from lp.registry.browser.distribution import DistributionEditView |
2568 | 27 | from lp.registry.interfaces.distribution import IDistribution | 26 | from lp.registry.interfaces.distribution import IDistribution |
2569 | 28 | from lp.registry.interfaces.series import SeriesStatus | 27 | from lp.registry.interfaces.series import SeriesStatus |
2570 | 28 | from lp.services.propertycache import cachedproperty | ||
2571 | 29 | from lp.translations.browser.translations import TranslationsMixin | 29 | from lp.translations.browser.translations import TranslationsMixin |
2572 | 30 | 30 | ||
2573 | 31 | 31 | ||
2574 | 32 | 32 | ||
2575 | === modified file 'lib/lp/translations/browser/distroseries.py' | |||
2576 | --- lib/lp/translations/browser/distroseries.py 2010-08-20 20:31:18 +0000 | |||
2577 | +++ lib/lp/translations/browser/distroseries.py 2010-09-02 12:57:56 +0000 | |||
2578 | @@ -16,7 +16,6 @@ | |||
2579 | 16 | 16 | ||
2580 | 17 | from zope.component import getUtility | 17 | from zope.component import getUtility |
2581 | 18 | 18 | ||
2582 | 19 | from canonical.cachedproperty import cachedproperty | ||
2583 | 20 | from canonical.launchpad import helpers | 19 | from canonical.launchpad import helpers |
2584 | 21 | from canonical.launchpad.webapp import action | 20 | from canonical.launchpad.webapp import action |
2585 | 22 | from canonical.launchpad.webapp.authorization import check_permission | 21 | from canonical.launchpad.webapp.authorization import check_permission |
2586 | @@ -33,6 +32,7 @@ | |||
2587 | 33 | from lp.app.errors import TranslationUnavailable | 32 | from lp.app.errors import TranslationUnavailable |
2588 | 34 | from lp.registry.interfaces.distroseries import IDistroSeries | 33 | from lp.registry.interfaces.distroseries import IDistroSeries |
2589 | 35 | from lp.registry.interfaces.series import SeriesStatus | 34 | from lp.registry.interfaces.series import SeriesStatus |
2590 | 35 | from lp.services.propertycache import cachedproperty | ||
2591 | 36 | from lp.translations.browser.potemplate import BaseSeriesTemplatesView | 36 | from lp.translations.browser.potemplate import BaseSeriesTemplatesView |
2592 | 37 | from lp.translations.browser.translations import TranslationsMixin | 37 | from lp.translations.browser.translations import TranslationsMixin |
2593 | 38 | from lp.translations.interfaces.distroserieslanguage import ( | 38 | from lp.translations.interfaces.distroserieslanguage import ( |
2594 | 39 | 39 | ||
2595 | === modified file 'lib/lp/translations/browser/hastranslationimports.py' | |||
2596 | --- lib/lp/translations/browser/hastranslationimports.py 2010-08-20 20:31:18 +0000 | |||
2597 | +++ lib/lp/translations/browser/hastranslationimports.py 2010-09-02 12:57:56 +0000 | |||
2598 | @@ -25,7 +25,6 @@ | |||
2599 | 25 | SimpleVocabulary, | 25 | SimpleVocabulary, |
2600 | 26 | ) | 26 | ) |
2601 | 27 | 27 | ||
2602 | 28 | from canonical.cachedproperty import cachedproperty | ||
2603 | 29 | from canonical.launchpad import _ | 28 | from canonical.launchpad import _ |
2604 | 30 | from canonical.launchpad.webapp import ( | 29 | from canonical.launchpad.webapp import ( |
2605 | 31 | action, | 30 | action, |
2606 | @@ -40,6 +39,7 @@ | |||
2607 | 40 | from lp.app.errors import UnexpectedFormData | 39 | from lp.app.errors import UnexpectedFormData |
2608 | 41 | from lp.registry.interfaces.distribution import IDistribution | 40 | from lp.registry.interfaces.distribution import IDistribution |
2609 | 42 | from lp.registry.interfaces.pillar import IPillarNameSet | 41 | from lp.registry.interfaces.pillar import IPillarNameSet |
2610 | 42 | from lp.services.propertycache import cachedproperty | ||
2611 | 43 | from lp.translations.interfaces.translationimportqueue import ( | 43 | from lp.translations.interfaces.translationimportqueue import ( |
2612 | 44 | IHasTranslationImports, | 44 | IHasTranslationImports, |
2613 | 45 | ITranslationImportQueue, | 45 | ITranslationImportQueue, |
2614 | 46 | 46 | ||
2615 | === modified file 'lib/lp/translations/browser/language.py' | |||
2616 | --- lib/lp/translations/browser/language.py 2010-08-20 20:31:18 +0000 | |||
2617 | +++ lib/lp/translations/browser/language.py 2010-09-02 12:57:56 +0000 | |||
2618 | @@ -21,7 +21,6 @@ | |||
2619 | 21 | from zope.lifecycleevent import ObjectCreatedEvent | 21 | from zope.lifecycleevent import ObjectCreatedEvent |
2620 | 22 | from zope.schema import TextLine | 22 | from zope.schema import TextLine |
2621 | 23 | 23 | ||
2622 | 24 | from canonical.cachedproperty import cachedproperty | ||
2623 | 25 | from canonical.launchpad.interfaces.launchpad import ILaunchpadCelebrities | 24 | from canonical.launchpad.interfaces.launchpad import ILaunchpadCelebrities |
2624 | 26 | from canonical.launchpad.webapp import ( | 25 | from canonical.launchpad.webapp import ( |
2625 | 27 | action, | 26 | action, |
2626 | @@ -39,6 +38,7 @@ | |||
2627 | 39 | from canonical.launchpad.webapp.breadcrumb import Breadcrumb | 38 | from canonical.launchpad.webapp.breadcrumb import Breadcrumb |
2628 | 40 | from canonical.launchpad.webapp.tales import LanguageFormatterAPI | 39 | from canonical.launchpad.webapp.tales import LanguageFormatterAPI |
2629 | 41 | from canonical.widgets import LabeledMultiCheckBoxWidget | 40 | from canonical.widgets import LabeledMultiCheckBoxWidget |
2630 | 41 | from lp.services.propertycache import cachedproperty | ||
2631 | 42 | from lp.services.worlddata.interfaces.language import ( | 42 | from lp.services.worlddata.interfaces.language import ( |
2632 | 43 | ILanguage, | 43 | ILanguage, |
2633 | 44 | ILanguageSet, | 44 | ILanguageSet, |
2634 | 45 | 45 | ||
2635 | === modified file 'lib/lp/translations/browser/person.py' | |||
2636 | --- lib/lp/translations/browser/person.py 2010-08-20 20:31:18 +0000 | |||
2637 | +++ lib/lp/translations/browser/person.py 2010-09-02 12:57:56 +0000 | |||
2638 | @@ -25,7 +25,6 @@ | |||
2639 | 25 | Interface, | 25 | Interface, |
2640 | 26 | ) | 26 | ) |
2641 | 27 | 27 | ||
2642 | 28 | from canonical.cachedproperty import cachedproperty | ||
2643 | 29 | from canonical.launchpad import _ | 28 | from canonical.launchpad import _ |
2644 | 30 | from canonical.launchpad.webapp import ( | 29 | from canonical.launchpad.webapp import ( |
2645 | 31 | action, | 30 | action, |
2646 | @@ -40,6 +39,7 @@ | |||
2647 | 40 | from canonical.launchpad.webapp.publisher import LaunchpadView | 39 | from canonical.launchpad.webapp.publisher import LaunchpadView |
2648 | 41 | from canonical.widgets import LaunchpadRadioWidget | 40 | from canonical.widgets import LaunchpadRadioWidget |
2649 | 42 | from lp.registry.interfaces.sourcepackage import ISourcePackage | 41 | from lp.registry.interfaces.sourcepackage import ISourcePackage |
2650 | 42 | from lp.services.propertycache import cachedproperty | ||
2651 | 43 | from lp.translations.browser.translationlinksaggregator import ( | 43 | from lp.translations.browser.translationlinksaggregator import ( |
2652 | 44 | TranslationLinksAggregator, | 44 | TranslationLinksAggregator, |
2653 | 45 | ) | 45 | ) |
2654 | 46 | 46 | ||
2655 | === modified file 'lib/lp/translations/browser/poexportrequest.py' | |||
2656 | --- lib/lp/translations/browser/poexportrequest.py 2010-08-20 20:31:18 +0000 | |||
2657 | +++ lib/lp/translations/browser/poexportrequest.py 2010-09-02 12:57:56 +0000 | |||
2658 | @@ -11,13 +11,13 @@ | |||
2659 | 11 | 11 | ||
2660 | 12 | from zope.component import getUtility | 12 | from zope.component import getUtility |
2661 | 13 | 13 | ||
2662 | 14 | from canonical.cachedproperty import cachedproperty | ||
2663 | 15 | from canonical.launchpad import _ | 14 | from canonical.launchpad import _ |
2664 | 16 | from canonical.launchpad.webapp import ( | 15 | from canonical.launchpad.webapp import ( |
2665 | 17 | canonical_url, | 16 | canonical_url, |
2666 | 18 | LaunchpadView, | 17 | LaunchpadView, |
2667 | 19 | ) | 18 | ) |
2668 | 20 | from canonical.launchpad.webapp.tales import DurationFormatterAPI | 19 | from canonical.launchpad.webapp.tales import DurationFormatterAPI |
2669 | 20 | from lp.services.propertycache import cachedproperty | ||
2670 | 21 | from lp.translations.interfaces.poexportrequest import IPOExportRequestSet | 21 | from lp.translations.interfaces.poexportrequest import IPOExportRequestSet |
2671 | 22 | from lp.translations.interfaces.potemplate import IHasTranslationTemplates | 22 | from lp.translations.interfaces.potemplate import IHasTranslationTemplates |
2672 | 23 | from lp.translations.interfaces.translationexporter import ( | 23 | from lp.translations.interfaces.translationexporter import ( |
2673 | 24 | 24 | ||
2674 | === modified file 'lib/lp/translations/browser/pofile.py' | |||
2675 | --- lib/lp/translations/browser/pofile.py 2010-08-27 10:53:40 +0000 | |||
2676 | +++ lib/lp/translations/browser/pofile.py 2010-09-02 12:57:56 +0000 | |||
2677 | @@ -24,7 +24,6 @@ | |||
2678 | 24 | from zope.component import getUtility | 24 | from zope.component import getUtility |
2679 | 25 | from zope.publisher.browser import FileUpload | 25 | from zope.publisher.browser import FileUpload |
2680 | 26 | 26 | ||
2681 | 27 | from canonical.cachedproperty import cachedproperty | ||
2682 | 28 | from canonical.config import config | 27 | from canonical.config import config |
2683 | 29 | from canonical.launchpad import _ | 28 | from canonical.launchpad import _ |
2684 | 30 | from canonical.launchpad.interfaces import ILaunchBag | 29 | from canonical.launchpad.interfaces import ILaunchBag |
2685 | @@ -44,6 +43,7 @@ | |||
2686 | 44 | UnexpectedFormData, | 43 | UnexpectedFormData, |
2687 | 45 | ) | 44 | ) |
2688 | 46 | from lp.registry.interfaces.person import IPersonSet | 45 | from lp.registry.interfaces.person import IPersonSet |
2689 | 46 | from lp.services.propertycache import cachedproperty | ||
2690 | 47 | from lp.translations.browser.poexportrequest import BaseExportView | 47 | from lp.translations.browser.poexportrequest import BaseExportView |
2691 | 48 | from lp.translations.browser.potemplate import POTemplateFacets | 48 | from lp.translations.browser.potemplate import POTemplateFacets |
2692 | 49 | from lp.translations.browser.translationmessage import ( | 49 | from lp.translations.browser.translationmessage import ( |
2693 | 50 | 50 | ||
2694 | === modified file 'lib/lp/translations/browser/product.py' | |||
2695 | --- lib/lp/translations/browser/product.py 2010-08-20 20:31:18 +0000 | |||
2696 | +++ lib/lp/translations/browser/product.py 2010-09-02 12:57:56 +0000 | |||
2697 | @@ -11,7 +11,6 @@ | |||
2698 | 11 | 'ProductView', | 11 | 'ProductView', |
2699 | 12 | ] | 12 | ] |
2700 | 13 | 13 | ||
2701 | 14 | from canonical.cachedproperty import cachedproperty | ||
2702 | 15 | from canonical.launchpad.webapp import ( | 14 | from canonical.launchpad.webapp import ( |
2703 | 16 | canonical_url, | 15 | canonical_url, |
2704 | 17 | enabled_with_permission, | 16 | enabled_with_permission, |
2705 | @@ -24,6 +23,7 @@ | |||
2706 | 24 | from lp.registry.interfaces.product import IProduct | 23 | from lp.registry.interfaces.product import IProduct |
2707 | 25 | from lp.registry.interfaces.productseries import IProductSeries | 24 | from lp.registry.interfaces.productseries import IProductSeries |
2708 | 26 | from lp.registry.interfaces.series import SeriesStatus | 25 | from lp.registry.interfaces.series import SeriesStatus |
2709 | 26 | from lp.services.propertycache import cachedproperty | ||
2710 | 27 | from lp.translations.browser.translations import TranslationsMixin | 27 | from lp.translations.browser.translations import TranslationsMixin |
2711 | 28 | 28 | ||
2712 | 29 | 29 | ||
2713 | 30 | 30 | ||
2714 | === modified file 'lib/lp/translations/browser/productseries.py' | |||
2715 | --- lib/lp/translations/browser/productseries.py 2010-08-20 20:31:18 +0000 | |||
2716 | +++ lib/lp/translations/browser/productseries.py 2010-09-02 12:57:56 +0000 | |||
2717 | @@ -24,7 +24,6 @@ | |||
2718 | 24 | from zope.component import getUtility | 24 | from zope.component import getUtility |
2719 | 25 | from zope.publisher.browser import FileUpload | 25 | from zope.publisher.browser import FileUpload |
2720 | 26 | 26 | ||
2721 | 27 | from canonical.cachedproperty import cachedproperty | ||
2722 | 28 | from canonical.launchpad import _ | 27 | from canonical.launchpad import _ |
2723 | 29 | from canonical.launchpad.helpers import is_tar_filename | 28 | from canonical.launchpad.helpers import is_tar_filename |
2724 | 30 | from canonical.launchpad.webapp import ( | 29 | from canonical.launchpad.webapp import ( |
2725 | @@ -42,6 +41,7 @@ | |||
2726 | 42 | from canonical.widgets.itemswidgets import LaunchpadRadioWidgetWithDescription | 41 | from canonical.widgets.itemswidgets import LaunchpadRadioWidgetWithDescription |
2727 | 43 | from lp.code.interfaces.branchjob import IRosettaUploadJobSource | 42 | from lp.code.interfaces.branchjob import IRosettaUploadJobSource |
2728 | 44 | from lp.registry.interfaces.productseries import IProductSeries | 43 | from lp.registry.interfaces.productseries import IProductSeries |
2729 | 44 | from lp.services.propertycache import cachedproperty | ||
2730 | 45 | from lp.translations.browser.poexportrequest import BaseExportView | 45 | from lp.translations.browser.poexportrequest import BaseExportView |
2731 | 46 | from lp.translations.browser.potemplate import BaseSeriesTemplatesView | 46 | from lp.translations.browser.potemplate import BaseSeriesTemplatesView |
2732 | 47 | from lp.translations.browser.translations import TranslationsMixin | 47 | from lp.translations.browser.translations import TranslationsMixin |
2733 | 48 | 48 | ||
2734 | === modified file 'lib/lp/translations/browser/serieslanguage.py' | |||
2735 | --- lib/lp/translations/browser/serieslanguage.py 2010-08-20 20:31:18 +0000 | |||
2736 | +++ lib/lp/translations/browser/serieslanguage.py 2010-09-02 12:57:56 +0000 | |||
2737 | @@ -12,12 +12,12 @@ | |||
2738 | 12 | 'ProductSeriesLanguageView', | 12 | 'ProductSeriesLanguageView', |
2739 | 13 | ] | 13 | ] |
2740 | 14 | 14 | ||
2741 | 15 | from canonical.cachedproperty import cachedproperty | ||
2742 | 16 | from canonical.launchpad.readonly import is_read_only | 15 | from canonical.launchpad.readonly import is_read_only |
2743 | 17 | from canonical.launchpad.webapp import LaunchpadView | 16 | from canonical.launchpad.webapp import LaunchpadView |
2744 | 18 | from canonical.launchpad.webapp.batching import BatchNavigator | 17 | from canonical.launchpad.webapp.batching import BatchNavigator |
2745 | 19 | from canonical.launchpad.webapp.publisher import Navigation | 18 | from canonical.launchpad.webapp.publisher import Navigation |
2746 | 20 | from canonical.launchpad.webapp.tales import PersonFormatterAPI | 19 | from canonical.launchpad.webapp.tales import PersonFormatterAPI |
2747 | 20 | from lp.services.propertycache import cachedproperty | ||
2748 | 21 | from lp.translations.interfaces.distroserieslanguage import ( | 21 | from lp.translations.interfaces.distroserieslanguage import ( |
2749 | 22 | IDistroSeriesLanguage, | 22 | IDistroSeriesLanguage, |
2750 | 23 | ) | 23 | ) |
2751 | 24 | 24 | ||
2752 | === modified file 'lib/lp/translations/browser/translationmessage.py' | |||
2753 | --- lib/lp/translations/browser/translationmessage.py 2010-08-20 20:31:18 +0000 | |||
2754 | +++ lib/lp/translations/browser/translationmessage.py 2010-09-02 12:57:56 +0000 | |||
2755 | @@ -37,7 +37,6 @@ | |||
2756 | 37 | from zope.interface import implements | 37 | from zope.interface import implements |
2757 | 38 | from zope.schema.vocabulary import getVocabularyRegistry | 38 | from zope.schema.vocabulary import getVocabularyRegistry |
2758 | 39 | 39 | ||
2759 | 40 | from canonical.cachedproperty import cachedproperty | ||
2760 | 41 | from canonical.launchpad.webapp import ( | 40 | from canonical.launchpad.webapp import ( |
2761 | 42 | ApplicationMenu, | 41 | ApplicationMenu, |
2762 | 43 | canonical_url, | 42 | canonical_url, |
2763 | @@ -50,6 +49,7 @@ | |||
2764 | 50 | from canonical.launchpad.webapp.interfaces import ILaunchBag | 49 | from canonical.launchpad.webapp.interfaces import ILaunchBag |
2765 | 51 | from canonical.launchpad.webapp.menu import structured | 50 | from canonical.launchpad.webapp.menu import structured |
2766 | 52 | from lp.app.errors import UnexpectedFormData | 51 | from lp.app.errors import UnexpectedFormData |
2767 | 52 | from lp.services.propertycache import cachedproperty | ||
2768 | 53 | from lp.translations.browser.browser_helpers import ( | 53 | from lp.translations.browser.browser_helpers import ( |
2769 | 54 | contract_rosetta_escapes, | 54 | contract_rosetta_escapes, |
2770 | 55 | convert_newlines_to_web_form, | 55 | convert_newlines_to_web_form, |
2771 | 56 | 56 | ||
2772 | === modified file 'lib/lp/translations/browser/translations.py' | |||
2773 | --- lib/lp/translations/browser/translations.py 2010-08-20 20:31:18 +0000 | |||
2774 | +++ lib/lp/translations/browser/translations.py 2010-09-02 12:57:56 +0000 | |||
2775 | @@ -17,7 +17,6 @@ | |||
2776 | 17 | 17 | ||
2777 | 18 | from zope.component import getUtility | 18 | from zope.component import getUtility |
2778 | 19 | 19 | ||
2779 | 20 | from canonical.cachedproperty import cachedproperty | ||
2780 | 21 | from canonical.config import config | 20 | from canonical.config import config |
2781 | 22 | from canonical.launchpad import helpers | 21 | from canonical.launchpad import helpers |
2782 | 23 | from canonical.launchpad.interfaces.geoip import IRequestPreferredLanguages | 22 | from canonical.launchpad.interfaces.geoip import IRequestPreferredLanguages |
2783 | @@ -36,6 +35,7 @@ | |||
2784 | 36 | from canonical.launchpad.webapp.interfaces import ILaunchpadRoot | 35 | from canonical.launchpad.webapp.interfaces import ILaunchpadRoot |
2785 | 37 | from lp.registry.interfaces.person import IPersonSet | 36 | from lp.registry.interfaces.person import IPersonSet |
2786 | 38 | from lp.registry.interfaces.product import IProductSet | 37 | from lp.registry.interfaces.product import IProductSet |
2787 | 38 | from lp.services.propertycache import cachedproperty | ||
2788 | 39 | from lp.services.worlddata.interfaces.country import ICountry | 39 | from lp.services.worlddata.interfaces.country import ICountry |
2789 | 40 | from lp.translations.publisher import TranslationsLayer | 40 | from lp.translations.publisher import TranslationsLayer |
2790 | 41 | 41 | ||
2791 | 42 | 42 | ||
2792 | === modified file 'lib/lp/translations/model/pofile.py' | |||
2793 | --- lib/lp/translations/model/pofile.py 2010-08-20 20:31:18 +0000 | |||
2794 | +++ lib/lp/translations/model/pofile.py 2010-09-02 12:57:56 +0000 | |||
2795 | @@ -44,7 +44,6 @@ | |||
2796 | 44 | from zope.interface import implements | 44 | from zope.interface import implements |
2797 | 45 | from zope.security.proxy import removeSecurityProxy | 45 | from zope.security.proxy import removeSecurityProxy |
2798 | 46 | 46 | ||
2799 | 47 | from canonical.cachedproperty import cachedproperty | ||
2800 | 48 | from canonical.database.constants import UTC_NOW | 47 | from canonical.database.constants import UTC_NOW |
2801 | 49 | from canonical.database.datetimecol import UtcDateTimeCol | 48 | from canonical.database.datetimecol import UtcDateTimeCol |
2802 | 50 | from canonical.database.sqlbase import ( | 49 | from canonical.database.sqlbase import ( |
2803 | @@ -66,6 +65,7 @@ | |||
2804 | 66 | from canonical.launchpad.webapp.publisher import canonical_url | 65 | from canonical.launchpad.webapp.publisher import canonical_url |
2805 | 67 | from lp.registry.interfaces.person import validate_public_person | 66 | from lp.registry.interfaces.person import validate_public_person |
2806 | 68 | from lp.registry.model.person import Person | 67 | from lp.registry.model.person import Person |
2807 | 68 | from lp.services.propertycache import cachedproperty | ||
2808 | 69 | from lp.translations.interfaces.pofile import ( | 69 | from lp.translations.interfaces.pofile import ( |
2809 | 70 | IPOFile, | 70 | IPOFile, |
2810 | 71 | IPOFileSet, | 71 | IPOFileSet, |
2811 | 72 | 72 | ||
2812 | === modified file 'lib/lp/translations/model/potemplate.py' | |||
2813 | --- lib/lp/translations/model/potemplate.py 2010-08-24 21:02:12 +0000 | |||
2814 | +++ lib/lp/translations/model/potemplate.py 2010-09-02 12:57:56 +0000 | |||
2815 | @@ -48,7 +48,6 @@ | |||
2816 | 48 | from zope.interface import implements | 48 | from zope.interface import implements |
2817 | 49 | from zope.security.proxy import removeSecurityProxy | 49 | from zope.security.proxy import removeSecurityProxy |
2818 | 50 | 50 | ||
2819 | 51 | from canonical.cachedproperty import cachedproperty | ||
2820 | 52 | from canonical.database.constants import DEFAULT | 51 | from canonical.database.constants import DEFAULT |
2821 | 53 | from canonical.database.datetimecol import UtcDateTimeCol | 52 | from canonical.database.datetimecol import UtcDateTimeCol |
2822 | 54 | from canonical.database.enumcol import EnumCol | 53 | from canonical.database.enumcol import EnumCol |
2823 | @@ -70,6 +69,7 @@ | |||
2824 | 70 | from lp.registry.model.sourcepackagename import SourcePackageName | 69 | from lp.registry.model.sourcepackagename import SourcePackageName |
2825 | 71 | from lp.services.database.collection import Collection | 70 | from lp.services.database.collection import Collection |
2826 | 72 | from lp.services.database.prejoin import prejoin | 71 | from lp.services.database.prejoin import prejoin |
2827 | 72 | from lp.services.propertycache import cachedproperty | ||
2828 | 73 | from lp.services.worlddata.model.language import Language | 73 | from lp.services.worlddata.model.language import Language |
2829 | 74 | from lp.translations.interfaces.pofile import IPOFileSet | 74 | from lp.translations.interfaces.pofile import IPOFileSet |
2830 | 75 | from lp.translations.interfaces.potemplate import ( | 75 | from lp.translations.interfaces.potemplate import ( |
2831 | 76 | 76 | ||
2832 | === modified file 'lib/lp/translations/model/translationmessage.py' | |||
2833 | --- lib/lp/translations/model/translationmessage.py 2010-08-20 20:31:18 +0000 | |||
2834 | +++ lib/lp/translations/model/translationmessage.py 2010-09-02 12:57:56 +0000 | |||
2835 | @@ -24,7 +24,6 @@ | |||
2836 | 24 | from storm.store import Store | 24 | from storm.store import Store |
2837 | 25 | from zope.interface import implements | 25 | from zope.interface import implements |
2838 | 26 | 26 | ||
2839 | 27 | from canonical.cachedproperty import cachedproperty | ||
2840 | 28 | from canonical.database.constants import ( | 27 | from canonical.database.constants import ( |
2841 | 29 | DEFAULT, | 28 | DEFAULT, |
2842 | 30 | UTC_NOW, | 29 | UTC_NOW, |
2843 | @@ -37,6 +36,7 @@ | |||
2844 | 37 | sqlvalues, | 36 | sqlvalues, |
2845 | 38 | ) | 37 | ) |
2846 | 39 | from lp.registry.interfaces.person import validate_public_person | 38 | from lp.registry.interfaces.person import validate_public_person |
2847 | 39 | from lp.services.propertycache import cachedproperty | ||
2848 | 40 | from lp.translations.interfaces.translationmessage import ( | 40 | from lp.translations.interfaces.translationmessage import ( |
2849 | 41 | ITranslationMessage, | 41 | ITranslationMessage, |
2850 | 42 | ITranslationMessageSet, | 42 | ITranslationMessageSet, |
2851 | 43 | 43 | ||
2852 | === modified file 'lib/lp/translations/utilities/translation_import.py' | |||
2853 | --- lib/lp/translations/utilities/translation_import.py 2010-08-20 20:31:18 +0000 | |||
2854 | +++ lib/lp/translations/utilities/translation_import.py 2010-09-02 12:57:56 +0000 | |||
2855 | @@ -21,7 +21,6 @@ | |||
2856 | 21 | from zope.component import getUtility | 21 | from zope.component import getUtility |
2857 | 22 | from zope.interface import implements | 22 | from zope.interface import implements |
2858 | 23 | 23 | ||
2859 | 24 | from canonical.cachedproperty import cachedproperty | ||
2860 | 25 | from canonical.config import config | 24 | from canonical.config import config |
2861 | 26 | from canonical.database.sqlbase import ( | 25 | from canonical.database.sqlbase import ( |
2862 | 27 | cursor, | 26 | cursor, |
2863 | @@ -33,6 +32,7 @@ | |||
2864 | 33 | IPersonSet, | 32 | IPersonSet, |
2865 | 34 | PersonCreationRationale, | 33 | PersonCreationRationale, |
2866 | 35 | ) | 34 | ) |
2867 | 35 | from lp.services.propertycache import cachedproperty | ||
2868 | 36 | from lp.translations.interfaces.translationexporter import ( | 36 | from lp.translations.interfaces.translationexporter import ( |
2869 | 37 | ITranslationExporter, | 37 | ITranslationExporter, |
2870 | 38 | ) | 38 | ) |
2871 | 39 | 39 | ||
2872 | === modified file 'utilities/sourcedeps.conf' | |||
2873 | --- utilities/sourcedeps.conf 2010-08-30 00:51:55 +0000 | |||
2874 | +++ utilities/sourcedeps.conf 2010-09-02 12:57:56 +0000 | |||
2875 | @@ -14,4 +14,4 @@ | |||
2876 | 14 | subvertpy lp:~launchpad-pqm/subvertpy/trunk;revno=2042 | 14 | subvertpy lp:~launchpad-pqm/subvertpy/trunk;revno=2042 |
2877 | 15 | python-debian lp:~launchpad-pqm/python-debian/devel;revno=185 | 15 | python-debian lp:~launchpad-pqm/python-debian/devel;revno=185 |
2878 | 16 | testresources lp:~launchpad-pqm/testresources/dev;revno=16 | 16 | testresources lp:~launchpad-pqm/testresources/dev;revno=16 |
2880 | 17 | shipit lp:~launchpad-pqm/shipit/trunk;revno=8910 optional | 17 | shipit lp:~launchpad-pqm/shipit/trunk;revno=8911 optional |
While this branch appears very long, the majority of it is mechanical
changes. I've attached a diff of the non-mechanical parts.