[Debconf-video-commits] r730 - package/trunk/src/prerolls

Holger Levsen holger at alioth.debian.org
Sun Nov 6 21:57:28 UTC 2011


Author: holger
Date: 2011-11-06 21:57:27 +0000 (Sun, 06 Nov 2011)
New Revision: 730

Modified:
   package/trunk/src/prerolls/xml2preroll.py
Log:
s##

Modified: package/trunk/src/prerolls/xml2preroll.py
===================================================================
--- package/trunk/src/prerolls/xml2preroll.py	2011-11-06 16:41:49 UTC (rev 729)
+++ package/trunk/src/prerolls/xml2preroll.py	2011-11-06 21:57:27 UTC (rev 730)
@@ -5,11 +5,13 @@
 import lxml.etree
 from subprocess import Popen
 
-rohdaten = urllib.urlopen("http://penta.debconf.org/dc11_schedule/schedule.en.xml").read()
-#daten = unicode(rohdaten, "latin1")
-daten = rohdaten
-root = lxml.etree.fromstring(daten).getroottree()
+print "apt-get install python-argparse ttf-prociono ffmpeg"
 
+rawdata = urllib.urlopen("http://penta.debconf.org/dc11_schedule/schedule.en.xml").read()
+#data = unicode(rawdata, "latin1")
+data = rawdata
+root = lxml.etree.fromstring(data).getroottree()
+
 SCRIPT_FULLPATH = "genPreroll.py"
 
 def call_genPreroll(info):
@@ -50,14 +52,14 @@
     if returncode != 0:
         print "returncode %d != 0 for %r" % (returncode, command)
 
-def daten_von_event(event, upper_info):
+def data_from_event(event, upper_info):
     info = upper_info.copy()
     info["id"] = event.get("id")
     things = "start room title subtitle".split(" ")
     for thing in things:
-        thing_tag = event.find(thing)
-        if thing_tag is None:
-            print "ERROR: no tag %s in %r" % (thing, event)
+        thing_day = event.find(thing)
+        if thing_day is None:
+            print "ERROR: no day %s in %r" % (thing, event)
         else:
             if event.find(thing).text is not None:
                 info[thing] = event.find(thing).text
@@ -69,23 +71,23 @@
 
     call_genPreroll(info)
 
-def daten_von_raum(raum, upper_info):
+def data_from_raum(raum, upper_info):
     info = upper_info.copy()
     info["name"] = raum.get("name")
     for event in list(raum):
-        daten_von_event(event, info)
+        data_from_event(event, info)
 
-def daten_von_tag(tag):
+def data_from_day(day):
     info = {}
-    info["date"] = tag.get("date")
-    info["index"] = tag.get("index")
-    for raum in list(tag):
-        daten_von_raum(raum, info)
+    info["date"] = day.get("date")
+    info["index"] = day.get("index")
+    for raum in list(day):
+        data_from_raum(raum, info)
 
-def daten_von_schedule(schedule):
-    for tag in schedule.xpath("day"):
-        daten_von_tag(tag)
+def data_from_schedule(schedule):
+    for day in schedule.xpath("day"):
+        data_from_day(day)
 
-daten_von_schedule(root)
+data_from_schedule(root)
 
 




More information about the Debconf-video-commits mailing list