[hbbtv] upgraded.
[vuplus_dvbapp] / lib / python / Plugins / Extensions / HbbTV / aitreader.py
old mode 100755 (executable)
new mode 100644 (file)
index f2c2195..757b0f3
@@ -1,7 +1,9 @@
 import os, xml.dom.minidom
 from enigma import iServiceInformation
 
-DUMPBIN = "/usr/lib/enigma2/python/Plugins/Extensions/HbbTV/dumpait"
+import vbcfg
+
+DUMPBIN = vbcfg.PLUGINROOT + "/dumpait"
 class eAITSectionReader:
        def __init__(self, demux, pmtid, sid):
                self.mVuplusBox = False
@@ -39,7 +41,6 @@ class eAITSectionReader:
                        item["orgid"]   = int(self.__item(application, "orgid"))
                        item["appid"]   = int(self.__item(application, "appid"))
                        item["profile"] = int(self.__item(application, "profile"))
-               #print item
                return item
 
        def doParseApplications(self):
@@ -67,13 +68,16 @@ class eAITSectionReader:
                document = ""
                try:    document = os.popen(self.mCommand).read()
                except Exception, ErrMsg:
-                       print ErrMsg
+                       vbcfg.ERR(ErrMsg)
                        return False
                if len(document) == 0:
                        return False
                document = document.decode("cp1252").encode("utf-8")
-               #print document
-               self.mDocument = xml.dom.minidom.parseString(document)
+               try:
+                       self.mDocument = xml.dom.minidom.parseString(document)
+               except Exception, ErrMsg:
+                       vbcfg.ERR("XML parse: %s" % ErrMsg)
+                       return False
                return True
 
        def doDump(self):
@@ -91,7 +95,8 @@ def unit_test(demux, pmtid, sid):
        if reader.doOpen():
                reader.doParseApplications()
                reader.doDump()
-       else:   print "no data!!"
+       else:
+               vbcfg.ERR("no data!!")
 
 #unit_test('0', 0x17d4, 0x2b66)