OSDN Git Service

fix schedule bugs.
authorgn64_jp <gn64_jp@4e526526-5e11-4fc0-8910-f8fd03428081>
Sun, 12 Jul 2009 23:55:28 +0000 (23:55 +0000)
committergn64_jp <gn64_jp@4e526526-5e11-4fc0-8910-f8fd03428081>
Sun, 12 Jul 2009 23:55:28 +0000 (23:55 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/rec10@69 4e526526-5e11-4fc0-8910-f8fd03428081

rec10/trunk/src/chdb.py
rec10/trunk/src/dbviewer.py
rec10/trunk/src/recdb.py
rec10/trunk/src/timerec.py
rec10/trunk/src/ts2epg.py

index 9b3e06b..bdbcaef 100644 (file)
@@ -63,22 +63,22 @@ def update():
     CS2update=0
     BSupdate=0
     for bctype , chtxt in db.execute("SELECT bctype,chtxt FROM chdata WHERE updatetime < datetime(\'now\',\'localtime\',\'-6 hours\')"):
-        #print bctype
-        if bctype=="cs":
+        print bctype
+        if bctype=="cs" or bctype==u"cs":
             if CSupdate==0:
-                ret.append("cs")
+                ret.append(u"cs")
                 CSupdate=1
                 print "csの番組表取得開始"
                 db.execute("UPDATE chdata SET updatetime=datetime(\'now\',\'localtime\') WHERE bctype = \""+bctype+"\"")
-        if bctype=="cs2":
+        elif bctype=="cs2" or bctype==u"cs2":
             if CS2update==0:
-                ret.append("cs2")
-                CSupdate=1
-                print "csの番組表取得開始"
+                ret.append(u"cs2")
+                CS2update=1
+                print "cs2の番組表取得開始"
                 db.execute("UPDATE chdata SET updatetime=datetime(\'now\',\'localtime\') WHERE bctype = \""+bctype+"\"")
-        elif bctype=="bs":
+        elif bctype=="bs" or bctype==u"bs":
             if BSupdate==0:
-                ret.append("bs")
+                ret.append(u"bs")
                 BSupdate=1
                 print "bsの番組表取得開始"
                 db.execute("UPDATE chdata SET updatetime=datetime(\'now\',\'localtime\') WHERE bctype = \""+bctype+"\"")
index eade363..6e7036b 100644 (file)
@@ -12,7 +12,7 @@ db=sqlite3.connect(dbpath)
 
 print "チャンネルデータ"
 for bctype, ontv, chtxt, ch, csch ,updatetime in db.execute("SELECT bctype,ontv,chtxt,ch,csch,updatetime FROM chdata"):
-    print (bctype+","+ontv+","+chtxt+","+ch+","+csch+","+updatetime)
+    print {"txt":bctype+","+ontv+","+chtxt+","+ch+","+csch+","+updatetime,"ch":ch}
 db.close()
 print "録画予約"
 for task in tasks:
index 0cc6323..0c0f3a7 100644 (file)
@@ -139,6 +139,10 @@ def getnow(dhour):
         ret['btime']=btime
         ret['etime']=etime
         ret['opt']=opt
+        if deltatime==None or deltatime=="":
+            deltatime="3"
+        if deltaday==None or deltaday=="":
+            deltaday="7"
         if typet=='key':
             ret['deltatime']=deltatime
         elif typet=='keyevery':
index c4728ec..36dbe41 100644 (file)
@@ -26,7 +26,7 @@ def task():
     tasks=recdb.getnow("1")
     if len(tasks)==0:
         update=chdb.update()
-        print "番組表更新処理"
+        #print "番組表更新処理"
         print update
         if len(update)>0:
             print "番組表を更新"
index e9be5d9..22850f1 100644 (file)
@@ -18,21 +18,27 @@ def write(pout,ch):
     bctype=chdb.chsearch(ch)['bctype']
     print ch+":"+bctype
     timet="120"
-    if re.search('cs',bctype):
+    if re.search(u'cs',bctype):
         mode="/CS"
         timet="300"
-    elif re.search('bs',bctype):
+    elif re.search(u'bs',bctype):
         mode="/BS"
         timet="300"
     else :
-        mode=chdb.bctypesearch('te'+ch)['ontv']
+        mode=chdb.bctypesearch(u'te'+ch)['ontv']
     tsepg2xml=configreader.getpath("tsepg2xml")
     epgdump=configreader.getpath("epgdump")
     time.sleep(5)
+    print type(ch)
+    print ch
     tv2ts.tv2tsmix(pout+".ts",ch,"180")
-    if not os.access(pout+".ts", os.F_OK):
+    t=0
+    while not os.access(pout+".ts", os.F_OK):
         time.sleep(10)
         tv2ts.tv2tsmix(pout+".ts",ch,"180")
+        t=t+1
+        if t>10:
+            break
     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
     print exe