OSDN Git Service

stop using trunk directory in rectool
[rec10/rec10-git.git] / rec10 / branches / 0.4 / src / ts2epg.py
1 #!/usr/bin/python
2 # coding: UTF-8
3 # Rec10 TS Recording Tools
4 # Copyright (C) 2009 Yukikaze
5 #import sys # モジュール属性 argv を取得するため
6 import os
7 import configreader
8 import tv2ts
9 import re
10 import chdb
11
12
13 def write(pout,ch):
14     """
15     tsを取得してepgの入ったxmlとして書き出す
16     """
17     print "ts2epg処理"
18     bctype=chdb.chsearch(ch)['bctype']
19     print ch+":"+bctype
20     time="120"
21     if re.search('cs',bctype):
22         mode="/CS"
23         time="300"
24     elif re.search('bs',bctype):
25         mode="/BS"
26         time="300"
27     else :
28         mode=chdb.bctypesearch('te'+ch)['ontv']
29     tsepg2xml=configreader.getpath("tsepg2xml")
30     tv2ts.tv2tsmix(pout+".ts",ch,"180")
31     exe="export LANG=ja_JP.UTF-8 && /usr/bin/nice -n 19 wine "+tsepg2xml+" "+mode+" "+pout+".ts >"+pout
32     print exe
33     os.system(exe)
34
35         
36