OSDN Git Service

fix to read xml using dom.
[rec10/rec10-git.git] / rec10 / trunk / src / epgdb.py
index 224d232..a8f5357 100644 (file)
@@ -10,7 +10,7 @@ import chdb
 import n_gram
 import rec10d
 import ts2epg
-import xml2db
+import xml2db_dom
 import configreader
 import recdblist
 path = str(os.path.dirname(os.path.abspath(__file__))) + "/"
@@ -28,26 +28,26 @@ def update(chtxt):
     dt = dt.days * 24 * 60 + dt.seconds
     if dt > 2 * 60 * 60:
         ts2epg.write(tmppath + chtxt + "epgdata.xml", chdb.chtxtsearch(chtxt)['ch'])
-        xml2db.xml2db(tmppath + chtxt + "epgdata.xml", chdb.chtxtsearch(chtxt)['bctype'])
+        xml2db_dom.xml2db_dom(tmppath + chtxt + "epgdata.xml", chdb.chtxtsearch(chtxt)['bctype'])
 def updatebc(bctype):
     bctypel = chdb.bctypesearch(bctype)
     print bctype
     try:
         ts2epg.write(tmppath + bctype + "epgdata.xml", chdb.bctypesearch(bctype)['ch'])
-        xml2db.xml2db(tmppath + bctype + "epgdata.xml", bctype)
+        xml2db_dom.xml2db_dom(tmppath + bctype + "epgdata.xml", bctype)
         shutil.copyfile(tmppath + bctype + "epgdata.xml", tmppath + bctype + "epgdata.bak.xml")
         rec10d.rec10db.update_by_bctype_epg_ch(bctype)
     except Exception, inst:
         print "error occurs in updatebc(epgdb)"
         print type(inst)
         print inst
-        xml2db.xml2db(tmppath + bctype + "epgdata.bak.xml", bctype)
+        xml2db_dom.xml2db_dom(tmppath + bctype + "epgdata.bak.xml", bctype)
         rec10d.rec10db.update_status_by_bctype_epg_ch(bctype, "2")
 def updatebc_bak(bctype):
     """
     update epg data by .bak file
     """
-    xml2db.xml2db(tmppath + bctype + "epgdata.bak.xml", bctype)
+    xml2db_dom.xml2db_dom(tmppath + bctype + "epgdata.bak.xml", bctype)
 def searchtime2(titletxt, timet, deltatime, chtxt):
     time = datetime.datetime.strptime(timet, "%Y-%m-%d %H:%M:%S")
     ret = []