OSDN Git Service

implement mysql function.(RC1)
[rec10/rec10-git.git] / rec10 / trunk / src / ts2epg.py
index e9be5d9..31fd10d 100644 (file)
@@ -17,26 +17,32 @@ def write(pout,ch):
     print "ts2epg処理"
     bctype=chdb.chsearch(ch)['bctype']
     print ch+":"+bctype
-    timet="120"
-    if re.search('cs',bctype):
+    timet="90"
+    if re.search(u'cs',bctype):
         mode="/CS"
-        timet="300"
-    elif re.search('bs',bctype):
+        timet="200"
+    elif re.search(u'bs',bctype):
         mode="/BS"
-        timet="300"
+        timet="150"
     else :
-        mode=chdb.bctypesearch('te'+ch)['ontv']
-    tsepg2xml=configreader.getpath("tsepg2xml")
+        mode=chdb.bctypesearch(u'te'+ch)['ontv']
     epgdump=configreader.getpath("epgdump")
-    time.sleep(5)
-    tv2ts.tv2tsmix(pout+".ts",ch,"180")
-    if not os.access(pout+".ts", os.F_OK):
+    if os.access(pout+".ts", os.F_OK):
+        os.remove(pout+".ts")
+    time.sleep(10)
+    print type(ch)
+    print ch
+    tv2ts.tv2tsmix(pout+".ts",ch,timet)
+    t=0
+    while not os.access(pout+".ts", os.F_OK):
         time.sleep(10)
-        tv2ts.tv2tsmix(pout+".ts",ch,"180")
-    exe="export LANG=ja_JP.UTF-8 && /usr/bin/nice -n 19 wine "+tsepg2xml+" "+mode+" "+pout+".ts >"+pout
-    #exe="export LANG=ja_JP.UTF-8 && /usr/bin/nice -n 19 "+epgdump+" "+mode+" "+pout+".ts "+pout
+        tv2ts.tv2tsmix(pout+".ts",ch,timet)
+        t=t+1
+        if t>10:
+            break
+    exe="export LANG=ja_JP.UTF-8 && /usr/bin/nice -n 15 "+epgdump+" "+mode+" "+pout+".ts "+pout
     print exe
     os.system(exe)
-
+    time.sleep(10)