OSDN Git Service

fix chscan.
[rec10/rec10-git.git] / rec10 / trunk / src / chdata.py
1 #!/usr/bin/python\r
2 # coding: UTF-8\r
3 # Rec10 TS Recording Tools\r
4 # Copyright (C) 2009-2010 Yukikaze\r
5 import os.path\r
6 import configreader\r
7 import xml.dom.minidom\r
8 import scan_ch\r
9 \r
10 import rec10d\r
11 \r
12 path = str(os.path.dirname(os.path.abspath(__file__))) + "/"\r
13 \r
14 def chAdd(bctype, chtxt, ch, csch):#すべて文字列\r
15     rec10d.rec10db.add_epg_ch(bctype,chtxt, ch, csch, u"2010-01-01 00:00:00")\r
16 def addCHlist(cl):\r
17     if len(cl)>0:\r
18         for c in cl:\r
19             chAdd(c[0],c[1],c[2],c[3])\r
20 def getChList(xmlpath):\r
21     dom=xml.dom.minidom.parse(file(xmlpath))\r
22     chlist=[]\r
23     for ch in dom.getElementsByTagName('channel'):\r
24         bctype=ch.getAttribute("bctype")\r
25         chd=ch.getAttribute("ch")\r
26         csch=ch.getAttribute("csch")\r
27         chtxt=ch.getAttribute("chtxt")\r
28         ontv=ch.getAttribute("ontvcode")\r
29         chlist.append([bctype,ontv,chtxt,chd,csch])\r
30     return chlist\r
31 if __name__ == "__main__":\r
32     scan_ch.searchCh()\r