Merge lp:~edwin-grubbs/launchpad/bug-521934-missing-sprites into lp:launchpad

Proposed by Edwin Grubbs
Status: Merged
Approved by: Tim Penhey
Approved revision: not available
Merged at revision: not available
Proposed branch: lp:~edwin-grubbs/launchpad/bug-521934-missing-sprites
Merge into: lp:launchpad
Diff against target: 622 lines (+120/-101)
3 files modified
lib/canonical/launchpad/icing/icon-sprites.positioning (+104/-100)
lib/canonical/launchpad/icing/style-3-0.css.in (+6/-0)
lib/lp/services/spriteutils.py (+10/-1)
To merge this branch: bzr merge lp:~edwin-grubbs/launchpad/bug-521934-missing-sprites
Reviewer Review Type Date Requested Status
Tim Penhey (community) Approve
Review via email: mp+19454@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Edwin Grubbs (edwin-grubbs) wrote :

Summary
-------

Re-added .branch and .cves css rules that were accidentally removed when
switching to automatic generation of the combined sprite image.

Implementation details
----------------------

Re-added the .branch css rule and the .cves css rule.
    lib/canonical/launchpad/icing/style-3-0.css.in

Added some error handling.
    lib/lp/services/spriteutils.py

New sprite image and positioning file for generating the combo.css
from the style-3-0.css.in.
    lib/canonical/launchpad/icing/icon-sprites
    lib/canonical/launchpad/icing/icon-sprites.positioning

Tests
-----

./bin/test -vv -t sprites.txt

Demo and Q/A
------------

* Open https://code.launchpad.dev/~mark/firefox/release--0.9.1/+merge/1
    * The branch icon should appear after "Proposed branch:" and "Merge into:".
* Open https://bugs.launchpad.dev/debian/+source/mozilla-firefox/+bug/3
    * The cves should float to the right.

Revision history for this message
Tim Penhey (thumper) wrote :

