Merge lp:~nataliabidart/ubuntu-webcatalog/law-and-order.2 into lp:ubuntu-webcatalog
- law-and-order.2
- Merge into trunk
Proposed by
Natalia Bidart
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Natalia Bidart | ||||
Approved revision: | 135 | ||||
Merged at revision: | 135 | ||||
Proposed branch: | lp:~nataliabidart/ubuntu-webcatalog/law-and-order.2 | ||||
Merge into: | lp:ubuntu-webcatalog | ||||
Prerequisite: | lp:~nataliabidart/ubuntu-webcatalog/law-and-order.1 | ||||
Diff against target: |
671 lines (+111/-103) 13 files modified
src/webcatalog/admin.py (+4/-4) src/webcatalog/auth.py (+18/-17) src/webcatalog/context_processors.py (+2/-1) src/webcatalog/department_filters.py (+9/-7) src/webcatalog/forms.py (+5/-5) src/webcatalog/hw.py (+12/-12) src/webcatalog/managers.py (+2/-2) src/webcatalog/preflight.py (+2/-2) src/webcatalog/schema.py (+5/-5) src/webcatalog/urls.py (+7/-7) src/webcatalog/utilities.py (+13/-12) src/webcatalog/views.py (+31/-28) src/webcatalog/wsgi.py (+1/-1) |
||||
To merge this branch: | bzr merge lp:~nataliabidart/ubuntu-webcatalog/law-and-order.2 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Anthony Lenton (community) | Approve | ||
Review via email: mp+109002@code.launchpad.net |
Commit message
- Fixing pep8 issues (part 2 of LP: #1007626).
Description of the change
To post a comment you must log in.
Revision history for this message
ISD Branch Mangler (isd-branches-mangler) wrote : | # |
The prerequisite lp:~nataliabidart/ubuntu-webcatalog/law-and-order.1 has not yet been merged into lp:ubuntu-webcatalog.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'src/webcatalog/admin.py' | |||
2 | --- src/webcatalog/admin.py 2012-04-18 21:27:46 +0000 | |||
3 | +++ src/webcatalog/admin.py 2012-06-06 17:47:19 +0000 | |||
4 | @@ -20,7 +20,7 @@ | |||
5 | 20 | from __future__ import ( | 20 | from __future__ import ( |
6 | 21 | absolute_import, | 21 | absolute_import, |
7 | 22 | with_statement, | 22 | with_statement, |
9 | 23 | ) | 23 | ) |
10 | 24 | from django.contrib import admin | 24 | from django.contrib import admin |
11 | 25 | from webcatalog.models import ( | 25 | from webcatalog.models import ( |
12 | 26 | Application, | 26 | Application, |
13 | @@ -29,18 +29,18 @@ | |||
14 | 29 | DistroSeries, | 29 | DistroSeries, |
15 | 30 | Exhibit, | 30 | Exhibit, |
16 | 31 | Machine, | 31 | Machine, |
18 | 32 | ) | 32 | ) |
19 | 33 | 33 | ||
20 | 34 | __metaclass__ = type | 34 | __metaclass__ = type |
21 | 35 | __all__ = [ | 35 | __all__ = [ |
22 | 36 | 'ApplicationAdmin', | 36 | 'ApplicationAdmin', |
23 | 37 | 'MachineAdmin', | 37 | 'MachineAdmin', |
25 | 38 | ] | 38 | ] |
26 | 39 | 39 | ||
27 | 40 | 40 | ||
28 | 41 | class ApplicationAdmin(admin.ModelAdmin): | 41 | class ApplicationAdmin(admin.ModelAdmin): |
29 | 42 | list_display = ('package_name', 'name', 'comment', 'distroseries', | 42 | list_display = ('package_name', 'name', 'comment', 'distroseries', |
31 | 43 | 'wilson_score') | 43 | 'wilson_score') |
32 | 44 | search_fields = ('package_name', 'name', 'comment') | 44 | search_fields = ('package_name', 'name', 'comment') |
33 | 45 | list_filter = ('distroseries', 'for_purchase', 'is_latest', 'departments') | 45 | list_filter = ('distroseries', 'for_purchase', 'is_latest', 'departments') |
34 | 46 | exclude = ('for_purchase', 'archive_id') | 46 | exclude = ('for_purchase', 'archive_id') |
35 | 47 | 47 | ||
36 | === modified file 'src/webcatalog/auth.py' | |||
37 | --- src/webcatalog/auth.py 2012-01-06 17:54:47 +0000 | |||
38 | +++ src/webcatalog/auth.py 2012-06-06 17:47:19 +0000 | |||
39 | @@ -23,7 +23,7 @@ | |||
40 | 23 | __metaclass__ = type | 23 | __metaclass__ = type |
41 | 24 | __all__ = [ | 24 | __all__ = [ |
42 | 25 | 'SSOOAuthAuthentication', | 25 | 'SSOOAuthAuthentication', |
44 | 26 | ] | 26 | ] |
45 | 27 | 27 | ||
46 | 28 | from datetime import datetime, timedelta | 28 | from datetime import datetime, timedelta |
47 | 29 | from django.conf import settings | 29 | from django.conf import settings |
48 | @@ -39,8 +39,8 @@ | |||
49 | 39 | full_claimed_id, | 39 | full_claimed_id, |
50 | 40 | ) | 40 | ) |
51 | 41 | 41 | ||
54 | 42 | TOKEN_CACHE_EXPIRY = timedelta(hours=getattr(settings, | 42 | TOKEN_CACHE_EXPIRY_HOURS = getattr(settings, 'TOKEN_CACHE_EXPIRY_HOURS', 4) |
55 | 43 | 'TOKEN_CACHE_EXPIRY_HOURS', 4)) | 43 | TOKEN_CACHE_EXPIRY = timedelta(hours=TOKEN_CACHE_EXPIRY_HOURS) |
56 | 44 | 44 | ||
57 | 45 | 45 | ||
58 | 46 | class SSOOAuthAuthentication(OAuthAuthentication): | 46 | class SSOOAuthAuthentication(OAuthAuthentication): |
59 | @@ -71,8 +71,8 @@ | |||
60 | 71 | request.method, request.build_absolute_uri(), headers=headers, | 71 | request.method, request.build_absolute_uri(), headers=headers, |
61 | 72 | query_string=request.META['QUERY_STRING']) | 72 | query_string=request.META['QUERY_STRING']) |
62 | 73 | if (orequest is None or | 73 | if (orequest is None or |
65 | 74 | not 'oauth_token' in orequest.parameters or | 74 | not 'oauth_token' in orequest.parameters or |
66 | 75 | not 'oauth_consumer_key' in orequest.parameters): | 75 | not 'oauth_consumer_key' in orequest.parameters): |
67 | 76 | return False | 76 | return False |
68 | 77 | 77 | ||
69 | 78 | self.prefetch_oauth_consumer(orequest) | 78 | self.prefetch_oauth_consumer(orequest) |
70 | @@ -95,11 +95,11 @@ | |||
71 | 95 | oauthtoken = request.get_parameter('oauth_token') | 95 | oauthtoken = request.get_parameter('oauth_token') |
72 | 96 | consumer_key = request.get_parameter('oauth_consumer_key') | 96 | consumer_key = request.get_parameter('oauth_consumer_key') |
73 | 97 | tokens = Token.objects.filter(token=oauthtoken, | 97 | tokens = Token.objects.filter(token=oauthtoken, |
79 | 98 | consumer__key=consumer_key) | 98 | consumer__key=consumer_key) |
80 | 99 | if len(tokens) == 0 or (tokens[0].updated_at < | 99 | if (len(tokens) == 0 or |
81 | 100 | datetime.now() - TOKEN_CACHE_EXPIRY): | 100 | tokens[0].updated_at < datetime.now() - TOKEN_CACHE_EXPIRY): |
82 | 101 | pieces = web_services.get_data_for_account(token=oauthtoken, | 101 | pieces = web_services.get_data_for_account( |
83 | 102 | openid_identifier=consumer_key, | 102 | token=oauthtoken, openid_identifier=consumer_key, |
84 | 103 | signature=request.get_parameter('oauth_signature')) | 103 | signature=request.get_parameter('oauth_signature')) |
85 | 104 | if not pieces: | 104 | if not pieces: |
86 | 105 | return | 105 | return |
87 | @@ -111,10 +111,11 @@ | |||
88 | 111 | useropenid__claimed_id=claimed_id) | 111 | useropenid__claimed_id=claimed_id) |
89 | 112 | except User.DoesNotExist: | 112 | except User.DoesNotExist: |
90 | 113 | if (not pieces.get('preferred_email') or | 113 | if (not pieces.get('preferred_email') or |
92 | 114 | not pieces.get('username')): | 114 | not pieces.get('username')): |
93 | 115 | return | 115 | return |
94 | 116 | user = User.objects.create_user(pieces['username'], | 116 | user = User.objects.create_user(pieces['username'], |
96 | 117 | pieces['preferred_email'], password=None) | 117 | pieces['preferred_email'], |
97 | 118 | password=None) | ||
98 | 118 | user.useropenid_set.create(claimed_id=claimed_id) | 119 | user.useropenid_set.create(claimed_id=claimed_id) |
99 | 119 | 120 | ||
100 | 120 | displayname = pieces['displayname'] | 121 | displayname = pieces['displayname'] |
101 | @@ -123,11 +124,11 @@ | |||
102 | 123 | ' ') | 124 | ' ') |
103 | 124 | user.save() | 125 | user.save() |
104 | 125 | 126 | ||
110 | 126 | consumer, created = Consumer.objects.get_or_create(user=user, | 127 | consumer, created = Consumer.objects.get_or_create( |
111 | 127 | key=consumer_key, secret=pieces['consumer_secret']) | 128 | user=user, key=consumer_key, secret=pieces['consumer_secret']) |
112 | 128 | token, created = Token.objects.get_or_create(consumer=consumer, | 129 | token, created = Token.objects.get_or_create( |
113 | 129 | token=pieces['token'], token_secret=pieces['token_secret'], | 130 | consumer=consumer, token=pieces['token'], |
114 | 130 | name=pieces['name']) | 131 | token_secret=pieces['token_secret'], name=pieces['name']) |
115 | 131 | if not created: | 132 | if not created: |
116 | 132 | # Update updated_at | 133 | # Update updated_at |
117 | 133 | token.save() | 134 | token.save() |
118 | 134 | 135 | ||
119 | === modified file 'src/webcatalog/context_processors.py' | |||
120 | --- src/webcatalog/context_processors.py 2012-04-19 14:27:02 +0000 | |||
121 | +++ src/webcatalog/context_processors.py 2012-06-06 17:47:19 +0000 | |||
122 | @@ -31,4 +31,5 @@ | |||
123 | 31 | num_recommended_apps=settings.NUM_RECOMMENDED_APPS, | 31 | num_recommended_apps=settings.NUM_RECOMMENDED_APPS, |
124 | 32 | google_analytics_id=getattr(settings, 'GOOGLE_ANALYTICS_ID', None), | 32 | google_analytics_id=getattr(settings, 'GOOGLE_ANALYTICS_ID', None), |
125 | 33 | secondary_google_analytics_id=getattr(settings, | 33 | secondary_google_analytics_id=getattr(settings, |
127 | 34 | 'SECONDARY_GOOGLE_ANALYTICS_ID', None)) | 34 | 'SECONDARY_GOOGLE_ANALYTICS_ID', |
128 | 35 | None)) | ||
129 | 35 | 36 | ||
130 | === modified file 'src/webcatalog/department_filters.py' | |||
131 | --- src/webcatalog/department_filters.py 2012-01-06 17:54:47 +0000 | |||
132 | +++ src/webcatalog/department_filters.py 2012-06-06 17:47:19 +0000 | |||
133 | @@ -20,7 +20,7 @@ | |||
134 | 20 | from __future__ import ( | 20 | from __future__ import ( |
135 | 21 | absolute_import, | 21 | absolute_import, |
136 | 22 | with_statement, | 22 | with_statement, |
138 | 23 | ) | 23 | ) |
139 | 24 | 24 | ||
140 | 25 | import re | 25 | import re |
141 | 26 | 26 | ||
142 | @@ -29,7 +29,7 @@ | |||
143 | 29 | __metaclass__ = type | 29 | __metaclass__ = type |
144 | 30 | __all__ = [ | 30 | __all__ = [ |
145 | 31 | 'department_filters', | 31 | 'department_filters', |
147 | 32 | ] | 32 | ] |
148 | 33 | 33 | ||
149 | 34 | 34 | ||
150 | 35 | def category_filter(categories_set): | 35 | def category_filter(categories_set): |
151 | @@ -79,24 +79,26 @@ | |||
152 | 79 | 'Web Browsers': [category_filter(set(['WebBrowser']))], | 79 | 'Web Browsers': [category_filter(set(['WebBrowser']))], |
153 | 80 | 'Office': [category_filter(set(['Office']))], | 80 | 'Office': [category_filter(set(['Office']))], |
154 | 81 | 'Science & Engineering': [category_filter(set(['Science'])), | 81 | 'Science & Engineering': [category_filter(set(['Science'])), |
156 | 82 | section_filter(['science'])], | 82 | section_filter(['science'])], |
157 | 83 | 'Astronomy': [category_filter(set(['Astronomy']))], | 83 | 'Astronomy': [category_filter(set(['Astronomy']))], |
158 | 84 | 'Biology': [category_filter(set(['Biology']))], | 84 | 'Biology': [category_filter(set(['Biology']))], |
159 | 85 | 'Chemistry': [category_filter(set(['Chemistry']))], | 85 | 'Chemistry': [category_filter(set(['Chemistry']))], |
160 | 86 | 'Computing & Robotics': [category_filter(set(['ArtificialIntelligence', | 86 | 'Computing & Robotics': [category_filter(set(['ArtificialIntelligence', |
162 | 87 | 'ComputerScience', 'Robotics']))], | 87 | 'ComputerScience', |
163 | 88 | 'Robotics']))], | ||
164 | 88 | 'Electronics': [category_filter(set(['Electronics']))], | 89 | 'Electronics': [category_filter(set(['Electronics']))], |
165 | 89 | 'Engineering': [category_filter(set(['Engineering']))], | 90 | 'Engineering': [category_filter(set(['Engineering']))], |
166 | 90 | 'Geography': [category_filter(set(['Geography']))], | 91 | 'Geography': [category_filter(set(['Geography']))], |
167 | 91 | 'Geology': [category_filter(set(['Geology', 'Geoscience']))], | 92 | 'Geology': [category_filter(set(['Geology', 'Geoscience']))], |
168 | 92 | 'Mathematics': [category_filter(set(['DataVisualization', 'Math', | 93 | 'Mathematics': [category_filter(set(['DataVisualization', 'Math', |
170 | 93 | 'NumericalAnalysis'])), section_filter(['math', 'gnu-r'])], | 94 | 'NumericalAnalysis'])), |
171 | 95 | section_filter(['math', 'gnu-r'])], | ||
172 | 94 | 'Physics': [category_filter(set(['Electricity', 'Physics']))], | 96 | 'Physics': [category_filter(set(['Electricity', 'Physics']))], |
173 | 95 | 'Sound & Video': [category_filter(set(['AudioVideo', 'Audio', 'Video']))], | 97 | 'Sound & Video': [category_filter(set(['AudioVideo', 'Audio', 'Video']))], |
174 | 96 | 'Themes & Tweaks': [category_filter(set(['Settings']))], | 98 | 'Themes & Tweaks': [category_filter(set(['Settings']))], |
175 | 97 | 'Universal Access': [category_filter(set(['Accessibility']))], | 99 | 'Universal Access': [category_filter(set(['Accessibility']))], |
176 | 98 | 'Developer Tools': [category_filter(set(['Development'])), | 100 | 'Developer Tools': [category_filter(set(['Development'])), |
178 | 99 | section_filter(['devel'])], | 101 | section_filter(['devel'])], |
179 | 100 | 'Debugging': [category_filter(set(['Debugger']))], | 102 | 'Debugging': [category_filter(set(['Debugger']))], |
180 | 101 | 'Graphic Interface Design': [category_filter(set(['GUIDesigner']))], | 103 | 'Graphic Interface Design': [category_filter(set(['GUIDesigner']))], |
181 | 102 | 'Haskell': [section_filter(['haskell'])], | 104 | 'Haskell': [section_filter(['haskell'])], |
182 | @@ -112,6 +114,6 @@ | |||
183 | 112 | 'Python': [section_filter(['python'])], | 114 | 'Python': [section_filter(['python'])], |
184 | 113 | 'Ruby': [section_filter(['ruby'])], | 115 | 'Ruby': [section_filter(['ruby'])], |
185 | 114 | 'Version Control': [category_filter(set(['RevisionControl'])), | 116 | 'Version Control': [category_filter(set(['RevisionControl'])), |
187 | 115 | section_filter(['vcs'])], | 117 | section_filter(['vcs'])], |
188 | 116 | 'Web Development': [category_filter(set(['WebDevelopment']))], | 118 | 'Web Development': [category_filter(set(['WebDevelopment']))], |
189 | 117 | } | 119 | } |
190 | 118 | 120 | ||
191 | === modified file 'src/webcatalog/forms.py' | |||
192 | --- src/webcatalog/forms.py 2012-05-25 07:42:30 +0000 | |||
193 | +++ src/webcatalog/forms.py 2012-06-06 17:47:19 +0000 | |||
194 | @@ -20,7 +20,7 @@ | |||
195 | 20 | from __future__ import ( | 20 | from __future__ import ( |
196 | 21 | absolute_import, | 21 | absolute_import, |
197 | 22 | with_statement, | 22 | with_statement, |
199 | 23 | ) | 23 | ) |
200 | 24 | 24 | ||
201 | 25 | import apt | 25 | import apt |
202 | 26 | import json | 26 | import json |
203 | @@ -40,7 +40,7 @@ | |||
204 | 40 | __all__ = [ | 40 | __all__ = [ |
205 | 41 | 'ApplicationForm', | 41 | 'ApplicationForm', |
206 | 42 | 'desktop_field_mappings', | 42 | 'desktop_field_mappings', |
208 | 43 | ] | 43 | ] |
209 | 44 | 44 | ||
210 | 45 | desktop_field_mappings = { | 45 | desktop_field_mappings = { |
211 | 46 | 'x-appinstall-package': 'package_name', | 46 | 'x-appinstall-package': 'package_name', |
212 | @@ -53,7 +53,7 @@ | |||
213 | 53 | 'x-appinstall-section': 'section', | 53 | 'x-appinstall-section': 'section', |
214 | 54 | 'type': 'app_type', | 54 | 'type': 'app_type', |
215 | 55 | 'icon': 'icon_name', | 55 | 'icon': 'icon_name', |
217 | 56 | } | 56 | } |
218 | 57 | 57 | ||
219 | 58 | 58 | ||
220 | 59 | class ApplicationForm(forms.ModelForm): | 59 | class ApplicationForm(forms.ModelForm): |
221 | @@ -143,7 +143,7 @@ | |||
222 | 143 | app_data['description'] = description | 143 | app_data['description'] = description |
223 | 144 | if 'debtags' in app_data and app_data['debtags']: | 144 | if 'debtags' in app_data and app_data['debtags']: |
224 | 145 | app_data['debtags'] = json.dumps([get_hw_short_description(x) | 145 | app_data['debtags'] = json.dumps([get_hw_short_description(x) |
226 | 146 | for x in app_data['debtags']]) | 146 | for x in app_data['debtags']]) |
227 | 147 | app_data['application_id'] = app_data.get('id') | 147 | app_data['application_id'] = app_data.get('id') |
228 | 148 | 148 | ||
229 | 149 | try: | 149 | try: |
230 | @@ -195,7 +195,7 @@ | |||
231 | 195 | text = render_to_string('webcatalog/email_download_link.txt', | 195 | text = render_to_string('webcatalog/email_download_link.txt', |
232 | 196 | context) | 196 | context) |
233 | 197 | sender = ("Ubuntu Application Directory <%s>" % | 197 | sender = ("Ubuntu Application Directory <%s>" % |
235 | 198 | settings.NOREPLY_FROM_ADDRESS) | 198 | settings.NOREPLY_FROM_ADDRESS) |
236 | 199 | recipient = [self.cleaned_data['email']] | 199 | recipient = [self.cleaned_data['email']] |
237 | 200 | message = EmailMultiAlternatives(subject, text, sender, recipient) | 200 | message = EmailMultiAlternatives(subject, text, sender, recipient) |
238 | 201 | message.attach_alternative(html, 'text/html') | 201 | message.attach_alternative(html, 'text/html') |
239 | 202 | 202 | ||
240 | === modified file 'src/webcatalog/hw.py' | |||
241 | --- src/webcatalog/hw.py 2012-03-26 17:28:23 +0000 | |||
242 | +++ src/webcatalog/hw.py 2012-06-06 17:47:19 +0000 | |||
243 | @@ -48,32 +48,32 @@ | |||
244 | 48 | 'hardware::digicam': _('This software requires a digital camera, but none ' | 48 | 'hardware::digicam': _('This software requires a digital camera, but none ' |
245 | 49 | 'are currently connected'), | 49 | 'are currently connected'), |
246 | 50 | 'hardware::webcam': _('This software requires a video camera, but none ' | 50 | 'hardware::webcam': _('This software requires a video camera, but none ' |
248 | 51 | 'are currently connected'), | 51 | 'are currently connected'), |
249 | 52 | 'hardware::input:mouse': _('This software requires a mouse, ' | 52 | 'hardware::input:mouse': _('This software requires a mouse, ' |
251 | 53 | 'but none is currently setup.'), | 53 | 'but none is currently setup.'), |
252 | 54 | 'hardware::input:joystick': _('This software requires a joystick, ' | 54 | 'hardware::input:joystick': _('This software requires a joystick, ' |
254 | 55 | 'but none are currently connected.'), | 55 | 'but none are currently connected.'), |
255 | 56 | 'hardware::input:touchscreen': _('This software requires a touchscreen, ' | 56 | 'hardware::input:touchscreen': _('This software requires a touchscreen, ' |
257 | 57 | 'but the computer does not have one.'), | 57 | 'but the computer does not have one.'), |
258 | 58 | 'hardware::gps': _('This software requires a GPS, ' | 58 | 'hardware::gps': _('This software requires a GPS, ' |
260 | 59 | 'but the computer does not have one.'), | 59 | 'but the computer does not have one.'), |
261 | 60 | 'hardware::laptop': _('This software is for notebook computers.'), | 60 | 'hardware::laptop': _('This software is for notebook computers.'), |
262 | 61 | 'hardware::printer': _('This software requires a printer, but none ' | 61 | 'hardware::printer': _('This software requires a printer, but none ' |
263 | 62 | 'are currently set up.'), | 62 | 'are currently set up.'), |
264 | 63 | 'hardware::scanner': _('This software requires a scanner, but none are ' | 63 | 'hardware::scanner': _('This software requires a scanner, but none are ' |
266 | 64 | 'currently set up.'), | 64 | 'currently set up.'), |
267 | 65 | 'hardware::stoarge:cd': _('This software requires a CD drive, but none ' | 65 | 'hardware::stoarge:cd': _('This software requires a CD drive, but none ' |
269 | 66 | 'are currently connected.'), | 66 | 'are currently connected.'), |
270 | 67 | 'hardware::storage:cd-writer': _('This software requires a CD burner, ' | 67 | 'hardware::storage:cd-writer': _('This software requires a CD burner, ' |
272 | 68 | 'but none are currently connected.'), | 68 | 'but none are currently connected.'), |
273 | 69 | 'hardware::storage:dvd': _('This software requires a DVD drive, but none ' | 69 | 'hardware::storage:dvd': _('This software requires a DVD drive, but none ' |
275 | 70 | 'are currently connected.'), | 70 | 'are currently connected.'), |
276 | 71 | 'hardware::storage:dvd-writer': _('This software requires a DVD burner, ' | 71 | 'hardware::storage:dvd-writer': _('This software requires a DVD burner, ' |
278 | 72 | 'but none are currently connected.'), | 72 | 'but none are currently connected.'), |
279 | 73 | 'hardware::storage:floppy': _('This software requires a floppy disk ' | 73 | 'hardware::storage:floppy': _('This software requires a floppy disk ' |
281 | 74 | 'drive, but none are currently connected.'), | 74 | 'drive, but none are currently connected.'), |
282 | 75 | 'hardware::video:opengl': _('This computer does not have graphics fast ' | 75 | 'hardware::video:opengl': _('This computer does not have graphics fast ' |
284 | 76 | 'enough for this software.'), | 76 | 'enough for this software.'), |
285 | 77 | # private extension | 77 | # private extension |
286 | 78 | OPENGL_DRIVER_BLACKLIST_TAG: _(u'This software does not work with the ' | 78 | OPENGL_DRIVER_BLACKLIST_TAG: _(u'This software does not work with the ' |
287 | 79 | u'\u201c%s\u201D graphics driver this ' | 79 | u'\u201c%s\u201D graphics driver this ' |
288 | 80 | 80 | ||
289 | === modified file 'src/webcatalog/managers.py' | |||
290 | --- src/webcatalog/managers.py 2012-03-16 01:42:36 +0000 | |||
291 | +++ src/webcatalog/managers.py 2012-06-06 17:47:19 +0000 | |||
292 | @@ -20,13 +20,13 @@ | |||
293 | 20 | from __future__ import ( | 20 | from __future__ import ( |
294 | 21 | absolute_import, | 21 | absolute_import, |
295 | 22 | with_statement, | 22 | with_statement, |
297 | 23 | ) | 23 | ) |
298 | 24 | 24 | ||
299 | 25 | 25 | ||
300 | 26 | __metaclass__ = type | 26 | __metaclass__ = type |
301 | 27 | __all__ = [ | 27 | __all__ = [ |
302 | 28 | 'ApplicationManager', | 28 | 'ApplicationManager', |
304 | 29 | ] | 29 | ] |
305 | 30 | 30 | ||
306 | 31 | from django.db import models | 31 | from django.db import models |
307 | 32 | from django.http import Http404 | 32 | from django.http import Http404 |
308 | 33 | 33 | ||
309 | === modified file 'src/webcatalog/preflight.py' | |||
310 | --- src/webcatalog/preflight.py 2012-05-31 20:29:23 +0000 | |||
311 | +++ src/webcatalog/preflight.py 2012-06-06 17:47:19 +0000 | |||
312 | @@ -20,7 +20,7 @@ | |||
313 | 20 | from __future__ import ( | 20 | from __future__ import ( |
314 | 21 | absolute_import, | 21 | absolute_import, |
315 | 22 | with_statement, | 22 | with_statement, |
317 | 23 | ) | 23 | ) |
318 | 24 | 24 | ||
319 | 25 | from django import db | 25 | from django import db |
320 | 26 | from django.conf import settings | 26 | from django.conf import settings |
321 | @@ -34,7 +34,7 @@ | |||
322 | 34 | __metaclass__ = type | 34 | __metaclass__ = type |
323 | 35 | __all__ = [ | 35 | __all__ = [ |
324 | 36 | 'WebcatalogPreflight' | 36 | 'WebcatalogPreflight' |
326 | 37 | ] | 37 | ] |
327 | 38 | 38 | ||
328 | 39 | 39 | ||
329 | 40 | class WebcatalogPreflight(Preflight): | 40 | class WebcatalogPreflight(Preflight): |
330 | 41 | 41 | ||
331 | === modified file 'src/webcatalog/schema.py' | |||
332 | --- src/webcatalog/schema.py 2012-06-04 10:54:02 +0000 | |||
333 | +++ src/webcatalog/schema.py 2012-06-06 17:47:19 +0000 | |||
334 | @@ -34,7 +34,7 @@ | |||
335 | 34 | 34 | ||
336 | 35 | class oops(schema.Section): | 35 | class oops(schema.Section): |
337 | 36 | oops_dir = schema.StringOption(help='Absolute path to the directory' | 36 | oops_dir = schema.StringOption(help='Absolute path to the directory' |
339 | 37 | ' oops reports will be stored in') | 37 | ' oops reports will be stored in') |
340 | 38 | 38 | ||
341 | 39 | class openid(schema.Section): | 39 | class openid(schema.Section): |
342 | 40 | openid_sso_server_url = schema.StringOption() | 40 | openid_sso_server_url = schema.StringOption() |
343 | @@ -56,13 +56,13 @@ | |||
344 | 56 | oauth_data_store = schema.StringOption( | 56 | oauth_data_store = schema.StringOption( |
345 | 57 | default='webcatalog.models.oauthtoken.DataStore') | 57 | default='webcatalog.models.oauthtoken.DataStore') |
346 | 58 | convoy_root = schema.StringOption() | 58 | convoy_root = schema.StringOption() |
349 | 59 | featured_apps = schema.ListOption(item=schema.StringOption(), | 59 | featured_apps = schema.ListOption( |
350 | 60 | default=[]) | 60 | item=schema.StringOption(), default=[]) |
351 | 61 | number_top_rated_apps = schema.IntOption(default=8) | 61 | number_top_rated_apps = schema.IntOption(default=8) |
352 | 62 | screenshots_base_url = schema.StringOption( | 62 | screenshots_base_url = schema.StringOption( |
353 | 63 | default='http://screenshots.ubuntu.com/') | 63 | default='http://screenshots.ubuntu.com/') |
356 | 64 | hib_apps = schema.ListOption(item=schema.StringOption(), | 64 | hib_apps = schema.ListOption( |
357 | 65 | default=[]) | 65 | item=schema.StringOption(), default=[]) |
358 | 66 | ubuntu_series_for_versions = schema.DictOption( | 66 | ubuntu_series_for_versions = schema.DictOption( |
359 | 67 | item=schema.StringOption()) | 67 | item=schema.StringOption()) |
360 | 68 | 68 | ||
361 | 69 | 69 | ||
362 | === modified file 'src/webcatalog/urls.py' | |||
363 | --- src/webcatalog/urls.py 2012-05-07 13:43:04 +0000 | |||
364 | +++ src/webcatalog/urls.py 2012-06-06 17:47:19 +0000 | |||
365 | @@ -20,17 +20,18 @@ | |||
366 | 20 | from __future__ import ( | 20 | from __future__ import ( |
367 | 21 | absolute_import, | 21 | absolute_import, |
368 | 22 | with_statement, | 22 | with_statement, |
370 | 23 | ) | 23 | ) |
371 | 24 | from django.conf.urls.defaults import patterns, include, url | 24 | from django.conf.urls.defaults import patterns, include, url |
372 | 25 | from django.views.generic import TemplateView | 25 | from django.views.generic import TemplateView |
373 | 26 | 26 | ||
374 | 27 | __metaclass__ = type | 27 | __metaclass__ = type |
375 | 28 | __all__ = [ | 28 | __all__ = [ |
376 | 29 | 'urlpatterns', | 29 | 'urlpatterns', |
381 | 30 | ] | 30 | ] |
382 | 31 | 31 | ||
383 | 32 | 32 | ||
384 | 33 | urlpatterns = patterns('webcatalog.views', | 33 | urlpatterns = patterns( |
385 | 34 | 'webcatalog.views', | ||
386 | 34 | url(r'^$', 'index', name='wc-index'), | 35 | url(r'^$', 'index', name='wc-index'), |
387 | 35 | url(r'^department/(?P<distro>[-.+\w]+)/(?P<dept_slug_or_id>[\w\d-]+)/$', | 36 | url(r'^department/(?P<distro>[-.+\w]+)/(?P<dept_slug_or_id>[\w\d-]+)/$', |
388 | 36 | 'department_overview', name='wc-department'), | 37 | 'department_overview', name='wc-department'), |
389 | @@ -45,8 +46,7 @@ | |||
390 | 45 | url(r'^applications/(?P<package_name>[-.+:\w]+)/$', 'application_detail', | 46 | url(r'^applications/(?P<package_name>[-.+:\w]+)/$', 'application_detail', |
391 | 46 | name="wc-package-detail"), | 47 | name="wc-package-detail"), |
392 | 47 | url(r'^applications/(?P<distro>[-.+\w]+)/(?P<package_name>[-.+:\w]+)/' | 48 | url(r'^applications/(?P<distro>[-.+\w]+)/(?P<package_name>[-.+:\w]+)/' |
395 | 48 | r'reviews/$', | 49 | r'reviews/$', 'application_reviews', name="wc-package-reviews"), |
394 | 49 | 'application_reviews', name="wc-package-reviews"), | ||
396 | 50 | url(r'^applications/(?P<distro>[-.+\w]+)/(?P<package_name>[-.+:\w]+)/' | 50 | url(r'^applications/(?P<distro>[-.+\w]+)/(?P<package_name>[-.+:\w]+)/' |
397 | 51 | r'reviews-ajax/$', 'application_reviews', kwargs={'ajax': True}, | 51 | r'reviews-ajax/$', 'application_reviews', kwargs={'ajax': True}, |
398 | 52 | name="wc-package-reviews-ajax"), | 52 | name="wc-package-reviews-ajax"), |
399 | 53 | 53 | ||
400 | === modified file 'src/webcatalog/utilities.py' | |||
401 | --- src/webcatalog/utilities.py 2012-06-04 10:55:44 +0000 | |||
402 | +++ src/webcatalog/utilities.py 2012-06-06 17:47:19 +0000 | |||
403 | @@ -26,7 +26,7 @@ | |||
404 | 26 | 'UserAgentString', | 26 | 'UserAgentString', |
405 | 27 | 'WebServices', | 27 | 'WebServices', |
406 | 28 | 'WebServiceError', | 28 | 'WebServiceError', |
408 | 29 | ] | 29 | ] |
409 | 30 | 30 | ||
410 | 31 | import json | 31 | import json |
411 | 32 | import logging | 32 | import logging |
412 | @@ -41,7 +41,7 @@ | |||
413 | 41 | from piston_mini_client.auth import ( | 41 | from piston_mini_client.auth import ( |
414 | 42 | BasicAuthorizer, | 42 | BasicAuthorizer, |
415 | 43 | OAuthAuthorizer, | 43 | OAuthAuthorizer, |
417 | 44 | ) | 44 | ) |
418 | 45 | from piston_mini_client.failhandlers import APIError | 45 | from piston_mini_client.failhandlers import APIError |
419 | 46 | from piston_mini_client.validators import ValidationException | 46 | from piston_mini_client.validators import ValidationException |
420 | 47 | from rnrclient import RatingsAndReviewsAPI | 47 | from rnrclient import RatingsAndReviewsAPI |
421 | @@ -61,9 +61,10 @@ | |||
422 | 61 | 61 | ||
423 | 62 | @property | 62 | @property |
424 | 63 | def identity_provider(self): | 63 | def identity_provider(self): |
428 | 64 | return SingleSignOnAPI(service_root=settings.SSO_API_SERVICE_ROOT, | 64 | auth = BasicAuthorizer(settings.SSO_API_AUTH_USERNAME, |
429 | 65 | auth=BasicAuthorizer(settings.SSO_API_AUTH_USERNAME, | 65 | settings.SSO_API_AUTH_PASSWORD) |
430 | 66 | settings.SSO_API_AUTH_PASSWORD)) | 66 | return SingleSignOnAPI( |
431 | 67 | service_root=settings.SSO_API_SERVICE_ROOT, auth=auth) | ||
432 | 67 | 68 | ||
433 | 68 | @property | 69 | @property |
434 | 69 | def rnr_api(self): | 70 | def rnr_api(self): |
435 | @@ -77,8 +78,8 @@ | |||
436 | 77 | return cached_reviews | 78 | return cached_reviews |
437 | 78 | 79 | ||
438 | 79 | try: | 80 | try: |
441 | 80 | fresh_reviews = self.rnr_api.get_reviews(packagename=package_name, | 81 | fresh_reviews = self.rnr_api.get_reviews( |
442 | 81 | distroseries=distroseries, page=page) | 82 | packagename=package_name, distroseries=distroseries, page=page) |
443 | 82 | except (ValidationException, APIError): | 83 | except (ValidationException, APIError): |
444 | 83 | fresh_reviews = [] | 84 | fresh_reviews = [] |
445 | 84 | cache.set(key, fresh_reviews, settings.REVIEWS_CACHE_TIMEOUT) | 85 | cache.set(key, fresh_reviews, settings.REVIEWS_CACHE_TIMEOUT) |
446 | @@ -112,7 +113,7 @@ | |||
447 | 112 | if response.getcode() == 200: | 113 | if response.getcode() == 200: |
448 | 113 | data = json.loads(response.read()) | 114 | data = json.loads(response.read()) |
449 | 114 | fresh_screenshots = [entry['large_image_url'] | 115 | fresh_screenshots = [entry['large_image_url'] |
451 | 115 | for entry in data.get('screenshots', [])] | 116 | for entry in data.get('screenshots', [])] |
452 | 116 | except (IOError, ValueError, TypeError): | 117 | except (IOError, ValueError, TypeError): |
453 | 117 | pass | 118 | pass |
454 | 118 | cache.set(key, fresh_screenshots, settings.REVIEWS_CACHE_TIMEOUT) | 119 | cache.set(key, fresh_screenshots, settings.REVIEWS_CACHE_TIMEOUT) |
455 | @@ -150,12 +151,12 @@ | |||
456 | 150 | token=token, consumer_key=openid_identifier) | 151 | token=token, consumer_key=openid_identifier) |
457 | 151 | 152 | ||
458 | 152 | if result: | 153 | if result: |
461 | 153 | authorizer = OAuthAuthorizer(token_key=result['token'], | 154 | authorizer = OAuthAuthorizer( |
462 | 154 | token_secret=result['token_secret'], | 155 | token_key=result['token'], token_secret=result['token_secret'], |
463 | 155 | consumer_key=result['consumer_key'], | 156 | consumer_key=result['consumer_key'], |
464 | 156 | consumer_secret=result['consumer_secret']) | 157 | consumer_secret=result['consumer_secret']) |
465 | 157 | api = SingleSignOnAPI(service_root=settings.SSO_API_SERVICE_ROOT, | 158 | api = SingleSignOnAPI(service_root=settings.SSO_API_SERVICE_ROOT, |
467 | 158 | auth=authorizer) | 159 | auth=authorizer) |
468 | 159 | me = api.me() | 160 | me = api.me() |
469 | 160 | data = { | 161 | data = { |
470 | 161 | 'displayname': me.displayname, | 162 | 'displayname': me.displayname, |
471 | @@ -176,7 +177,7 @@ | |||
472 | 176 | 177 | ||
473 | 177 | def full_claimed_id(consumer_key): | 178 | def full_claimed_id(consumer_key): |
474 | 178 | return '%s/+id/%s' % (settings.OPENID_SSO_SERVER_URL.strip('/'), | 179 | return '%s/+id/%s' % (settings.OPENID_SSO_SERVER_URL.strip('/'), |
476 | 179 | consumer_key) | 180 | consumer_key) |
477 | 180 | 181 | ||
478 | 181 | 182 | ||
479 | 182 | class UserAgentString(object): | 183 | class UserAgentString(object): |
480 | 183 | 184 | ||
481 | === modified file 'src/webcatalog/views.py' | |||
482 | --- src/webcatalog/views.py 2012-06-06 12:54:15 +0000 | |||
483 | +++ src/webcatalog/views.py 2012-06-06 17:47:19 +0000 | |||
484 | @@ -20,7 +20,7 @@ | |||
485 | 20 | from __future__ import ( | 20 | from __future__ import ( |
486 | 21 | absolute_import, | 21 | absolute_import, |
487 | 22 | with_statement, | 22 | with_statement, |
489 | 23 | ) | 23 | ) |
490 | 24 | 24 | ||
491 | 25 | import json | 25 | import json |
492 | 26 | import operator | 26 | import operator |
493 | @@ -35,12 +35,12 @@ | |||
494 | 35 | from django.http import ( | 35 | from django.http import ( |
495 | 36 | HttpResponseRedirect, | 36 | HttpResponseRedirect, |
496 | 37 | HttpResponse, | 37 | HttpResponse, |
498 | 38 | ) | 38 | ) |
499 | 39 | from django.shortcuts import ( | 39 | from django.shortcuts import ( |
500 | 40 | get_list_or_404, | 40 | get_list_or_404, |
501 | 41 | get_object_or_404, | 41 | get_object_or_404, |
502 | 42 | render_to_response, | 42 | render_to_response, |
504 | 43 | ) | 43 | ) |
505 | 44 | from django.template import RequestContext | 44 | from django.template import RequestContext |
506 | 45 | from django.utils.translation import ugettext as _ | 45 | from django.utils.translation import ugettext as _ |
507 | 46 | 46 | ||
508 | @@ -50,7 +50,7 @@ | |||
509 | 50 | Department, | 50 | Department, |
510 | 51 | DistroSeries, | 51 | DistroSeries, |
511 | 52 | Exhibit, | 52 | Exhibit, |
513 | 53 | ) | 53 | ) |
514 | 54 | from webcatalog.utilities import WebServices | 54 | from webcatalog.utilities import WebServices |
515 | 55 | 55 | ||
516 | 56 | 56 | ||
517 | @@ -62,7 +62,7 @@ | |||
518 | 62 | 'index', | 62 | 'index', |
519 | 63 | 'department_overview', | 63 | 'department_overview', |
520 | 64 | 'search', | 64 | 'search', |
522 | 65 | ] | 65 | ] |
523 | 66 | 66 | ||
524 | 67 | 67 | ||
525 | 68 | def _get_page_num_from_request(request, paginator): | 68 | def _get_page_num_from_request(request, paginator): |
526 | @@ -91,9 +91,10 @@ | |||
527 | 91 | apps = Application.objects.filter(is_latest=True) | 91 | apps = Application.objects.filter(is_latest=True) |
528 | 92 | apps = apps.filter(reduce(operator.or_, ors)).order_by('name') | 92 | apps = apps.filter(reduce(operator.or_, ors)).order_by('name') |
529 | 93 | 93 | ||
533 | 94 | crumbs = [{'name': 'All Apps', 'url': reverse('wc-index')}, | 94 | crumbs = [ |
534 | 95 | {'name': 'Search results', 'url': request.build_absolute_uri()}, | 95 | {'name': 'All Apps', 'url': reverse('wc-index')}, |
535 | 96 | ] | 96 | {'name': 'Search results', 'url': request.build_absolute_uri()}, |
536 | 97 | ] | ||
537 | 97 | 98 | ||
538 | 98 | paginator = Paginator(apps, settings.PAGE_BATCH_SIZE) | 99 | paginator = Paginator(apps, settings.PAGE_BATCH_SIZE) |
539 | 99 | page_num = _get_page_num_from_request(request, paginator) | 100 | page_num = _get_page_num_from_request(request, paginator) |
540 | @@ -104,16 +105,15 @@ | |||
541 | 104 | 'breadcrumbs': crumbs, | 105 | 'breadcrumbs': crumbs, |
542 | 105 | 'available_distroseries': DistroSeries.objects.order_by('-code_name'), | 106 | 'available_distroseries': DistroSeries.objects.order_by('-code_name'), |
543 | 106 | 'distroseries': distro, | 107 | 'distroseries': distro, |
545 | 107 | }) | 108 | }) |
546 | 108 | return render_to_response('webcatalog/search_results.html', | 109 | return render_to_response('webcatalog/search_results.html', |
548 | 109 | context_instance=context) | 110 | context_instance=context) |
549 | 110 | 111 | ||
550 | 111 | 112 | ||
551 | 112 | def index(request): | 113 | def index(request): |
552 | 113 | depts = Department.objects.filter(parent=None).order_by('name') | 114 | depts = Department.objects.filter(parent=None).order_by('name') |
556 | 114 | depts = depts.order_by('name') | 115 | qs = Q(display=True) | Q(display=None, published=True,) |
557 | 115 | exhibits = list(Exhibit.objects.filter(Q(display=True) | | 116 | exhibits = list(Exhibit.objects.filter(qs).order_by('weight')) |
555 | 116 | Q(display=None, published=True,)).order_by('weight')) | ||
558 | 117 | featured_apps = [Application.objects.find_best(package_name=app) | 117 | featured_apps = [Application.objects.find_best(package_name=app) |
559 | 118 | for app in settings.FEATURED_APPS] | 118 | for app in settings.FEATURED_APPS] |
560 | 119 | featured_apps = [x for x in featured_apps if x] | 119 | featured_apps = [x for x in featured_apps if x] |
561 | @@ -138,7 +138,7 @@ | |||
562 | 138 | 'top_rated_apps': top_rated, | 138 | 'top_rated_apps': top_rated, |
563 | 139 | }) | 139 | }) |
564 | 140 | return render_to_response('webcatalog/index.html', | 140 | return render_to_response('webcatalog/index.html', |
566 | 141 | context_instance=context) | 141 | context_instance=context) |
567 | 142 | 142 | ||
568 | 143 | 143 | ||
569 | 144 | def department_overview(request, dept_slug_or_id=None, distro=None): | 144 | def department_overview(request, dept_slug_or_id=None, distro=None): |
570 | @@ -159,15 +159,16 @@ | |||
571 | 159 | paginator = Paginator(apps, settings.PAGE_BATCH_SIZE) | 159 | paginator = Paginator(apps, settings.PAGE_BATCH_SIZE) |
572 | 160 | page_num = _get_page_num_from_request(request, paginator) | 160 | page_num = _get_page_num_from_request(request, paginator) |
573 | 161 | 161 | ||
575 | 162 | context = RequestContext(request, dict={'dept': dept, | 162 | context = { |
576 | 163 | 'dept': dept, | ||
577 | 163 | 'subdepts': subdepts, | 164 | 'subdepts': subdepts, |
578 | 164 | 'page': paginator.page(page_num), | 165 | 'page': paginator.page(page_num), |
579 | 165 | 'breadcrumbs': dept.crumbs(), | 166 | 'breadcrumbs': dept.crumbs(), |
580 | 166 | 'available_distroseries': DistroSeries.objects.order_by('-code_name'), | 167 | 'available_distroseries': DistroSeries.objects.order_by('-code_name'), |
581 | 167 | 'distroseries': distro, | 168 | 'distroseries': distro, |
583 | 168 | }) | 169 | } |
584 | 169 | return render_to_response('webcatalog/department_overview.html', | 170 | return render_to_response('webcatalog/department_overview.html', |
586 | 170 | context_instance=context) | 171 | context_instance=RequestContext(request, context)) |
587 | 171 | 172 | ||
588 | 172 | 173 | ||
589 | 173 | def application_list(request): | 174 | def application_list(request): |
590 | @@ -185,9 +186,10 @@ | |||
591 | 185 | 186 | ||
592 | 186 | depts = Department.objects.filter(parent=None).order_by('name') | 187 | depts = Department.objects.filter(parent=None).order_by('name') |
593 | 187 | 188 | ||
594 | 189 | context = RequestContext(request, | ||
595 | 190 | dict(applications=applications, depts=depts)) | ||
596 | 188 | return render_to_response('webcatalog/application_list.html', | 191 | return render_to_response('webcatalog/application_list.html', |
599 | 189 | context_instance=RequestContext(request, | 192 | context_instance=context) |
598 | 190 | dict(applications=applications, depts=depts))) | ||
600 | 191 | 193 | ||
601 | 192 | 194 | ||
602 | 193 | def application_detail(request, package_name, distro=None): | 195 | def application_detail(request, package_name, distro=None): |
603 | @@ -212,7 +214,8 @@ | |||
604 | 212 | 214 | ||
605 | 213 | hib_apps = getattr(settings, 'HIB_APPS', []) | 215 | hib_apps = getattr(settings, 'HIB_APPS', []) |
606 | 214 | 216 | ||
608 | 215 | atts = {'application': app, | 217 | atts = { |
609 | 218 | 'application': app, | ||
610 | 216 | 'available_distroseries': app.available_distroseries(), | 219 | 'available_distroseries': app.available_distroseries(), |
611 | 217 | 'breadcrumbs': app.crumbs(), | 220 | 'breadcrumbs': app.crumbs(), |
612 | 218 | 'distroseries': distro, | 221 | 'distroseries': distro, |
613 | @@ -221,7 +224,7 @@ | |||
614 | 221 | 'email_form': form, | 224 | 'email_form': form, |
615 | 222 | 'debtags': debtags, | 225 | 'debtags': debtags, |
616 | 223 | 'display_hib_widget': app.package_name in hib_apps | 226 | 'display_hib_widget': app.package_name in hib_apps |
618 | 224 | } | 227 | } |
619 | 225 | 228 | ||
620 | 226 | return render_to_response( | 229 | return render_to_response( |
621 | 227 | 'webcatalog/application_detail.html', RequestContext( | 230 | 'webcatalog/application_detail.html', RequestContext( |
622 | @@ -235,12 +238,12 @@ | |||
623 | 235 | # unity-lens-utilities, probably via a myapps PPA as well as extras?). | 238 | # unity-lens-utilities, probably via a myapps PPA as well as extras?). |
624 | 236 | # Don't break when this happens. | 239 | # Don't break when this happens. |
625 | 237 | apps = get_list_or_404(Application, package_name=package_name, | 240 | apps = get_list_or_404(Application, package_name=package_name, |
627 | 238 | distroseries__code_name=distro) | 241 | distroseries__code_name=distro) |
628 | 239 | app = apps[0] | 242 | app = apps[0] |
629 | 240 | 243 | ||
630 | 241 | # XXX michaeln 2011-09-15 bug=851662 Better review language options. | 244 | # XXX michaeln 2011-09-15 bug=851662 Better review language options. |
633 | 242 | reviews = WebServices().get_reviews_for_package(package_name, | 245 | reviews = WebServices().get_reviews_for_package( |
634 | 243 | distroseries=distro, page=page) | 246 | package_name, distroseries=distro, page=page) |
635 | 244 | 247 | ||
636 | 245 | context = dict(application=app, reviews=reviews) | 248 | context = dict(application=app, reviews=reviews) |
637 | 246 | if ajax: | 249 | if ajax: |
638 | @@ -277,8 +280,7 @@ | |||
639 | 277 | def application_screenshots(request, package_name): | 280 | def application_screenshots(request, package_name): |
640 | 278 | app = Application.objects.find_best_or_404(package_name=package_name) | 281 | app = Application.objects.find_best_or_404(package_name=package_name) |
641 | 279 | screenshots = WebServices().get_screenshots_for_package(package_name) | 282 | screenshots = WebServices().get_screenshots_for_package(package_name) |
644 | 280 | return HttpResponse(json.dumps(screenshots), | 283 | return HttpResponse(json.dumps(screenshots), mimetype='application/json') |
643 | 281 | mimetype='application/json') | ||
645 | 282 | 284 | ||
646 | 283 | 285 | ||
647 | 284 | def combo_view(request): | 286 | def combo_view(request): |
648 | @@ -291,8 +293,9 @@ | |||
649 | 291 | content_type = "text/javascript" | 293 | content_type = "text/javascript" |
650 | 292 | elif fnames[0].endswith(".css"): | 294 | elif fnames[0].endswith(".css"): |
651 | 293 | content_type = "text/css" | 295 | content_type = "text/css" |
654 | 294 | content = combine_files(fnames, os.path.abspath(settings.CONVOY_ROOT), | 296 | content = combine_files( |
655 | 295 | resource_prefix=settings.MEDIA_URL, rewrite_urls=True) | 297 | fnames, os.path.abspath(settings.CONVOY_ROOT), |
656 | 298 | resource_prefix=settings.MEDIA_URL, rewrite_urls=True) | ||
657 | 296 | # We're turning the generator returned by combine_files into a string | 299 | # We're turning the generator returned by combine_files into a string |
658 | 297 | # here since GZipMiddleware would consume it if not. See Bug #822888. | 300 | # here since GZipMiddleware would consume it if not. See Bug #822888. |
659 | 298 | return HttpResponse( | 301 | return HttpResponse( |
660 | 299 | 302 | ||
661 | === modified file 'src/webcatalog/wsgi.py' | |||
662 | --- src/webcatalog/wsgi.py 2012-03-30 13:22:36 +0000 | |||
663 | +++ src/webcatalog/wsgi.py 2012-06-06 17:47:19 +0000 | |||
664 | @@ -37,6 +37,6 @@ | |||
665 | 37 | logging.config.fileConfig(settings.WEBAPP_LOGGING_CONFIG) | 37 | logging.config.fileConfig(settings.WEBAPP_LOGGING_CONFIG) |
666 | 38 | oops_dir = getattr(settings, 'OOPS_DIR', '/tmp') | 38 | oops_dir = getattr(settings, 'OOPS_DIR', '/tmp') |
667 | 39 | oops_app = OopsWare(WSGIHandler(), oops_dir=oops_dir, | 39 | oops_app = OopsWare(WSGIHandler(), oops_dir=oops_dir, |
669 | 40 | key=appserver_id, hide_meta=True) | 40 | key=appserver_id, hide_meta=True) |
670 | 41 | oops_app.serial = OOPSRFC822Serializer(appserver_id, oops_dir, None) | 41 | oops_app.serial = OOPSRFC822Serializer(appserver_id, oops_dir, None) |
671 | 42 | return oops_app | 42 | return oops_app |
Looks good, thanks!