diff --git a/plugins/talks.py b/plugins/talks.py index 17e6b9e..e8719b4 100644 --- a/plugins/talks.py +++ b/plugins/talks.py @@ -9,6 +9,7 @@ from functools import wraps import logging import re import datetime +import shutil from docutils import nodes from docutils.parsers.rst import directives, Directive @@ -43,10 +44,6 @@ def get_talk_names(): ] -def warn(s): - print('WARN:', s) - - @memoize def get_talk_data(talkname): fname = os.path.join(TALKS_PATH, talkname, 'meta.yaml') @@ -63,7 +60,7 @@ def get_talk_data(talkname): logging.warn("Talk <{}> has no `text` field".format(talkname)) data['text'] = '' if 'duration' not in data: - logging.warn("Talk <{}> has no `duration` field".format(talkname)) + logging.info("Talk <{}> has no `duration` field".format(talkname)) data['duration'] = 50 data['duration'] = int(data['duration']) if 'room' not in data: @@ -78,6 +75,9 @@ def get_talk_data(talkname): else: logging.error("Talk <{}> has malformed `time`".format(talkname)) data['id'] = talkname + resdir = os.path.join(TALKS_PATH, talkname, 'res') + if os.path.isdir(resdir) and os.listdir(resdir): + data['resources'] = resdir return data @@ -93,12 +93,6 @@ class TalkListDirective(Directive): final_argument_whitespace = True has_content = True - # TODO: use a jinja template - tmpl = u'''