OSDN Git Service

fix some bug.
[rec10/rec10-git.git] / rec10 / trunk / src / ts2epg.py
index 22d9bf8..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
@@ -17,22 +17,21 @@ def write(pout, ch):
     tsを取得してepgの入ったxmlとして書き出す
     """
     timet = "90"
-    if re.search(u'cs', bctype):
+    if re.search(u'CS', ch):
         timet = "180"
-    elif re.search(u'bs', bctype):
+    elif len(ch)>2:
         timet = "240"
     write_time(pout, ch ,timet)
-def write_time(pout, ch ,time):
+def write_time(pout, ch ,times):
     """
     指定された時間分tsを取得してepgの入ったxmlとして書き出す
     """
     recdblist.printutf8(u"Ts-EPG XML書き出し処理開始")
-    bctype = chdb.chsearch(ch)['bctype']
-    recdblist.printutf8(ch + ":" + bctype)
-    timet = time
-    if re.search(u'cs', bctype):
+    recdblist.printutf8(u"CH:"+ch)
+    timet = times
+    if re.search(u'CS', ch):
         mode = "/CS"
-    elif re.search(u'bs', bctype):
+    elif len(ch)>2:
         mode = "/BS"
     else:
         mode = chdb.bctypesearch(u'te' + ch)['ontv']