From 2e569321a8dc32ed22b9a736d6f098043bf38318 Mon Sep 17 00:00:00 2001 From: Daniel Molkentin Date: Tue, 10 Dec 2019 17:12:02 +0100 Subject: [PATCH] Inserts for Datengarten --- datengarten/__init__.py | 26 ++++++++++++++++++++++++++ datengarten/artwork/lower-third.svg | 26 +++++++++++++------------- renderlib.py | 7 +++++-- 3 files changed, 44 insertions(+), 15 deletions(-) diff --git a/datengarten/__init__.py b/datengarten/__init__.py index 1f915e6..5a4625c 100644 --- a/datengarten/__init__.py +++ b/datengarten/__init__.py @@ -5,6 +5,13 @@ from easing import * scheduleUrl = "https://berlin.ccc.de/datengarten/index.xml" +personmap = { +} + +taglinemap = { +} + + def introFrames(p): move=50 @@ -87,6 +94,25 @@ def tasks(queue, args, idlist, skiplist): } )) + for person in persons(scheduleUrl, personmap, taglinemap, event['id']): + queue.put(Rendertask( + infile = 'lower-third.svg', + outfile = "event_{}_person_{}.png".format(str(event['id']), str(person['id'])), + parameters = { + '$PERSON': person['person'], + '$TAGLINE': person['tagline'], + } + )) + + queue.put(Rendertask( + infile = 'lower-third.svg', + outfile = "event_{}_persons.png".format(str(event['id'])), + parameters = { + '$PERSON': event['personnames'], + '$TAGLINE': '', + } + )) + # place a task for the outro into the queue if not "out" in skiplist: queue.put(Rendertask( diff --git a/datengarten/artwork/lower-third.svg b/datengarten/artwork/lower-third.svg index db9e63f..17616d7 100644 --- a/datengarten/artwork/lower-third.svg +++ b/datengarten/artwork/lower-third.svg @@ -15,7 +15,7 @@ viewBox="0 0 508 285.75001" version="1.1" id="svg8" - inkscape:version="0.92.4 (5da689c313, 2019-01-14)" + inkscape:version="0.92.2 5c3e80d, 2017-08-06" sodipodi:docname="lower-third.svg" inkscape:export-filename="/home/peter/DG-test.png" inkscape:export-xdpi="96" @@ -53,7 +53,7 @@ inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="0.7" - inkscape:cx="638.56771" + inkscape:cx="641.42485" inkscape:cy="446.1006" inkscape:document-units="px" inkscape:current-layer="layer1" @@ -62,10 +62,10 @@ inkscape:pagecheckerboard="true" showguides="true" inkscape:guide-bbox="true" - inkscape:window-width="2558" - inkscape:window-height="1384" + inkscape:window-width="1920" + inkscape:window-height="1080" inkscape:window-x="0" - inkscape:window-y="228" + inkscape:window-y="0" inkscape:window-maximized="0"> IT-Security Weaknesses of Emergency Alert Apps $TAGLINE Malte Schoenefeld + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:66.66666412px;font-family:monospace;-inkscape-font-specification:'monospace, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#e6e6e6">$PERSON diff --git a/renderlib.py b/renderlib.py index ad32edc..278496e 100644 --- a/renderlib.py +++ b/renderlib.py @@ -92,7 +92,7 @@ def renderFrame(infile, task, outfile): else: # invoke inkscape to convert the generated svg-file into a png inside the .frames-directory cmd = 'inkscape --export-background=white --export-background-opacity=0 --export-width={1} --export-height={2} --export-png="{3}" "{4}" 2>&1 >/dev/null'.format(task.workdir, width, height, outfile, infile) - errorReturn = subprocess.check_output(cmd, shell=True, universal_newlines=True, stderr=subprocess.STDOUT) + errorReturn = subprocess.check_output(cmd, shell=True, universal_newlines=True, stderr=subprocess.STDOUT, cwd=task.workdir) if errorReturn != '': print("inkscape exitted with error\n" + errorReturn) # sys.exit(42) @@ -239,7 +239,7 @@ def downloadSchedule(scheduleUrl): parser = etree.XMLParser(huge_tree=True) return etree.fromstring(xml, parser) -def persons(scheduleUrl, personmap={}, taglinemap={}): +def persons(scheduleUrl, personmap={}, taglinemap={}, forEventId=None): schedule = downloadSchedule(scheduleUrl) # iterate all days for day in schedule.iter('day'): @@ -247,6 +247,9 @@ def persons(scheduleUrl, personmap={}, taglinemap={}): for room in day.iter('room'): # iterate events on that day in this room for event in room.iter('event'): + eventid = int(event.get("id")) + if event != None and not eventid == forEventId: + continue # aggregate names of the persons holding this talk persons_seen = [] if event.find('persons') is not None: