OSDN Git Service

add epgrefresh exeable py file.
authorgn64_jp <gn64_jp@4e526526-5e11-4fc0-8910-f8fd03428081>
Thu, 25 Jun 2009 11:02:30 +0000 (11:02 +0000)
committergn64_jp <gn64_jp@4e526526-5e11-4fc0-8910-f8fd03428081>
Thu, 25 Jun 2009 11:02:30 +0000 (11:02 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/rec10@56 4e526526-5e11-4fc0-8910-f8fd03428081

rec10/trunk/src/epgrefresh.py [new file with mode: 0755]
rec10/trunk/src/ts2epg.py

diff --git a/rec10/trunk/src/epgrefresh.py b/rec10/trunk/src/epgrefresh.py
new file mode 100755 (executable)
index 0000000..11fdbcf
--- /dev/null
@@ -0,0 +1,24 @@
+#!/usr/bin/python
+# coding: UTF-8
+# Rec10 TS Recording Tools
+# Copyright (C) 2009 Yukikaze
+import chdb
+import os
+import time
+import epgdb
+
+update=chdb.update()
+print "番組表更新処理"
+print update
+if len(update)>0:
+    print "番組表を更新"
+    print update
+    pid=os.fork()
+    if pid>0:#親プロセスの場合
+        ""
+    else:#子プロセスの場合 アップデートを行って終了
+        for bctype in update:
+            time.sleep(1)
+            print bctype
+            epgdb.updatebc(bctype)
+        sys.exit(0)
\ No newline at end of file
index e9d5b30..040faa1 100644 (file)
@@ -8,7 +8,7 @@ import configreader
 import tv2ts
 import re
 import chdb
-
+import time
 
 def write(pout,ch):
     """
@@ -17,13 +17,13 @@ def write(pout,ch):
     print "ts2epg処理"
     bctype=chdb.chsearch(ch)['bctype']
     print ch+":"+bctype
-    time="120"
+    timet="120"
     if re.search('cs',bctype):
         mode="/CS"
-        time="300"
+        timet="300"
     elif re.search('bs',bctype):
         mode="/BS"
-        time="300"
+        timet="300"
     else :
         mode=chdb.bctypesearch('te'+ch)['ontv']
     tsepg2xml=configreader.getpath("tsepg2xml")