X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=rec10%2Ftrunk%2Fsrc%2Fxml2db_dom.py;h=53bf75f0ebb764e05ad025cf83012ab020f6b588;hb=50efa7246fc3a6ffc71860772658ee90a0243eab;hp=0b0374ebb527f3e1b54f3a468ed97c0a265c7f55;hpb=b7f05edd7c1919a4ec275acc593f8eb9296e3399;p=rec10%2Frec10-git.git diff --git a/rec10/trunk/src/xml2db_dom.py b/rec10/trunk/src/xml2db_dom.py index 0b0374e..53bf75f 100644 --- a/rec10/trunk/src/xml2db_dom.py +++ b/rec10/trunk/src/xml2db_dom.py @@ -38,6 +38,12 @@ def writeMultiTVDB(bctype,tvlists): def writeMultiCHDB(chlists): for chtxt,dn in chlists: rec10d.rec10db.update_chname_by_chtxt_epg_ch(chtxt,dn) +def writeMultiLogoDB(logolists): + #[type,sv,pngdata] + for type,sv,pngdata in logolists: + chtxt=chdb.searchCHFromCsch(sv) + if len(chtxt)>0: + rec10d.rec10db.change_visible_epg_ch(chtxt,type,pngdata) def xml2db_dom(xmlpath, bctype):#bctypeは放送種別で'TE'(地デジ)BS,CSがある。地デジの場合は te数字 が入る dtb=datetime.datetime.now() dom=xml.dom.minidom.parse(file(xmlpath)) @@ -108,6 +114,21 @@ def xml2db_dom(xmlpath, bctype):#bctypeは放送種別で'TE'(地デジ)BS,CSが dtb=datetime.datetime.now()-dtb recdblist.printutf8(bctype + u" epg取り出し終了") recdblist.printutf8(str(dtb.days * 24 * 60 * 60 + dtb.seconds)+u"seconds taken for updating bayes-auto DB .") +def xml2db_dom_logo(xmlpath, bctype):#bctypeは放送種別で'TE'(地デジ)BS,CSがある。地デジの場合は te数字 が入る + dtb=datetime.datetime.now() + dom=xml.dom.minidom.parse(file(xmlpath)) + logolist=[] + for logo in dom.getElementsByTagName('logo'): + type=int(logo.getAttribute("type")) + sv=logo.getAttribute("sv") + pngdata=logo.childNodes[0].data + logolist.append([type,sv,pngdata]) + dom.unlink() + if len(logolist) > 0: + writeMultiLogoDB(logolist) + dtb=datetime.datetime.now()-dtb + recdblist.printutf8(bctype + u" epg取り出し終了") + recdblist.printutf8(str(dtb.days * 24 * 60 * 60 + dtb.seconds)+u"seconds taken for updating logo DB .") def addTitle_Subtitle(recompiled,num,title,exp): try: tST=recompiled.match(exp)