--- /dev/null
+#!/usr/bin/python
+# coding: UTF-8
+# Rec10 TS Recording Tools
+# Copyright (C) 2009 Yukikaze
+#import sys # モジュール属性 argv を取得するため
+import os
+import configreader
+import tv2ts
+import re
+import chdb
+
+
+def write(pout,ch):
+ """
+ tsを取得してepgの入ったxmlとして書き出す
+ """
+ print "ts2epg処理"
+ bctype=chdb.chsearch(ch)['bctype']
+ print ch+":"+bctype
+ time="120"
+ if re.search('cs',bctype):
+ mode="/CS"
+ time="300"
+ elif re.search('bs',bctype):
+ mode="/BS"
+ time="300"
+ else :
+ mode=chdb.bctypesearch('te'+ch)['ontv']
+ tsepg2xml=configreader.getpath("tsepg2xml")
+ tv2ts.tv2tsmix(pout+".ts",ch,"180")
+ exe="export LANG=ja_JP.UTF-8 && /usr/bin/nice -n 19 wine "+tsepg2xml+" "+mode+" "+pout+".ts >"+pout
+ print exe
+ os.system(exe)
+
+
+