OSDN Git Service

fix installer
[rec10/rec10-git.git] / rec10 / trunk / src / scan_ch.py
index a7d30cb..f2fc62a 100644 (file)
@@ -82,12 +82,19 @@ def searchCh():
             addCh("CS24","cs2","CS")
         rec10d.rec10db.change_installed_in_status(100)
 def checkTs(ch):
+    if os.path.exists(os.path.join(tmppath,"ch_"+str(ch)+".ts")):
+        os.remove(os.path.join(tmppath,"ch_"+str(ch)+".ts"))
+    if os.path.exists(os.path.join(tmppath,"ch_"+str(ch)+".ts.b25")):
+        os.remove(os.path.join(tmppath,"ch_"+str(ch)+".ts.b25"))
     tv2ts.tv2b25ts(os.path.join(tmppath,"ch_"+str(ch)+".ts"), ch, "1")
+    if os.path.exists(os.path.join(tmppath,"ch_"+str(ch)+".ts.b25")):
+        os.remove(os.path.join(tmppath,"ch_"+str(ch)+".ts.b25"))
     if os.path.exists(os.path.join(tmppath,"ch_"+str(ch)+".ts")):
         os.remove(os.path.join(tmppath,"ch_"+str(ch)+".ts"))
         return 1
     else:
         return 0
+
 def addCh(ch,bctype,chtxthead):
     prglist=getChProgNum(ch)##[prglist,logt]
     for lstr in prglist[0]:
@@ -108,13 +115,16 @@ def getChProgNum(ch):
     pout=os.path.join(tmppath,"ch_"+str(ch)+".ts")
     logt=tv2ts.tv2tsmix(pout, ch, "10")
     retl=getTsProgNum(ch,pout)
-    os.remove(pout)
+    try:
+        os.remove(pout)
+    except:
+        ""
     return [retl,logt]
 def getTsProgNum(ch,tspath):
     pin=tspath
     pout=os.path.join(tmppath,"chscan.txt")
     chopt="-ch"
-    if ch.find("CS")>-1 or ch.find("BS"):
+    if ch.find("CS")>-1 or ch.find("BS")>-1 :
         chopt="-cs"
     elif int(ch)>99:
         chopt="-bs"
@@ -139,7 +149,7 @@ def getTsProgNum(ch,tspath):
     time.sleep(1)
     try:
         ""
-        #os.remove(pout)
+        os.remove(pout)
     except:
         ""
     return ret