Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions src/spi/xml/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -808,6 +808,7 @@ def unmarshall(i, listener=UnmarshallListener()):
#test first for spi 31
SCHEMA_NS = 'http://www.worlddab.org/schemas/spi/31'
namespaces = { "spi" : SCHEMA_NS }
logger.debug('Now parsing the namespace %s', SCHEMA_NS)

if root.tag == '{%s}serviceInformation' % SCHEMA_NS:
return parse_serviceinfo(root, listener)
Expand All @@ -822,6 +823,7 @@ def unmarshall(i, listener=UnmarshallListener()):
#test next for spi 33
SCHEMA_NS = 'http://www.worlddab.org/schemas/spi/33'
namespaces = { "spi" : SCHEMA_NS }
logger.debug('Now parsing the namespace %s', SCHEMA_NS)

if root.tag == '{%s}serviceInformation' % SCHEMA_NS:
return parse_serviceinfo(root, listener)
Expand All @@ -833,6 +835,23 @@ def unmarshall(i, listener=UnmarshallListener()):
else:
raise Exception('epg element does not contain either schedules or programme groups')

#test next for spi 34
SCHEMA_NS = 'http://www.worlddab.org/schemas/spi'
namespaces = { "spi" : SCHEMA_NS }
logger.debug('Now parsing the namespace %s', SCHEMA_NS)

if root.tag == '{%s}serviceInformation' % SCHEMA_NS:
logger.debug('Matched root %s and going into parse', SCHEMA_NS)

return parse_serviceinfo(root, listener)
elif root.tag == '{%s}epg' % SCHEMA_NS:
if len(root.findall("spi:schedule", namespaces)):
return parse_programmeinfo(root, listener)
if len(root.findall("spi:programmeGroups", namespaces)):
return parse_groupinfo(root, listener)
else:
raise Exception('epg element does not contain either schedules or programme groups')



raise Exception('Arrgh! this be neither serviceInformation nor epg - to Davy Jones\' locker with ye!')
Expand Down