From f2ae365d3ec4f87c97f9af18fe218b1ec8d8afd2 Mon Sep 17 00:00:00 2001 From: "Brian (bex) Exelbierd" Date: Fri, 12 Jun 2015 00:12:06 +0200 Subject: [PATCH] Add project and agenda URLs to the bottom of calendar descriptions agenda_url is already used in the meeting file template, now it will be attached to every calendar event. The new key project_url is for the page describing the overall project and it too, if present will be in the calendar event. Closes: https://storyboard.openstack.org/#!/story/2000288 Change-Id: Ic9f823bf744b27f42359858e55557b36fcab8f0a Signed-off-by: Brian (bex) Exelbierd --- README.rst | 8 ++++++++ yaml2ical/ical.py | 9 +++++++++ 2 files changed, 17 insertions(+) diff --git a/README.rst b/README.rst index 42158aa..67be76e 100644 --- a/README.rst +++ b/README.rst @@ -178,3 +178,11 @@ will be import into Python as a dictionary. :: agenda_url: https://wiki.openstack.org/wiki/Meetings/Nova + +* An extra property containing the project URL is saved in + ``project_url`` and can be accessed in the template file as + ``meeting.extras.project_url``. + + :: + + project_url: https://wiki.openstack.org/wiki/Nova diff --git a/yaml2ical/ical.py b/yaml2ical/ical.py index c6b5df7..f15c957 100644 --- a/yaml2ical/ical.py +++ b/yaml2ical/ical.py @@ -51,6 +51,15 @@ class Yaml2IcalCalendar(icalendar.Calendar): ical_descript = "\n".join((project_descript, chair_descript, descript_descript)) + # Add URLs, if present, to the description + if 'agenda_url' in meeting.extras: + ical_descript = "\n".join((ical_descript, + "Agenda URL: %s" % + (meeting.extras['agenda_url']))) + if 'project_url' in meeting.extras: + ical_descript = "\n".join((ical_descript, + "Project URL: %s" % + (meeting.extras['project_url']))) event.add('description', ical_descript) # get starting date