OSDN Git Service

add logo search.
[rec10/rec10-git.git] / rec10 / trunk / src / chdata.py
index 97e73cf..861719b 100644 (file)
@@ -1,39 +1,24 @@
 #!/usr/bin/python\r
 # coding: UTF-8\r
 # Rec10 TS Recording Tools\r
-# Copyright (C) 2009-2010 Yukikaze\r
+# Copyright (C) 2009-2011 Yukikaze\r
 import os.path\r
 import configreader\r
 import xml.dom.minidom\r
+import scan_ch\r
+import datetime\r
 \r
 import rec10d\r
 \r
 path = str(os.path.dirname(os.path.abspath(__file__))) + "/"\r
 \r
 def chAdd(bctype, chtxt, ch, csch):#すべて文字列\r
-    rec10d.rec10db.add_epg_ch(bctype,chtxt, ch, csch, u"2010-01-01 00:00:00")\r
+    tnow=datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")\r
+    rec10d.rec10db.add_epg_ch(bctype,chtxt, ch, csch, u"2010-01-01 00:00:00",u"2010-01-01 00:00:00",tnow)\r
 def addCHlist(cl):\r
     if len(cl)>0:\r
         for c in cl:\r
             chAdd(c[0],c[1],c[2],c[3])\r
-def newChdata(bs,cs):\r
-    rec10d.rec10db.new_epg_ch()\r
-    addCHlist(getCHlist(os.path.join(path,"chlist.xml")))\r
-    if bs==1:\r
-        #bs放送の設定 全国共通のはず\r
-        addCHlist(getCHlist(os.path.join(path,"chlist_bs.xml")))\r
-    if cs==1:\r
-        #CS放送(スカパーe2)主に基本パックに入ってるものを中心に\r
-        chlistadd(getChList(os.path.join(path,"chlist_cs.xml")))\r
-def newChdataAll():\r
-    bs=0\r
-    cs=0\r
-    try:\r
-        bs=int(configreader.getConfEnv("bs"))\r
-        cs=int(configreader.getConfEnv("cs"))\r
-    except:\r
-        ""\r
-    newChdata(bs,cs)\r
 def getChList(xmlpath):\r
     dom=xml.dom.minidom.parse(file(xmlpath))\r
     chlist=[]\r
@@ -45,5 +30,8 @@ def getChList(xmlpath):
         ontv=ch.getAttribute("ontvcode")\r
         chlist.append([bctype,ontv,chtxt,chd,csch])\r
     return chlist\r
+def deleteChListALL():\r
+    rec10d.rec10db.new_epg_ch()\r
 if __name__ == "__main__":\r
-    newChdataAll()\r
+    deleteChListALL()\r
+    scan_ch.searchCh()\r