OSDN Git Service

test auto guess program_number function.
[rec10/rec10-git.git] / rec10 / trunk / src / ts2epg.py
index 52c111e..f1f7243 100644 (file)
@@ -1,7 +1,7 @@
 #!/usr/bin/python
 # coding: UTF-8
 # Rec10 TS Recording Tools
-# Copyright (C) 2009 Yukikaze
+# Copyright (C) 2009-2010 Yukikaze
 #import sys # モジュール属性 argv を取得するため
 import os
 import re
@@ -16,16 +16,23 @@ def write(pout, ch):
     """
     tsを取得してepgの入ったxmlとして書き出す
     """
-    recdblist.printutf8(u"Ts-EPG XML書き出し処理開始")
-    bctype = chdb.chsearch(ch)['bctype']
-    recdblist.printutf8(ch + ":" + bctype)
     timet = "90"
-    if re.search(u'cs', bctype):
-        mode = "/CS"
+    if re.search(u'CS', ch):
         timet = "180"
-    elif re.search(u'bs', bctype):
-        mode = "/BS"
+    elif len(ch)>2:
         timet = "240"
+    write_time(pout, ch ,timet)
+def write_time(pout, ch ,times):
+    """
+    指定された時間分tsを取得してepgの入ったxmlとして書き出す
+    """
+    recdblist.printutf8(u"Ts-EPG XML書き出し処理開始")
+    recdblist.printutf8(u"CH:"+ch)
+    timet = times
+    if re.search(u'CS', ch):
+        mode = "/CS"
+    elif len(ch)>2:
+        mode = "/BS"
     else:
         mode = chdb.bctypesearch(u'te' + ch)['ontv']
     epgdump = configreader.getpath("epgdump")
@@ -37,5 +44,4 @@ def write(pout, ch):
     recdblist.printutf8(exe)
     os.system(exe)
     time.sleep(10)
-