lpschedule-generator

libreplanet schedule generator - ricketyspace.net/lpschedule-generator
git clone git://git.ricketyspace.net/lpschedule-generator.git
Log | Files | Refs

commit b5b8dc5ab0fc8d393e6fdbc18a6944fffdab4857
parent fa817e6ca82350df9d0ae6a817c760f8720bd4f6
Author: rsiddharth <rsd@gnu.org>
Date:   Wed, 16 Dec 2015 22:29:42 -0500

'speaker' -> 'speakers'

`speakers` is always a list.

Diffstat:
lps_gen.py | 7++-----
templates/lp-sch-2016.jinja2 | 4++--
tests/files/lp-sch.md | 4+++-
tests/test_lps_gen.py | 18+++++++++---------
4 files changed, 16 insertions(+), 17 deletions(-)

diff --git a/lps_gen.py b/lps_gen.py @@ -96,13 +96,10 @@ class LPSRenderer(Renderer): if self.no_paragraph == 0: # Speaker - if len(text.split(', ')) == 1: - speaker_text = text - else: - speaker_text = text.split(', ') + speakers = text.split(', ') lps_dict[self.last_day][self.last_time_slot][ - self.last_session]['speaker'] = speaker_text + self.last_session]['speakers'] = speakers self.no_paragraph = self.no_paragraph + 1 elif self.no_paragraph == 1: # Room diff --git a/templates/lp-sch-2016.jinja2 b/templates/lp-sch-2016.jinja2 @@ -78,8 +78,8 @@ {% for session, session_info in sessions.iteritems() %} {# session start #} <section id="day-{{ day_index }}-timeslot-{{ timeslot_index }}-session-{{ loop.index }}" class="program-session"> <!-- day-{{ day_index }}-timeslot-{{ timeslot_index }}-session-{{ loop.index }} start --> {{ mk_session_header(session) }} - <p>{{ session_info['speaker'] }}</p> - <p>{{ session_info['room'] }}</p> + {{ mk_speakers(session_info['speakers']) }} + {{ mk_room(session_info['room']) }} {{ desc(session_info['desc']) }} </section> <!-- day-{{ day_index }}-timeslot-{{ timeslot_index }}-session-{{ loop.index }} end --> {% endfor %} {# session end #} diff --git a/tests/files/lp-sch.md b/tests/files/lp-sch.md @@ -17,7 +17,9 @@ director. #### Federation and GNU -Christopher Webber +[Christopher Webber][webber] + +[webber]: http://dustycloud.org Room 32-123 diff --git a/tests/test_lps_gen.py b/tests/test_lps_gen.py @@ -112,22 +112,22 @@ class TestLpsGen(object): Testing `LPSMarkdown` class - Speaker """ speakers = [ - 'Richard Stallman', - 'Christopher Webber', - 'ginger coons', + ['Richard Stallman'], + ['<a href="http://dustycloud.org">Christopher Webber</a>'], + ['ginger coons'], ['Marianne Corvellec', 'Jonathan Le Lous'], - 'Seth Schoen', - 'Jonas Öberg', - 'Benjamin Mako Hill', - 'Bradley Kuhn', - 'Ken Starks', + ['Seth Schoen'], + ['Jonas Öberg'], + ['Benjamin Mako Hill'], + ['Bradley Kuhn'], + ['Ken Starks'], ] i = 0 for lps_timeslots in self.lps_dict.values(): for lps_sessions in lps_timeslots.values(): for session_info in lps_sessions.values(): - assert_equal(session_info['speaker'], speakers[i]) + assert_equal(session_info['speakers'], speakers[i]) i = i + 1