From d889b610a47f5effc971fe66366489431a390476 Mon Sep 17 00:00:00 2001 From: boyska Date: Sun, 1 Jul 2018 13:02:11 +0200 Subject: [PATCH] Nome stanze globale in talks/meta.yaml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Così poi gli si possono dare dei nomi decenti invece di A,B,C --- plugins/talks.py | 7 ++++++- talks/meta.yaml | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/plugins/talks.py b/plugins/talks.py index 80a31e3..7995830 100644 --- a/plugins/talks.py +++ b/plugins/talks.py @@ -97,6 +97,8 @@ def get_global_data(): if 'startdate' not in data: logging.error("Missing startdate in global data") data['startdate'] = datetime.datetime.now() + if 'rooms' not in data: + data['rooms'] = {} return data @@ -143,6 +145,9 @@ def get_talk_data(talkname): data['needs'] = [] if 'room' not in data: logging.warn("Talk <{}> has no `room` field".format(talkname)) + else: + if data['room'] in get_global_data()['rooms']: + data['room'] = get_global_data()['rooms'][data['room']] if 'time' not in data or 'day' not in data: logging.warn("Talk <{}> has no `time` or `day`".format(talkname)) if 'time' in data: @@ -305,7 +310,7 @@ class TalkGridDirective(Directive): rooms.add(r) else: rooms.add(t['room']) - rooms = list(sorted(rooms)) + rooms = list(sorted(rooms)) # TODO: ordina in base a qualcosa nel meta.yaml globale # room=* is not a real room. # Remove it unless that day only has special rooms if '*' in rooms and len(rooms) > 1: diff --git a/talks/meta.yaml b/talks/meta.yaml index ba564fe..738f711 100644 --- a/talks/meta.yaml +++ b/talks/meta.yaml @@ -1 +1,5 @@ startdate: 2018-07-05 +rooms: + A: Sala A + B: Sala B + C: Sala C