migrate to new Rendertask-Class
This commit is contained in:
parent
81b0c60fa6
commit
d11886698a
6 changed files with 100 additions and 87 deletions
|
@ -1,5 +1,6 @@
|
|||
#!/usr/bin/python
|
||||
# -*- coding: UTF-8 -*-
|
||||
#!/usr/bin/python3
|
||||
|
||||
from renderlib import *
|
||||
|
||||
def outroFrames():
|
||||
# 8 Sekunden
|
||||
|
@ -79,15 +80,15 @@ def debug():
|
|||
|
||||
def tasks(queue):
|
||||
# generate a task description and put them into the queue
|
||||
queue.put((
|
||||
'intro.svg',
|
||||
"intro.dv",
|
||||
introFrames
|
||||
queue.put(Rendertask(
|
||||
infile = 'intro.svg',
|
||||
outfile = "intro.dv",
|
||||
sequence = introFrames
|
||||
))
|
||||
|
||||
# place a task for the outro into the queue
|
||||
queue.put((
|
||||
'outro.svg',
|
||||
'outro.dv',
|
||||
outroFrames
|
||||
queue.put(Rendertask(
|
||||
infile = 'outro.svg',
|
||||
outfile = 'outro.dv',
|
||||
sequence = outroFrames
|
||||
))
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/python
|
||||
# -*- coding: UTF-8 -*-
|
||||
#!/usr/bin/python3
|
||||
|
||||
from renderlib import *
|
||||
import math
|
||||
|
||||
# URL to Schedule-XML
|
||||
|
@ -118,14 +118,14 @@ def debug():
|
|||
|
||||
def tasks(queue):
|
||||
# iterate over all events extracted from the schedule xml-export
|
||||
for event in events():
|
||||
for event in events(scheduleUrl):
|
||||
|
||||
# generate a task description and put them into the queue
|
||||
queue.put((
|
||||
'intro.svg',
|
||||
str(event['id'])+".dv",
|
||||
introFrames,
|
||||
{
|
||||
queue.put(Rendertask(
|
||||
infile = 'intro.svg',
|
||||
outfile = str(event['id'])+".dv",
|
||||
sequence = introFrames,
|
||||
parameters = {
|
||||
'$id': event['id'],
|
||||
'$title': event['title'],
|
||||
'$subtitle': event['subtitle'],
|
||||
|
@ -134,15 +134,15 @@ def tasks(queue):
|
|||
))
|
||||
|
||||
# place a task for the outro into the queue
|
||||
queue.put((
|
||||
'outro.svg',
|
||||
'outro.dv',
|
||||
outroFrames
|
||||
queue.put(Rendertask(
|
||||
infile = 'outro.svg',
|
||||
outfile = 'outro.dv',
|
||||
sequence = outroFrames
|
||||
))
|
||||
|
||||
# place the pause-sequence into the queue
|
||||
queue.put((
|
||||
'pause.svg',
|
||||
'pause.dv',
|
||||
pauseFrames
|
||||
queue.put(Rendertask(
|
||||
infile = 'pause.svg',
|
||||
outfile = 'pause.dv',
|
||||
sequence = pauseFrames
|
||||
))
|
||||
|
|
|
@ -186,3 +186,15 @@ def tasks(queue):
|
|||
outfile = 'pause.dv',
|
||||
sequence = pauseFrames
|
||||
))
|
||||
|
||||
def ticket(ticket):
|
||||
return Rendertask(
|
||||
infile = 'intro.svg',
|
||||
sequence = introFrames,
|
||||
parameters = {
|
||||
'$id': ticket['Fahrplan.ID'],
|
||||
'$title': ticket.get('Fahrplan.Title'),
|
||||
'$subtitle': ticket.get('Fahrplan.Subtitle'),
|
||||
'$personnames': ticket.get('Fahrplan.Person_list')
|
||||
}
|
||||
)
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#!/usr/bin/python
|
||||
# -*- coding: UTF-8 -*-
|
||||
|
||||
from renderlib import *
|
||||
|
||||
# URL to Schedule-XML
|
||||
scheduleUrl = 'https://ep2014.europython.eu/schedule.frab.xml'
|
||||
|
@ -65,32 +66,21 @@ def debug():
|
|||
}
|
||||
)
|
||||
|
||||
# render(
|
||||
# 'outro.svg',
|
||||
# '../outro.dv',
|
||||
# outroFrames
|
||||
# )
|
||||
|
||||
# render('pause.svg',
|
||||
# '../pause.dv',
|
||||
# pauseFrames
|
||||
# )
|
||||
|
||||
def tasks(queue):
|
||||
uid = []
|
||||
# iterate over all events extracted from the schedule xml-export
|
||||
for event in events():
|
||||
for event in events(scheduleUrl):
|
||||
if event['id'] in uid:
|
||||
continue
|
||||
|
||||
uid.append(event['id'])
|
||||
|
||||
# generate a task description and put them into the queue
|
||||
queue.put((
|
||||
'intro.svg',
|
||||
str(event['id'])+".dv",
|
||||
pyconFrames,
|
||||
{
|
||||
queue.put(Rendertask(
|
||||
infile = 'intro.svg',
|
||||
outfile = str(event['id'])+".dv",
|
||||
sequence = pyconFrames,
|
||||
parameters = {
|
||||
'$id': event['id'],
|
||||
'$title': event['title'],
|
||||
'$subtitle': event['subtitle'],
|
||||
|
@ -98,16 +88,14 @@ def tasks(queue):
|
|||
}
|
||||
))
|
||||
|
||||
# # place a task for the outro into the queue
|
||||
# queue.put((
|
||||
# 'outro.svg',
|
||||
# 'outro.dv',
|
||||
# outroFrames
|
||||
# ))
|
||||
|
||||
# # place the pause-sequence into the queue
|
||||
# queue.put((
|
||||
# 'pause.svg',
|
||||
# 'pause.dv',
|
||||
# pauseFrames
|
||||
# ))
|
||||
def ticket(ticket):
|
||||
return Rendertask(
|
||||
infile = 'intro.svg',
|
||||
sequence = introFrames,
|
||||
parameters = {
|
||||
'$id': ticket['Fahrplan.ID'],
|
||||
'$title': ticket.get('Fahrplan.Title'),
|
||||
'$subtitle': ticket.get('Fahrplan.Subtitle'),
|
||||
'$personnames': ticket.get('Fahrplan.Person_list')
|
||||
}
|
||||
)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/python
|
||||
# -*- coding: UTF-8 -*-
|
||||
#!/usr/bin/python3
|
||||
|
||||
from renderlib import *
|
||||
import math
|
||||
|
||||
def pauseFrames():
|
||||
|
@ -34,20 +34,20 @@ def debug():
|
|||
|
||||
def tasks(queue):
|
||||
# place the pause-sequence into the queue
|
||||
queue.put((
|
||||
'pause.svg',
|
||||
'pause.dv',
|
||||
pauseFrames
|
||||
queue.put(Rendertask(
|
||||
infile = 'pause.svg',
|
||||
outfile = 'pause.dv',
|
||||
sequence = pauseFrames
|
||||
))
|
||||
|
||||
queue.put((
|
||||
'nostream.svg',
|
||||
'nostream.dv',
|
||||
pauseFrames
|
||||
queue.put(Rendertask(
|
||||
infile = 'nostream.svg',
|
||||
outfile = 'nostream.dv',
|
||||
sequence = pauseFrames
|
||||
))
|
||||
|
||||
queue.put((
|
||||
'novideo.svg',
|
||||
'novideo.dv',
|
||||
pauseFrames
|
||||
queue.put(Rendertask(
|
||||
infile = 'novideo.svg',
|
||||
outfile = 'novideo.dv',
|
||||
sequence = pauseFrames
|
||||
))
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/python
|
||||
# -*- coding: UTF-8 -*-
|
||||
#!/usr/bin/python3
|
||||
|
||||
from renderlib import *
|
||||
import math
|
||||
|
||||
# URL to Schedule-XML
|
||||
|
@ -139,14 +139,14 @@ def debug():
|
|||
|
||||
def tasks(queue):
|
||||
# iterate over all events extracted from the schedule xml-export
|
||||
for event in events():
|
||||
for event in events(scheduleUrl):
|
||||
|
||||
# generate a task description and put them into the queue
|
||||
queue.put((
|
||||
'intro.svg',
|
||||
str(event['id'])+".dv",
|
||||
introFrames,
|
||||
{
|
||||
queue.put(Rendertask(
|
||||
infile = 'intro.svg',
|
||||
outfile = str(event['id'])+".dv",
|
||||
sequence = introFrames,
|
||||
parameters = {
|
||||
'$id': event['id'],
|
||||
'$title': event['title'],
|
||||
'$subtitle': event['subtitle'],
|
||||
|
@ -155,15 +155,27 @@ def tasks(queue):
|
|||
))
|
||||
|
||||
# place a task for the outro into the queue
|
||||
queue.put((
|
||||
'outro.svg',
|
||||
'outro.dv',
|
||||
outroFrames
|
||||
queue.put(Rendertask(
|
||||
infile = 'outro.svg',
|
||||
outfile = 'outro.dv',
|
||||
sequence = outroFrames
|
||||
))
|
||||
|
||||
# place the pause-sequence into the queue
|
||||
queue.put((
|
||||
'pause.svg',
|
||||
'pause.dv',
|
||||
pauseFrames
|
||||
queue.put(Rendertask(
|
||||
infile = 'pause.svg',
|
||||
outfile = 'pause.dv',
|
||||
sequence = pauseFrames
|
||||
))
|
||||
|
||||
def ticket(ticket):
|
||||
return Rendertask(
|
||||
infile = 'intro.svg',
|
||||
sequence = introFrames,
|
||||
parameters = {
|
||||
'$id': ticket['Fahrplan.ID'],
|
||||
'$title': ticket.get('Fahrplan.Title'),
|
||||
'$subtitle': ticket.get('Fahrplan.Subtitle'),
|
||||
'$personnames': ticket.get('Fahrplan.Person_list')
|
||||
}
|
||||
)
|
||||
|
|
Loading…
Add table
Reference in a new issue