Inserts for Datengarten
This commit is contained in:
parent
c832014b8b
commit
2e569321a8
3 changed files with 44 additions and 15 deletions
|
@ -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(
|
||||
|
|
|
@ -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">
|
||||
<sodipodi:guide
|
||||
position="71.059524,78.61905"
|
||||
|
@ -214,18 +214,18 @@
|
|||
<flowRoot
|
||||
xml:space="preserve"
|
||||
id="flowRoot986"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:53.33333292px;line-height:125%;font-family:monospace;-inkscape-font-specification:'monospace, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr;text-anchor:start;fill:#ececec;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:53.33333206px;line-height:125%;font-family:monospace;-inkscape-font-specification:'monospace, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ececec;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
transform="matrix(0.26458334,0,0,0.26458334,-2.2678569,42.999983)"><flowRegion
|
||||
id="flowRegion988"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:53.33333292px;font-family:monospace;-inkscape-font-specification:'monospace, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr;text-anchor:start;fill:#ececec;"><rect
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:53.33333206px;font-family:monospace;-inkscape-font-specification:'monospace, Normal';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:#ececec"><rect
|
||||
id="rect990"
|
||||
width="1375.7142"
|
||||
height="94.285721"
|
||||
x="525.71429"
|
||||
y="782.85712"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:53.33333292px;font-family:monospace;-inkscape-font-specification:'monospace, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr;text-anchor:start;fill:#ececec;" /></flowRegion><flowPara
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:53.33333206px;font-family:monospace;-inkscape-font-specification:'monospace, Normal';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:#ececec" /></flowRegion><flowPara
|
||||
id="flowPara992"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:53.33333292px;font-family:monospace;-inkscape-font-specification:'monospace, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr;text-anchor:start;fill:#ececec;">IT-Security Weaknesses of Emergency Alert Apps</flowPara></flowRoot> <flowRoot
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:53.33333206px;font-family:monospace;-inkscape-font-specification:'monospace, Normal';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:#ececec">$TAGLINE</flowPara></flowRoot> <flowRoot
|
||||
xml:space="preserve"
|
||||
id="flowRoot994"
|
||||
style="fill:black;stroke:none;stroke-opacity:1;stroke-width:1px;stroke-linejoin:miter;stroke-linecap:butt;fill-opacity:1;font-family:sans-serif;font-style:normal;font-weight:normal;font-size:40px;line-height:125%;letter-spacing:0px;word-spacing:0px"><flowRegion
|
||||
|
@ -238,16 +238,16 @@
|
|||
id="flowPara1000" /></flowRoot> <flowRoot
|
||||
xml:space="preserve"
|
||||
id="flowRoot1002"
|
||||
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:66.66666616px;line-height:125%;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;letter-spacing:0px;word-spacing:0px;writing-mode:lr;text-anchor:start;fill:#e6e6e6;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;"
|
||||
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:66.66666412px;line-height:125%;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;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#e6e6e6;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
transform="matrix(0.26458334,0,0,0.26458334,17.386905,12.761888)"><flowRegion
|
||||
id="flowRegion1004"
|
||||
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:66.66666616px;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;text-anchor:start;fill:#e6e6e6;"><rect
|
||||
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"><rect
|
||||
id="rect1006"
|
||||
width="1401.4285"
|
||||
height="105.71431"
|
||||
x="454.28571"
|
||||
y="782.85712"
|
||||
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:66.66666616px;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;text-anchor:start;fill:#e6e6e6;" /></flowRegion><flowPara
|
||||
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" /></flowRegion><flowPara
|
||||
id="flowPara1008"
|
||||
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:66.66666616px;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;text-anchor:start;fill:#e6e6e6;">Malte Schoenefeld</flowPara></flowRoot> </g>
|
||||
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</flowPara></flowRoot> </g>
|
||||
</svg>
|
||||
|
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
@ -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:
|
||||
|
|
Loading…
Add table
Reference in a new issue