Looks mostly mechanical. Nice addition of extra robustness checks.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/canonical/launchpad/icing/icon-sprites'
0Binary files lib/canonical/launchpad/icing/icon-sprites 2010-02-08 19:44:03 +0000 and lib/canonical/launchpad/icing/icon-sprites 2010-02-17 00:55:27 +0000 differ0Binary files lib/canonical/launchpad/icing/icon-sprites 2010-02-08 19:44:03 +0000 and lib/canonical/launchpad/icing/icon-sprites 2010-02-17 00:55:27 +0000 differ
=== modified file 'lib/canonical/launchpad/icing/icon-sprites.positioning'
--- lib/canonical/launchpad/icing/icon-sprites.positioning 2010-02-08 21:10:39 +0000
+++ lib/canonical/launchpad/icing/icon-sprites.positioning 2010-02-17 00:55:27 +0000
@@ -3,19 +3,19 @@
3{3{
4 "../images/arrowLeft.png": [4 "../images/arrowLeft.png": [
5 0, 5 0,
6 -145906 -14754
7 ], 7 ],
8 "../images/cancel.png": [8 "../images/cancel.png": [
9 0, 9 0,
10 -737610 -7540
11 ], 11 ],
12 "../images/milestone.png": [12 "../images/milestone.png": [
13 0, 13 0,
14 -327614 -3440
15 ], 15 ],
16 "../images/zoom-out.png": [16 "../images/zoom-out.png": [
17 0, 17 0,
18 -1180218 -11966
19 ], 19 ],
20 "../images/team.png": [20 "../images/team.png": [
21 0, 21 0,
@@ -23,15 +23,15 @@
23 ], 23 ],
24 "../images/bug-undecided.png": [24 "../images/bug-undecided.png": [
25 0, 25 0,
26 -787226 -8036
27 ], 27 ],
28 "../images/blueprint-low.png": [28 "../images/blueprint-low.png": [
29 0, 29 0,
30 -573630 -5900
31 ], 31 ],
32 "../images/meeting.png": [32 "../images/meeting.png": [
33 0, 33 0,
34 -1032634 -10490
35 ], 35 ],
36 "../images/no.png": [36 "../images/no.png": [
37 0, 37 0,
@@ -39,15 +39,15 @@
39 ], 39 ],
40 "../images/distribution-badge.png": [40 "../images/distribution-badge.png": [
41 0, 41 0,
42 -902042 -9184
43 ], 43 ],
44 "../images/arrowTop.png": [44 "../images/arrowTop.png": [
45 0, 45 0,
46 -1426246 -14426
47 ], 47 ],
48 "../images/zoom-in.png": [48 "../images/zoom-in.png": [
49 0, 49 0,
50 -1163850 -11802
51 ], 51 ],
52 "../images/team-badge.png": [52 "../images/team-badge.png": [
53 0, 53 0,
@@ -55,99 +55,99 @@
55 ], 55 ],
56 "../images/blue-bar.png": [56 "../images/blue-bar.png": [
57 0, 57 0,
58 -1475458 -14918
59 ], 59 ],
60 "../images/arrowStart.png": [60 "../images/arrowStart.png": [
61 0, 61 0,
62 -1393462 -14098
63 ], 63 ],
64 "../images/ppa-icon-inactive.png": [64 "../images/ppa-icon-inactive.png": [
65 0, 65 0,
66 -1229466 -12458
67 ], 67 ],
68 "../images/build-needed.png": [68 "../images/build-needed.png": [
69 0, 69 0,
70 -1311470 -13278
71 ], 71 ],
72 "../images/purple-bar.png": [72 "../images/purple-bar.png": [
73 0, 73 0,
74 -1508274 -15246
75 ], 75 ],
76 "../images/bullet.png": [76 "../images/bullet.png": [
77 0, 77 0,
78 -1147478 -11638
79 ], 79 ],
80 "../images/info-large.png": [80 "../images/info-large.png": [
81 0, 81 0,
82 -1701282 -17176
83 ], 83 ],
84 "../images/trash-logo.png": [84 "../images/trash-logo.png": [
85 0, 85 0,
86 -2003086 -20194
87 ], 87 ],
88 "../images/warning.png": [88 "../images/warning.png": [
89 0, 89 0,
90 -999890 -10162
91 ], 91 ],
92 "../images/mail.png": [92 "../images/mail.png": [
93 0, 93 0,
94 -376894 -3932
95 ], 95 ],
96 "../images/build-failure.png": [96 "../images/build-failure.png": [
97 0, 97 0,
98 -1327898 -13442
99 ], 99 ],
100 "../images/branch-large.png": [100 "../images/branch-large.png": [
101 0, 101 0,
102 -15738102 -15902
103 ], 103 ],
104 "../images/download-large.png": [104 "../images/download-large.png": [
105 0, 105 0,
106 -16830106 -16994
107 ], 107 ],
108 "../images/private-large.png": [108 "../images/private-large.png": [
109 0, 109 0,
110 -17922110 -18086
111 ], 111 ],
112 "../images/launchpad-large.png": [112 "../images/launchpad-large.png": [
113 0, 113 0,
114 -17194114 -17358
115 ], 115 ],
116 "../images/translation-file.png": [116 "../images/translation-file.png": [
117 0, 117 0,
118 -10654118 -10818
119 ], 119 ],
120 "../images/read-only.png": [120 "../images/read-only.png": [
121 0, 121 0,
122 -9834122 -9998
123 ], 123 ],
124 "../images/project-logo.png": [124 "../images/project-logo.png": [
125 0, 125 0,
126 -18532126 -18696
127 ], 127 ],
128 "../images/bug-medium.png": [128 "../images/bug-medium.png": [
129 0, 129 0,
130 -4588130 -4752
131 ], 131 ],
132 "../images/architecture.png": [132 "../images/architecture.png": [
133 0, 133 0,
134 -11966134 -12130
135 ], 135 ],
136 "../images/trash-icon.png": [136 "../images/trash-icon.png": [
137 0, 137 0,
138 -10982138 -11146
139 ], 139 ],
140 "../images/person-inactive.png": [140 "../images/person-inactive.png": [
141 0, 141 0,
142 -6558142 -6722
143 ], 143 ],
144 "../images/arrowBottom.png": [144 "../images/arrowBottom.png": [
145 0, 145 0,
146 -14426146 -14590
147 ], 147 ],
148 "../images/project.png": [148 "../images/project.png": [
149 0, 149 0,
150 -9344150 -9508
151 ], 151 ],
152 "../images/crowd.png": [152 "../images/crowd.png": [
153 0, 153 0,
@@ -159,43 +159,43 @@
159 ], 159 ],
160 "../images/flame-icon.png": [160 "../images/flame-icon.png": [
161 0, 161 0,
162 -7708162 -7872
163 ], 163 ],
164 "../images/ubuntu-icon.png": [164 "../images/ubuntu-icon.png": [
165 0, 165 0,
166 -6392166 -6556
167 ], 167 ],
168 "../images/link.png": [168 "../images/link.png": [
169 0, 169 0,
170 -3604170 -3768
171 ], 171 ],
172 "../images/stop.png": [172 "../images/stop.png": [
173 0, 173 0,
174 -11146174 -11310
175 ], 175 ],
176 "../images/person-logo.png": [176 "../images/person-logo.png": [
177 0, 177 0,
178 -18960178 -19124
179 ], 179 ],
180 "../images/distribution-logo.png": [180 "../images/distribution-logo.png": [
181 0, 181 0,
182 -18318182 -18482
183 ], 183 ],
184 "../images/retry.png": [184 "../images/retry.png": [
185 0, 185 0,
186 -8856186 -9020
187 ], 187 ],
188 "../images/rss.png": [188 "../images/rss.png": [
189 0, 189 0,
190 -6228190 -6392
191 ], 191 ],
192 "../images/private.png": [192 "../images/private.png": [
193 0, 193 0,
194 -10162194 -10326
195 ], 195 ],
196 "../images/merge-proposal-icon.png": [196 "../images/merge-proposal-icon.png": [
197 0, 197 0,
198 -12622198 -12786
199 ], 199 ],
200 "../images/download.png": [200 "../images/download.png": [
201 0, 201 0,
@@ -203,75 +203,75 @@
203 ], 203 ],
204 "../images/arrowDown.png": [204 "../images/arrowDown.png": [
205 0, 205 0,
206 -13770206 -13934
207 ], 207 ],
208 "../images/package-binary.png": [208 "../images/package-binary.png": [
209 0, 209 0,
210 -8692210 -8856
211 ], 211 ],
212 "../images/maybe.png": [212 "../images/maybe.png": [
213 0, 213 0,
214 -7048214 -7212
215 ], 215 ],
216 "../images/bug-status-expand.png": [216 "../images/bug-status-expand.png": [
217 0, 217 0,
218 -12458218 -12622
219 ], 219 ],
220 "../images/crowd-large.png": [220 "../images/crowd-large.png": [
221 0, 221 0,
222 -16102222 -16266
223 ], 223 ],
224 "../images/blueprint.png": [224 "../images/blueprint.png": [
225 0, 225 0,
226 -5080226 -5244
227 ], 227 ],
228 "../images/project-badge.png": [228 "../images/project-badge.png": [
229 0, 229 0,
230 -9182230 -9346
231 ], 231 ],
232 "../images/bug-high.png": [232 "../images/bug-high.png": [
233 0, 233 0,
234 -4424234 -4588
235 ], 235 ],
236 "../images/blueprint-undefined.png": [236 "../images/blueprint-undefined.png": [
237 0, 237 0,
238 -5900238 -6064
239 ], 239 ],
240 "../images/blueprint-not.png": [240 "../images/blueprint-not.png": [
241 0, 241 0,
242 -6064242 -6228
243 ], 243 ],
244 "../images/mentoring.png": [244 "../images/mentoring.png": [
245 0, 245 0,
246 -6884246 -7048
247 ], 247 ],
248 "../images/flame-large.png": [248 "../images/flame-large.png": [
249 0, 249 0,
250 -16648250 -16812
251 ], 251 ],
252 "../images/bug-dupe-icon.png": [252 "../images/bug-dupe-icon.png": [
253 0, 253 0,
254 -8364254 -8528
255 ], 255 ],
256 "../images/bug-critical.png": [256 "../images/bug-critical.png": [
257 0, 257 0,
258 -4260258 -4424
259 ], 259 ],
260 "../images/build-success.png": [260 "../images/build-success.png": [
261 0, 261 0,
262 -12950262 -13114
263 ], 263 ],
264 "../images/haspatch-icon.png": [264 "../images/haspatch-icon.png": [
265 0, 265 0,
266 -15574266 -15738
267 ], 267 ],
268 "../images/person-inactive-badge.png": [268 "../images/person-inactive-badge.png": [
269 0, 269 0,
270 -6722270 -6886
271 ], 271 ],
272 "../images/ppa-icon.png": [272 "../images/ppa-icon.png": [
273 0, 273 0,
274 -12130274 -12294
275 ], 275 ],
276 "../images/yes.png": [276 "../images/yes.png": [
277 0, 277 0,
@@ -279,7 +279,7 @@
279 ], 279 ],
280 "../images/team-logo.png": [280 "../images/team-logo.png": [
281 0, 281 0,
282 -19388282 -19552
283 ], 283 ],
284 "../images/arrowRight.png": [284 "../images/arrowRight.png": [
285 0, 285 0,
@@ -287,23 +287,23 @@
287 ], 287 ],
288 "../images/blueprint-high.png": [288 "../images/blueprint-high.png": [
289 0, 289 0,
290 -5408290 -5572
291 ], 291 ],
292 "../images/product.png": [292 "../images/product.png": [
293 0, 293 0,
294 -9670294 -9834
295 ], 295 ],
296 "../images/bug-low.png": [296 "../images/bug-low.png": [
297 0, 297 0,
298 -4752298 -4916
299 ], 299 ],
300 "../images/package-source.png": [300 "../images/package-source.png": [
301 0, 301 0,
302 -3112302 -3276
303 ], 303 ],
304 "../images/language.png": [304 "../images/language.png": [
305 0, 305 0,
306 -3440306 -3604
307 ], 307 ],
308 "../images/person.png": [308 "../images/person.png": [
309 0, 309 0,
@@ -311,19 +311,19 @@
311 ], 311 ],
312 "../images/arrowUp.png": [312 "../images/arrowUp.png": [
313 0, 313 0,
314 -13606314 -13770
315 ], 315 ],
316 "../images/distribution.png": [316 "../images/distribution.png": [
317 0, 317 0,
318 -2948318 -3112
319 ], 319 ],
320 "../images/error-large.png": [320 "../images/error-large.png": [
321 0, 321 0,
322 -16466322 -16630
323 ], 323 ],
324 "../images/news.png": [324 "../images/news.png": [
325 0, 325 0,
326 -15410326 -15574
327 ], 327 ],
328 "../images/treeExpanded.png": [328 "../images/treeExpanded.png": [
329 0, 329 0,
@@ -331,11 +331,11 @@
331 ], 331 ],
332 "../images/build-depwait.png": [332 "../images/build-depwait.png": [
333 0, 333 0,
334 -13442334 -13606
335 ], 335 ],
336 "../images/blueprint-essential.png": [336 "../images/blueprint-essential.png": [
337 0, 337 0,
338 -5244338 -5408
339 ], 339 ],
340 "../images/question.png": [340 "../images/question.png": [
341 0, 341 0,
@@ -343,47 +343,47 @@
343 ], 343 ],
344 "../images/error.png": [344 "../images/error.png": [
345 0, 345 0,
346 -7212346 -7376
347 ], 347 ],
348 "../images/bug-unknown.png": [348 "../images/bug-unknown.png": [
349 0, 349 0,
350 -8200350 -8364
351 ], 351 ],
352 "../images/product-logo.png": [352 "../images/product-logo.png": [
353 0, 353 0,
354 -18746354 -18910
355 ], 355 ],
356 "../images/blueprint-medium.png": [356 "../images/blueprint-medium.png": [
357 0, 357 0,
358 -5572358 -5736
359 ], 359 ],
360 "../images/product-badge.png": [360 "../images/product-badge.png": [
361 0, 361 0,
362 -9508362 -9672
363 ], 363 ],
364 "../images/list.png": [364 "../images/list.png": [
365 0, 365 0,
366 -11310366 -11474
367 ], 367 ],
368 "../images/launchpad-logo.png": [368 "../images/launchpad-logo.png": [
369 0, 369 0,
370 -18104370 -18268
371 ], 371 ],
372 "../images/flame-logo.png": [372 "../images/flame-logo.png": [
373 0, 373 0,
374 -19816374 -19980
375 ], 375 ],
376 "../images/translation-template.png": [376 "../images/translation-template.png": [
377 0, 377 0,
378 -10818378 -10982
379 ], 379 ],
380 "../images/bugtracker-icon.png": [380 "../images/bugtracker-icon.png": [
381 0, 381 0,
382 -8528382 -8692
383 ], 383 ],
384 "../images/meeting-logo.png": [384 "../images/meeting-logo.png": [
385 0, 385 0,
386 -19602386 -19766
387 ], 387 ],
388 "../images/treeCollapsed.png": [388 "../images/treeCollapsed.png": [
389 0, 389 0,
@@ -391,19 +391,19 @@
391 ], 391 ],
392 "../images/green-bar.png": [392 "../images/green-bar.png": [
393 0, 393 0,
394 -14918394 -15082
395 ], 395 ],
396 "../images/build-superseded.png": [396 "../images/build-superseded.png": [
397 0, 397 0,
398 -12786398 -12950
399 ], 399 ],
400 "../images/trash-large.png": [400 "../images/trash-large.png": [
401 0, 401 0,
402 -17740402 -17904
403 ], 403 ],
404 "../images/red-bar.png": [404 "../images/red-bar.png": [
405 0, 405 0,
406 -15246406 -15410
407 ], 407 ],
408 "../images/add.png": [408 "../images/add.png": [
409 0, 409 0,
@@ -415,7 +415,7 @@
415 ], 415 ],
416 "../images/person-inactive-logo.png": [416 "../images/person-inactive-logo.png": [
417 0, 417 0,
418 -19174418 -19338
419 ], 419 ],
420 "../images/edit.png": [420 "../images/edit.png": [
421 0, 421 0,
@@ -423,23 +423,27 @@
423 ], 423 ],
424 "../images/bug-wishlist.png": [424 "../images/bug-wishlist.png": [
425 0, 425 0,
426 -4916426 -5080
427 ], 427 ],
428 "../images/warning-large.png": [428 "../images/warning-large.png": [
429 0, 429 0,
430 -15920430 -16084
431 ], 431 ],
432 "../images/arrowEnd.png": [432 "../images/arrowEnd.png": [
433 0, 433 0,
434 -14098434 -14262
435 ], 435 ],
436 "../images/cve.png": [436 "../images/cve.png": [
437 0, 437 0,
438 -3932438 -4096
439 ], 439 ],
440 "../images/merge-proposal-large.png": [440 "../images/merge-proposal-large.png": [
441 0, 441 0,
442 -17558442 -17722
443 ],
444 "../images/branch.png": [
445 0,
446 -2948
443 ], 447 ],
444 "../images/person-badge.png": [448 "../images/person-badge.png": [
445 0, 449 0,
@@ -447,23 +451,23 @@
447 ], 451 ],
448 "../images/mentoring-large.png": [452 "../images/mentoring-large.png": [
449 0, 453 0,
450 -17376454 -17540
451 ], 455 ],
452 "../images/bug.png": [456 "../images/bug.png": [
453 0, 457 0,
454 -4096458 -4260
455 ], 459 ],
456 "../images/bug-remote.png": [460 "../images/bug-remote.png": [
457 0, 461 0,
458 -8036462 -8200
459 ], 463 ],
460 "../images/translation.png": [464 "../images/translation.png": [
461 0, 465 0,
462 -10490466 -10654
463 ], 467 ],
464 "../images/confirm.png": [468 "../images/confirm.png": [
465 0, 469 0,
466 -7542470 -7706
467 ], 471 ],
468 "../images/search.png": [472 "../images/search.png": [
469 0, 473 0,
470474
=== modified file 'lib/canonical/launchpad/icing/style-3-0.css.in'
--- lib/canonical/launchpad/icing/style-3-0.css.in 2010-02-09 03:57:08 +0000
+++ lib/canonical/launchpad/icing/style-3-0.css.in 2010-02-17 00:55:27 +0000
@@ -805,6 +805,8 @@
805 visibility: visible;805 visibility: visible;
806}806}
807807
808.cves {float: right;}
809
808/* == Sprites == */810/* == Sprites == */
809.sprite {811.sprite {
810 padding: 2px 0 5px 18px;812 padding: 2px 0 5px 18px;
@@ -926,6 +928,10 @@
926 background-image: url(/@@/treeExpanded.png); /* sprite-ref: icon-sprites */928 background-image: url(/@@/treeExpanded.png); /* sprite-ref: icon-sprites */
927 background-repeat: no-repeat;929 background-repeat: no-repeat;
928}930}
931.branch {
932 background-image: url(/@@/branch.png); /* sprite-ref: icon-sprites */
933 background-repeat: no-repeat;
934}
929.distribution {935.distribution {
930 background-image: url(/@@/distribution.png); /* sprite-ref: icon-sprites */936 background-image: url(/@@/distribution.png); /* sprite-ref: icon-sprites */
931 background-repeat: no-repeat;937 background-repeat: no-repeat;
932938
=== modified file 'lib/lp/services/spriteutils.py'
--- lib/lp/services/spriteutils.py 2010-02-10 06:02:33 +0000
+++ lib/lp/services/spriteutils.py 2010-02-17 00:55:27 +0000
@@ -112,6 +112,10 @@
112 if parameters['sprite-ref'] == group_name:112 if parameters['sprite-ref'] == group_name:
113 filename = self._getSpriteImagePath(113 filename = self._getSpriteImagePath(
114 rule, url_prefix_substitutions)114 rule, url_prefix_substitutions)
115 if filename == '':
116 raise AssertionError(
117 "Missing background-image url for %s css style"
118 % rule.selectorText)
115 self.sprite_info.append(119 self.sprite_info.append(
116 dict(filename=filename, rule=rule))120 dict(filename=filename, rule=rule))
117121
@@ -155,7 +159,12 @@
155 total_sprite_height = 0159 total_sprite_height = 0
156 for sprite in self.sprite_info:160 for sprite in self.sprite_info:
157 abs_filename = os.path.join(css_dir, sprite['filename'])161 abs_filename = os.path.join(css_dir, sprite['filename'])
158 sprite_images[sprite['filename']] = Image.open(abs_filename)162 try:
163 sprite_images[sprite['filename']] = Image.open(abs_filename)
164 except IOError:
165 print >> sys.stderr, "Error opening '%s' for %s css rule" % (
166 abs_filename, sprite['rule'].selectorText)
167 raise
159 width, height = sprite_images[sprite['filename']].size168 width, height = sprite_images[sprite['filename']].size
160 max_sprite_width = max(width, max_sprite_width)169 max_sprite_width = max(width, max_sprite_width)
161 total_sprite_height += height170 total_sprite_height += height