for o in obj:
rc=rc+getText(o)
return rc
-def writemultitvDB(bctype,tvlists):
+def writeMultiTVDB(bctype,tvlists):
rec10d.rec10db.new_epg_timeline(bctype)
for channel,start,stop,title,desc,longdesc,category in tvlists:
rec10d.rec10db.add_epg_timeline(bctype, channel, start, stop, title, desc, longdesc, category)
-def writemultichDB(chlists):
+def writeMultiCHDB(chlists):
for chtxt,dn in chlists:
rec10d.rec10db.update_chname_by_chtxt_epg_ch(chtxt,dn)
def xml2db_dom(xmlpath, bctype):#bctypeは放送種別で'TE'(地デジ)BS,CSがある。地デジの場合は te数字 が入る
longdesc=zenhan.toHankaku_ABC123(getText_item(tv.getElementsByTagName("longdesc")))
category=zenhan.toHankaku_ABC123(getText_item(tv.getElementsByTagName("category")))
title=addTitle_Subtitle(rHisch,1,title,desc)
- tch=chdb.chtxtsearch(channel)
+ tch=chdb.searchFromCHtxt(channel)
if tch!=None:
if tch.get('bctype',"")==bctype:
bt=bayes.get(tch['chtxt'],["","",0])
bt2=[bt[0]+title+" ",bt[1]+desc+" "+longdesc+" ",bt[2]+1]
bayes[tch['chtxt']]=bt2
tvlist.append([channel,start,stop,title,desc,longdesc,category])
- p=auto_rec.calc_key(tch['chtxt'], title,desc+" "+longdesc)
+ p=auto_rec.calcKey(tch['chtxt'], title,desc+" "+longdesc)
if p>2000:
bttt=datetime.datetime.strptime(start,"%Y%m%d%H%M%S")
bttt=bttt-datetime.timedelta(seconds=1200)
maxnum=0
if len(ch['ch'])>2:
maxnum=epgdb.count_schedule_timeline(bttime, ettime)[1]
- maxnum=int(configreader.getenv("bscs_max"))-maxnum
+ maxnum=int(configreader.getEnvSetting("bscs_max"))-maxnum
else:
maxnum=epgdb.count_schedule_timeline(bttime, ettime)[0]
- maxnum=int(configreader.getenv("te_max"))-maxnum
+ maxnum=int(configreader.getEnvSetting("te_max"))-maxnum
if maxnum>0:
topt=status.getSettings_auto_opt()
recdb.recreserv(title,tch['chtxt'], bttime, ettime,topt)
dom.unlink()
if len(chlist) > 0:
- writemultichDB(chlist)
+ writeMultiCHDB(chlist)
chlist = []
if len(tvlist) > 0:
- writemultitvDB(bctype,tvlist)
+ writeMultiTVDB(bctype,tvlist)
tvlist = []
for ct,list in bayes.items():
- auto_rec.update_recall(ct,list[0],list[1],list[2])
- auto_rec.update_recall("ALL",list[0],list[1],list[2])
+ auto_rec.updateRecall(ct,list[0],list[1],list[2])
+ auto_rec.updateRecall("ALL",list[0],list[1],list[2])
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 .")
else:
newtitle=title
except Exception, inst:
- recdblist.Commonlogex("Error", "addTitle_Subtitle(xml2db_dob.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
+ recdblist.addCommonlogEX("Error", "addTitle_Subtitle(xml2db_dob.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
newtitle=title
return newtitle
\ No newline at end of file