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
1=== modified file 'lib/canonical/launchpad/icing/icon-sprites'
2Binary 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
3=== modified file 'lib/canonical/launchpad/icing/icon-sprites.positioning'
4--- lib/canonical/launchpad/icing/icon-sprites.positioning 2010-02-08 21:10:39 +0000
5+++ lib/canonical/launchpad/icing/icon-sprites.positioning 2010-02-17 00:55:27 +0000
6@@ -3,19 +3,19 @@
7 {
8 "../images/arrowLeft.png": [
9 0,
10- -14590
11+ -14754
12 ],
13 "../images/cancel.png": [
14 0,
15- -7376
16+ -7540
17 ],
18 "../images/milestone.png": [
19 0,
20- -3276
21+ -3440
22 ],
23 "../images/zoom-out.png": [
24 0,
25- -11802
26+ -11966
27 ],
28 "../images/team.png": [
29 0,
30@@ -23,15 +23,15 @@
31 ],
32 "../images/bug-undecided.png": [
33 0,
34- -7872
35+ -8036
36 ],
37 "../images/blueprint-low.png": [
38 0,
39- -5736
40+ -5900
41 ],
42 "../images/meeting.png": [
43 0,
44- -10326
45+ -10490
46 ],
47 "../images/no.png": [
48 0,
49@@ -39,15 +39,15 @@
50 ],
51 "../images/distribution-badge.png": [
52 0,
53- -9020
54+ -9184
55 ],
56 "../images/arrowTop.png": [
57 0,
58- -14262
59+ -14426
60 ],
61 "../images/zoom-in.png": [
62 0,
63- -11638
64+ -11802
65 ],
66 "../images/team-badge.png": [
67 0,
68@@ -55,99 +55,99 @@
69 ],
70 "../images/blue-bar.png": [
71 0,
72- -14754
73+ -14918
74 ],
75 "../images/arrowStart.png": [
76 0,
77- -13934
78+ -14098
79 ],
80 "../images/ppa-icon-inactive.png": [
81 0,
82- -12294
83+ -12458
84 ],
85 "../images/build-needed.png": [
86 0,
87- -13114
88+ -13278
89 ],
90 "../images/purple-bar.png": [
91 0,
92- -15082
93+ -15246
94 ],
95 "../images/bullet.png": [
96 0,
97- -11474
98+ -11638
99 ],
100 "../images/info-large.png": [
101 0,
102- -17012
103+ -17176
104 ],
105 "../images/trash-logo.png": [
106 0,
107- -20030
108+ -20194
109 ],
110 "../images/warning.png": [
111 0,
112- -9998
113+ -10162
114 ],
115 "../images/mail.png": [
116 0,
117- -3768
118+ -3932
119 ],
120 "../images/build-failure.png": [
121 0,
122- -13278
123+ -13442
124 ],
125 "../images/branch-large.png": [
126 0,
127- -15738
128+ -15902
129 ],
130 "../images/download-large.png": [
131 0,
132- -16830
133+ -16994
134 ],
135 "../images/private-large.png": [
136 0,
137- -17922
138+ -18086
139 ],
140 "../images/launchpad-large.png": [
141 0,
142- -17194
143+ -17358
144 ],
145 "../images/translation-file.png": [
146 0,
147- -10654
148+ -10818
149 ],
150 "../images/read-only.png": [
151 0,
152- -9834
153+ -9998
154 ],
155 "../images/project-logo.png": [
156 0,
157- -18532
158+ -18696
159 ],
160 "../images/bug-medium.png": [
161 0,
162- -4588
163+ -4752
164 ],
165 "../images/architecture.png": [
166 0,
167- -11966
168+ -12130
169 ],
170 "../images/trash-icon.png": [
171 0,
172- -10982
173+ -11146
174 ],
175 "../images/person-inactive.png": [
176 0,
177- -6558
178+ -6722
179 ],
180 "../images/arrowBottom.png": [
181 0,
182- -14426
183+ -14590
184 ],
185 "../images/project.png": [
186 0,
187- -9344
188+ -9508
189 ],
190 "../images/crowd.png": [
191 0,
192@@ -159,43 +159,43 @@
193 ],
194 "../images/flame-icon.png": [
195 0,
196- -7708
197+ -7872
198 ],
199 "../images/ubuntu-icon.png": [
200 0,
201- -6392
202+ -6556
203 ],
204 "../images/link.png": [
205 0,
206- -3604
207+ -3768
208 ],
209 "../images/stop.png": [
210 0,
211- -11146
212+ -11310
213 ],
214 "../images/person-logo.png": [
215 0,
216- -18960
217+ -19124
218 ],
219 "../images/distribution-logo.png": [
220 0,
221- -18318
222+ -18482
223 ],
224 "../images/retry.png": [
225 0,
226- -8856
227+ -9020
228 ],
229 "../images/rss.png": [
230 0,
231- -6228
232+ -6392
233 ],
234 "../images/private.png": [
235 0,
236- -10162
237+ -10326
238 ],
239 "../images/merge-proposal-icon.png": [
240 0,
241- -12622
242+ -12786
243 ],
244 "../images/download.png": [
245 0,
246@@ -203,75 +203,75 @@
247 ],
248 "../images/arrowDown.png": [
249 0,
250- -13770
251+ -13934
252 ],
253 "../images/package-binary.png": [
254 0,
255- -8692
256+ -8856
257 ],
258 "../images/maybe.png": [
259 0,
260- -7048
261+ -7212
262 ],
263 "../images/bug-status-expand.png": [
264 0,
265- -12458
266+ -12622
267 ],
268 "../images/crowd-large.png": [
269 0,
270- -16102
271+ -16266
272 ],
273 "../images/blueprint.png": [
274 0,
275- -5080
276+ -5244
277 ],
278 "../images/project-badge.png": [
279 0,
280- -9182
281+ -9346
282 ],
283 "../images/bug-high.png": [
284 0,
285- -4424
286+ -4588
287 ],
288 "../images/blueprint-undefined.png": [
289 0,
290- -5900
291+ -6064
292 ],
293 "../images/blueprint-not.png": [
294 0,
295- -6064
296+ -6228
297 ],
298 "../images/mentoring.png": [
299 0,
300- -6884
301+ -7048
302 ],
303 "../images/flame-large.png": [
304 0,
305- -16648
306+ -16812
307 ],
308 "../images/bug-dupe-icon.png": [
309 0,
310- -8364
311+ -8528
312 ],
313 "../images/bug-critical.png": [
314 0,
315- -4260
316+ -4424
317 ],
318 "../images/build-success.png": [
319 0,
320- -12950
321+ -13114
322 ],
323 "../images/haspatch-icon.png": [
324 0,
325- -15574
326+ -15738
327 ],
328 "../images/person-inactive-badge.png": [
329 0,
330- -6722
331+ -6886
332 ],
333 "../images/ppa-icon.png": [
334 0,
335- -12130
336+ -12294
337 ],
338 "../images/yes.png": [
339 0,
340@@ -279,7 +279,7 @@
341 ],
342 "../images/team-logo.png": [
343 0,
344- -19388
345+ -19552
346 ],
347 "../images/arrowRight.png": [
348 0,
349@@ -287,23 +287,23 @@
350 ],
351 "../images/blueprint-high.png": [
352 0,
353- -5408
354+ -5572
355 ],
356 "../images/product.png": [
357 0,
358- -9670
359+ -9834
360 ],
361 "../images/bug-low.png": [
362 0,
363- -4752
364+ -4916
365 ],
366 "../images/package-source.png": [
367 0,
368- -3112
369+ -3276
370 ],
371 "../images/language.png": [
372 0,
373- -3440
374+ -3604
375 ],
376 "../images/person.png": [
377 0,
378@@ -311,19 +311,19 @@
379 ],
380 "../images/arrowUp.png": [
381 0,
382- -13606
383+ -13770
384 ],
385 "../images/distribution.png": [
386 0,
387- -2948
388+ -3112
389 ],
390 "../images/error-large.png": [
391 0,
392- -16466
393+ -16630
394 ],
395 "../images/news.png": [
396 0,
397- -15410
398+ -15574
399 ],
400 "../images/treeExpanded.png": [
401 0,
402@@ -331,11 +331,11 @@
403 ],
404 "../images/build-depwait.png": [
405 0,
406- -13442
407+ -13606
408 ],
409 "../images/blueprint-essential.png": [
410 0,
411- -5244
412+ -5408
413 ],
414 "../images/question.png": [
415 0,
416@@ -343,47 +343,47 @@
417 ],
418 "../images/error.png": [
419 0,
420- -7212
421+ -7376
422 ],
423 "../images/bug-unknown.png": [
424 0,
425- -8200
426+ -8364
427 ],
428 "../images/product-logo.png": [
429 0,
430- -18746
431+ -18910
432 ],
433 "../images/blueprint-medium.png": [
434 0,
435- -5572
436+ -5736
437 ],
438 "../images/product-badge.png": [
439 0,
440- -9508
441+ -9672
442 ],
443 "../images/list.png": [
444 0,
445- -11310
446+ -11474
447 ],
448 "../images/launchpad-logo.png": [
449 0,
450- -18104
451+ -18268
452 ],
453 "../images/flame-logo.png": [
454 0,
455- -19816
456+ -19980
457 ],
458 "../images/translation-template.png": [
459 0,
460- -10818
461+ -10982
462 ],
463 "../images/bugtracker-icon.png": [
464 0,
465- -8528
466+ -8692
467 ],
468 "../images/meeting-logo.png": [
469 0,
470- -19602
471+ -19766
472 ],
473 "../images/treeCollapsed.png": [
474 0,
475@@ -391,19 +391,19 @@
476 ],
477 "../images/green-bar.png": [
478 0,
479- -14918
480+ -15082
481 ],
482 "../images/build-superseded.png": [
483 0,
484- -12786
485+ -12950
486 ],
487 "../images/trash-large.png": [
488 0,
489- -17740
490+ -17904
491 ],
492 "../images/red-bar.png": [
493 0,
494- -15246
495+ -15410
496 ],
497 "../images/add.png": [
498 0,
499@@ -415,7 +415,7 @@
500 ],
501 "../images/person-inactive-logo.png": [
502 0,
503- -19174
504+ -19338
505 ],
506 "../images/edit.png": [
507 0,
508@@ -423,23 +423,27 @@
509 ],
510 "../images/bug-wishlist.png": [
511 0,
512- -4916
513+ -5080
514 ],
515 "../images/warning-large.png": [
516 0,
517- -15920
518+ -16084
519 ],
520 "../images/arrowEnd.png": [
521 0,
522- -14098
523+ -14262
524 ],
525 "../images/cve.png": [
526 0,
527- -3932
528+ -4096
529 ],
530 "../images/merge-proposal-large.png": [
531 0,
532- -17558
533+ -17722
534+ ],
535+ "../images/branch.png": [
536+ 0,
537+ -2948
538 ],
539 "../images/person-badge.png": [
540 0,
541@@ -447,23 +451,23 @@
542 ],
543 "../images/mentoring-large.png": [
544 0,
545- -17376
546+ -17540
547 ],
548 "../images/bug.png": [
549 0,
550- -4096
551+ -4260
552 ],
553 "../images/bug-remote.png": [
554 0,
555- -8036
556+ -8200
557 ],
558 "../images/translation.png": [
559 0,
560- -10490
561+ -10654
562 ],
563 "../images/confirm.png": [
564 0,
565- -7542
566+ -7706
567 ],
568 "../images/search.png": [
569 0,
570
571=== modified file 'lib/canonical/launchpad/icing/style-3-0.css.in'
572--- lib/canonical/launchpad/icing/style-3-0.css.in 2010-02-09 03:57:08 +0000
573+++ lib/canonical/launchpad/icing/style-3-0.css.in 2010-02-17 00:55:27 +0000
574@@ -805,6 +805,8 @@
575 visibility: visible;
576 }
577
578+.cves {float: right;}
579+
580 /* == Sprites == */
581 .sprite {
582 padding: 2px 0 5px 18px;
583@@ -926,6 +928,10 @@
584 background-image: url(/@@/treeExpanded.png); /* sprite-ref: icon-sprites */
585 background-repeat: no-repeat;
586 }
587+.branch {
588+ background-image: url(/@@/branch.png); /* sprite-ref: icon-sprites */
589+ background-repeat: no-repeat;
590+}
591 .distribution {
592 background-image: url(/@@/distribution.png); /* sprite-ref: icon-sprites */
593 background-repeat: no-repeat;
594
595=== modified file 'lib/lp/services/spriteutils.py'
596--- lib/lp/services/spriteutils.py 2010-02-10 06:02:33 +0000
597+++ lib/lp/services/spriteutils.py 2010-02-17 00:55:27 +0000
598@@ -112,6 +112,10 @@
599 if parameters['sprite-ref'] == group_name:
600 filename = self._getSpriteImagePath(
601 rule, url_prefix_substitutions)
602+ if filename == '':
603+ raise AssertionError(
604+ "Missing background-image url for %s css style"
605+ % rule.selectorText)
606 self.sprite_info.append(
607 dict(filename=filename, rule=rule))
608
609@@ -155,7 +159,12 @@
610 total_sprite_height = 0
611 for sprite in self.sprite_info:
612 abs_filename = os.path.join(css_dir, sprite['filename'])
613- sprite_images[sprite['filename']] = Image.open(abs_filename)
614+ try:
615+ sprite_images[sprite['filename']] = Image.open(abs_filename)
616+ except IOError:
617+ print >> sys.stderr, "Error opening '%s' for %s css rule" % (
618+ abs_filename, sprite['rule'].selectorText)
619+ raise
620 width, height = sprite_images[sprite['filename']].size
621 max_sprite_width = max(width, max_sprite_width)
622 total_sprite_height += height