Merge lp:~salgado/summit/highlight-linaro-sessions into lp:summit

Proposed by Guilherme Salgado
Status: Merged
Merged at revision: 28
Proposed branch: lp:~salgado/summit/highlight-linaro-sessions
Merge into: lp:summit
Diff against target: 75 lines (+34/-0)
3 files modified
summit/media/css/schedule.css (+6/-0)
summit/schedule/models/meetingmodel.py (+22/-0)
summit/schedule/render.py (+6/-0)
To merge this branch: bzr merge lp:~salgado/summit/highlight-linaro-sessions
Reviewer Review Type Date Requested Status
Dave Walker (community) Approve
Review via email: mp+36309@code.launchpad.net

Description of the change

This branch highlights the linaro sessions with a different icon and a green border.

Some discussion about the change: https://wiki.canonical.com/UbuntuPlatform/Linaro/Summit_Changes

And there's a screenshot at http://people.canonical.com/~salgado/linaro-summit.png

To post a comment you must log in.
Revision history for this message
Elliot Murphy (statik) wrote :

Looks good to me!

Revision history for this message
Michael Hall (mhall119) wrote :

In def is_linaro, is there a reason you didn't just include the leading / in the string literal, thus saving the call to startswith() and a string concatination?

Revision history for this message
Guilherme Salgado (salgado) wrote :

On Wed, 2010-09-22 at 15:41 +0000, Michael Hall wrote:
> In def is_linaro, is there a reason you didn't just include the leading / in the string literal, thus saving the call to startswith() and a string concatination?

Just to avoid repeating the slash in all lines, I guess. Note that the
startswith() call can't be avoided, though, as the path won't ever be
just /project for a blueprint URL.

--
Guilherme Salgado <https://launchpad.net/~salgado>

Revision history for this message
Michael Hall (mhall119) wrote :

In that case, the first 'linaro' in the list will also match any URL for 'linaro-kernel-wg', 'linaro-pm-wg' and 'linaro-toolchain-misc'. Same with 'gcc-linaro' and 'gcc-linaro-tracking'. Not that it will break anything in this case, just to be aware that those others won't ever be used.

Revision history for this message
Guilherme Salgado (salgado) wrote :

On Wed, 2010-09-22 at 16:27 +0000, Michael Hall wrote:
> In that case, the first 'linaro' in the list will also match any URL for 'linaro-kernel-wg', 'linaro-pm-wg' and 'linaro-toolchain-misc'. Same with 'gcc-linaro' and 'gcc-linaro-tracking'. Not that it will break anything in this case, just to be aware that those others won't ever be used.

Good catch, I could leave just 'linaro' and the ones that don't start
with that (with a comment explaining that it should catch all), although
it may be worth leaving the whole list of projects there -- you know,
explicit is better than implicit. ;)

What do you think?

Revision history for this message
Michael Hall (mhall119) wrote :

As long as there's no need to match them exactly, I don't see any harm in leaving them in there, it does serve to document what it is expecting to find.

Revision history for this message
Guilherme Salgado (salgado) wrote :

On Wed, 2010-09-22 at 17:43 +0000, Michael Hall wrote:
> As long as there's no need to match them exactly, I don't see any harm in leaving them in there, it does serve to document what it is expecting to find.

Cool. Are you happy with the rest of the changes as well?

Also, is there anything else I need to do to get this merged?

Cheers

Revision history for this message
Dave Walker (davewalker) wrote :

Looks good, and I think Michael is also satisfied. Merging.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'summit/media/css/schedule.css'
2--- summit/media/css/schedule.css 2010-05-05 08:53:41 +0000
3+++ summit/media/css/schedule.css 2010-09-22 14:44:45 +0000
4@@ -180,6 +180,12 @@
5 font-size: 8px;
6 }
7
8+/* Linaro-related sessions get a green border to make it easier to distinguish
9+ * them. */
10+div.meeting.linaro {
11+ border: 1px solid green;
12+}
13+
14
15 /* Meetings have additional classes for their type, which we use to set
16 * a pretty background colour.
17
18=== added file 'summit/media/img/blueprint-linaro.png'
19Binary files summit/media/img/blueprint-linaro.png 1970-01-01 00:00:00 +0000 and summit/media/img/blueprint-linaro.png 2010-09-22 14:44:45 +0000 differ
20=== modified file 'summit/schedule/models/meetingmodel.py'
21--- summit/schedule/models/meetingmodel.py 2010-05-05 08:49:24 +0000
22+++ summit/schedule/models/meetingmodel.py 2010-09-22 14:44:45 +0000
23@@ -15,6 +15,7 @@
24 # along with this program. If not, see <http://www.gnu.org/licenses/>.
25
26 import urllib2
27+from urlparse import urlparse
28
29 from BeautifulSoup import BeautifulSoup
30
31@@ -111,6 +112,27 @@
32 return self.title
33
34 @property
35+ def is_linaro(self):
36+ path = urlparse(self.spec_url).path
37+ linaro_projects = [
38+ 'linaro',
39+ 'linaro-kernel-wg',
40+ 'linaro-pm-wg',
41+ 'binutils-linaro',
42+ 'cortex-strings',
43+ 'gcc-linaro',
44+ 'gcc-linaro-tracking',
45+ 'gdb-linaro',
46+ 'linaro-toolchain-misc',
47+ 'qemu-linaro',
48+ 'tcwg-web',
49+ ]
50+ for project in linaro_projects:
51+ if path.startswith('/%s' % project):
52+ return True
53+ return False
54+
55+ @property
56 def attendees(self):
57 attendees = []
58 if self.scribe and self.scribe not in attendees:
59
60=== modified file 'summit/schedule/render.py'
61--- summit/schedule/render.py 2010-05-05 08:49:24 +0000
62+++ summit/schedule/render.py 2010-09-22 14:44:45 +0000
63@@ -618,6 +618,12 @@
64 else:
65 spec = label = icon = None
66
67+ if meeting.is_linaro:
68+ # Linaro blueprints get a different icon/class to make it easier
69+ # to distinguish them.
70+ icon = 'linaro'
71+ classes.append("linaro")
72+
73 html += '<div id="meeting%d"\n' % meeting.id
74 html += ' class="%s"\n' % ' '.join(classes)
75 html += ' style="%(style)s">\n'

Subscribers

People subscribed via source and target branches