1
0
Fork 0

errori un po piu chiari

This commit is contained in:
boyska 2017-05-22 11:13:25 +02:00
parent 01827360bc
commit b859aa8d8f
No known key found for this signature in database
GPG key ID: 7395DCAE58289CA9

View file

@ -103,6 +103,7 @@ def get_talk_data(talkname):
return None
if data is None:
return None
try:
if 'title' not in data:
logging.warn("Talk <{}> has no `title` field".format(talkname))
data['title'] = talkname
@ -147,6 +148,9 @@ def get_talk_data(talkname):
if os.path.isdir(resdir) and os.listdir(resdir):
data['resources'] = resdir
return data
except:
logging.exception("Error on talk %s", talkname)
raise
jinja_env = jinja2.Environment(
@ -264,13 +268,16 @@ class TalkGridDirective(Directive):
def talks_to_ics():
content = u'BEGIN:VCALENDAR\nVERSION:2.0\nPRODID:pelican\n'
for t in all_talks():
try:
content += talk_to_ics(t)
except:
logging.exception("Error producing calendar for talk %s", t['id'])
content += 'END:VCALENDAR\n'
return content
def talk_to_ics(talk):
if 'time' not in talk or 'duration' not in talk:
if 'time' not in talk or 'duration' not in talk or 'room' not in talk:
return ''
start = talk['time']
end = start + datetime.timedelta(minutes=talk['duration'])