# coding: UTF-8
# Rec10 TS Recording Tools
# Copyright (C) 2009 Yukikaze
- # モジュール属性 argv を取得するため
+ # モジュール属性 argv を取得するため
import rec10d
def ontvsearch(ontvin):
- ret=[]
- for datum in rec10d.rec10db.select_by_ontv_chdata(ontvin):
- rett={'bctype':datum[0],'ontv':datum[1],'chtxt':datum[2],'ch':datum[3],'csch':datum[4],'update':datum[5]}
+ ret = []
+ for datum in rec10d.rec10db.select_by_ontv_epg_ch(ontvin):
+ rett = {'bctype':datum[0], 'ontv':datum[1], 'chtxt':datum[2], 'ch':datum[3], 'csch':datum[4], 'update':datum[5]}
ret.append(rett)
- if len(ret)==0:
+ if len(ret) == 0:
ret.append(None)
return ret[0]
def chtxtsearch(chtxtin):
- ret=[]
- for datum in rec10d.rec10db.select_by_chtxt_chdata(chtxtin):
- rett={'bctype':datum[0],'ontv':datum[1],'chtxt':datum[2],'ch':datum[3],'csch':datum[4],'update':datum[5]}
+ ret = []
+ for datum in rec10d.rec10db.select_by_chtxt_epg_ch(chtxtin):
+ rett = {'bctype':datum[0], 'ontv':datum[1], 'chtxt':datum[2], 'ch':datum[3], 'csch':datum[4], 'update':datum[5]}
ret.append(rett)
- if len(ret)==0:
+ if len(ret) == 0:
ret.append(None)
return ret[0]
def bctypesearch(bctypein):
- ret=[]
- for datum in rec10d.rec10db.select_by_bctype_chdata(bctypein):
- rett={'bctype':datum[0],'ontv':datum[1],'chtxt':datum[2],'ch':datum[3],'csch':datum[4],'update':datum[5]}
+ ret = []
+ for datum in rec10d.rec10db.select_by_bctype_epg_ch(bctypein):
+ rett = {'bctype':datum[0], 'ontv':datum[1], 'chtxt':datum[2], 'ch':datum[3], 'csch':datum[4], 'update':datum[5]}
ret.append(rett)
- if len(ret)==0:
+ if len(ret) == 0:
ret.append(None)
return ret[0]
def chsearch(chin):
- ret=[]
- for datum in rec10d.rec10db.select_by_ch_chdata(chin):
- rett={'bctype':datum[0],'ontv':datum[1],'chtxt':datum[2],'ch':datum[3],'csch':datum[4],'update':datum[5]}
+ ret = []
+ for datum in rec10d.rec10db.select_by_ch_epg_ch(chin):
+ rett = {'bctype':datum[0], 'ontv':datum[1], 'chtxt':datum[2], 'ch':datum[3], 'csch':datum[4], 'update':datum[5]}
ret.append(rett)
- if len(ret)==0:
+ if len(ret) == 0:
ret.append(None)
return ret[0]
def getall():
- ret=[]
- for datum in rec10d.rec10db.select_all_chdata():
- rett={'bctype':datum[0],'ontv':datum[1],'chtxt':datum[2],'ch':datum[3],'csch':datum[4],'update':datum[5]}
+ ret = []
+ for datum in rec10d.rec10db.select_all_epg_ch():
+ rett = {'bctype':datum[0], 'ontv':datum[1], 'chtxt':datum[2], 'ch':datum[3], 'csch':datum[4], 'update':datum[5]}
ret.append(rett)
- if len(ret)==0:
+ if len(ret) == 0:
ret.append(None)
return ret[0]
def update():
- ret=[]
- CSupdate=0
- CS2update=0
- BSupdate=0
- for datum in rec10d.rec10db.select_get_update_chdata("6"):
- bctype=datum[0]
- chtxt=datum[1]
- if bctype=="cs1" or bctype==u"cs1":
- if CSupdate==0:
+ ret = []
+ CSupdate = 0
+ CS2update = 0
+ BSupdate = 0
+ for datum in rec10d.rec10db.select_get_update_epg_ch("6"):
+ bctype = datum[0]
+ if bctype == "cs1" or bctype == u"cs1":
+ if CSupdate == 0:
ret.append(u"cs1")
- CSupdate=1
- print "csの番組表取得開始"
- #rec10d.rec10db.update_by_bctype_chdata(bctype)
- elif bctype=="cs2" or bctype==u"cs2":
- if CS2update==0:
+ CSupdate = 1
+ elif bctype == "cs2" or bctype == u"cs2":
+ if CS2update == 0:
ret.append(u"cs2")
- CS2update=1
- print "cs2の番組表取得開始"
- #rec10d.rec10db.update_by_bctype_chdata(bctype)
- elif bctype=="bs" or bctype==u"bs":
- if BSupdate==0:
+ CS2update = 1
+ elif bctype == "bs" or bctype == u"bs":
+ if BSupdate == 0:
ret.append(u"bs")
- BSupdate=1
- print "bsの番組表取得開始"
- #rec10d.rec10db.update_by_bctype_chdata(bctype)
+ BSupdate = 1
else:
ret.append(bctype)
- print "取得開始"
- #rec10d.rec10db.update_by_bctype_and_chtxt_chdata(bctype,chtxt)
return ret
\ No newline at end of file