3 # Rec10 TS Recording Tools
\r
4 # Copyright (C) 2009-2010 Yukikaze
\r
7 import xml.dom.minidom
\r
11 path = str(os.path.dirname(os.path.abspath(__file__))) + "/"
\r
13 def chAdd(bctype, chtxt, ch, csch):#すべて文字列
\r
14 rec10d.rec10db.add_epg_ch(bctype,chtxt, ch, csch, u"2010-01-01 00:00:00")
\r
18 chAdd(c[0],c[1],c[2],c[3])
\r
19 def newChdata(bs,cs):
\r
20 rec10d.rec10db.new_epg_ch()
\r
21 addCHlist(getCHlist(os.path.join(path,"chlist.xml")))
\r
24 addCHlist(getCHlist(os.path.join(path,"chlist_bs.xml")))
\r
26 #CS放送(スカパーe2)主に基本パックに入ってるものを中心に
\r
27 chlistadd(getChList(os.path.join(path,"chlist_cs.xml")))
\r
32 bs=int(configreader.getConfEnv("bs"))
\r
33 cs=int(configreader.getConfEnv("cs"))
\r
37 def getChList(xmlpath):
\r
38 dom=xml.dom.minidom.parse(file(xmlpath))
\r
40 for ch in dom.getElementsByTagName('channel'):
\r
41 bctype=ch.getAttribute("bctype")
\r
42 chd=ch.getAttribute("ch")
\r
43 csch=ch.getAttribute("csch")
\r
44 chtxt=ch.getAttribute("chtxt")
\r
45 ontv=ch.getAttribute("ontvcode")
\r
46 chlist.append([bctype,ontv,chtxt,chd,csch])
\r
48 if __name__ == "__main__":
\r