3 # Rec10 TS Recording Tools
4 # Copyright (C) 2009-2011 Yukikaze
5 #import sys # モジュール属性 argv を取得するため
16 def writeEpgXML(pout, ch):
18 tsを取得してepgの入ったxmlとして書き出す
21 if re.search(u'CS', ch):
25 writeEpgXMLTime(pout, ch ,timet)
26 def writeLogoEpgXML(pout, ch):
28 tsを取得してepgの入ったxmlとして書き出す
31 if re.search(u'CS', ch):
35 writeEpgXMLTime(pout, ch ,timet,islogo=1)
36 def writeEpgXMLTime(pout, ch ,times,islogo=0):
38 指定された時間分tsを取得してepgの入ったxmlとして書き出す
41 recdblist.addCommonlogEX(u"通常","write_time(ts2epg.py)",u"Ts-EPG XML書き出し処理開始" ,u"CH:"+ch,log_level=500)
43 recdblist.addCommonlogEX(u"通常","write_time(ts2epg.py)",u"Ts-EPG LOGO : XML書き出し処理開始" ,u"CH:"+ch,log_level=500)
45 if re.search(u'CS', ch):
50 mode = str(chdb.searchCHFromBctype(u'te' + ch)['ch'])
51 epgdump = configreader.getConfPath("epgdump")
52 if os.access(pout + ".ts", os.F_OK):
53 os.remove(pout + ".ts")
55 tv2ts.tv2b25ts(pout+ ".ts", ch, times,"0")
59 os.chmod(pout+".ts",0755)
60 exe = "export LANG=ja_JP.UTF-8 && nice -n 15 " + epgdump + " " +logoopt+ mode + " " + pout + ".ts " + pout
61 recdblist.printutf8(exe)
62 recdblist.addCommonlogEX(u"通常", "write_time(ts2epg.py) "+str(ch), exe,"",log_level=500)
63 unicode(commands.getoutput(exe),'utf-8','ignore')
65 if os.path.exists(pout+".ts"):
66 os.remove(pout+ ".ts")