X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=rec10%2Ftrunk%2Fsrc%2Fchdb.py;h=9763b53f734a6f694fef049894d8864733cb35e8;hb=d63ca135202a679bd918561b65e806966f94546e;hp=0c9fa324ce89f7c657457ff772f789367bcabf23;hpb=e4f1aad7838bde6822d6e521c299bc99138f1456;p=rec10%2Frec10-git.git diff --git a/rec10/trunk/src/chdb.py b/rec10/trunk/src/chdb.py index 0c9fa32..9763b53 100644 --- a/rec10/trunk/src/chdb.py +++ b/rec10/trunk/src/chdb.py @@ -1,46 +1,55 @@ #!/usr/bin/python # coding: UTF-8 # Rec10 TS Recording Tools -# Copyright (C) 2009-2010 Yukikaze +# Copyright (C) 2009-2012 Yukikaze # モジュール属性 argv を取得するため import rec10d -def ontvsearch(ontvin): +def searchCHFromChtxt(chtxtin): + chtxtt=chtxtin.replace("_0","_%") 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]} + for datum in rec10d.rec10db.select_by_chtxt_epg_ch(chtxtt): + rett = {'bctype':datum[0], 'chtxt':datum[1], 'ch':datum[2], 'csch':datum[3],'tsid':datum[4],'update':datum[5], 'chname':datum[6], 'visible':datum[8]} ret.append(rett) if len(ret) == 0: ret.append(None) return ret[0] -def chtxtsearch(chtxtin): +def searchCHFromBctype(bctypein): 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]} + for datum in rec10d.rec10db.select_by_bctype_epg_ch(bctypein): + rett = {'bctype':datum[0], 'chtxt':datum[1], 'ch':datum[2], 'csch':datum[3],'tsid':datum[4], 'update':datum[5], 'chname':datum[6], 'visible':datum[8]} ret.append(rett) if len(ret) == 0: ret.append(None) return ret[0] -def bctypesearch(bctypein): +def searchCHFromCh(chin): 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]} + for datum in rec10d.rec10db.select_by_ch_epg_ch(chin): + rett = {'bctype':datum[0], 'chtxt':datum[1], 'ch':datum[2], 'csch':datum[3],'tsid':datum[4], 'update':datum[5], 'chname':datum[6], 'visible':datum[8]} ret.append(rett) if len(ret) == 0: ret.append(None) return ret[0] -def chsearch(chin): +def searchCHFromCsch(cschin): 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]} + for datum in rec10d.rec10db.select_by_csch_epg_ch(cschin): + rett = {'bctype':datum[0], 'chtxt':datum[1], 'ch':datum[2], 'csch':datum[3],'tsid':datum[4], 'update':datum[5], 'chname':datum[6], 'visible':datum[8]} ret.append(rett) if len(ret) == 0: ret.append(None) return ret[0] -def getall(): +def searchAllCHFromCh(chin): + ret = [] + for datum in rec10d.rec10db.select_by_ch_epg_ch(chin): + rett = {'bctype':datum[0], 'chtxt':datum[1], 'ch':datum[2], 'csch':datum[3],'tsid':datum[4], 'update':datum[5], 'chname':datum[6], 'visible':datum[8]} + ret.append(rett) + if len(ret) == 0: + ret.append(None) + return ret +def getAllCH(): 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]} + rett = {'bctype':datum[0], 'chtxt':datum[1], 'ch':datum[2], 'csch':datum[3],'tsid':datum[4], 'update':datum[5], 'chname':datum[6], 'visible':datum[8]} ret.append(rett) if len(ret) == 0: ret.append(None) @@ -50,7 +59,6 @@ def update(): CSupdate = 0 CS2update = 0 BSupdate = 0 - HUupdate = 0 rec10d.rec10db.set_new_status("8") for datum in rec10d.rec10db.select_get_update_epg_ch("6"): bctype = datum[0] @@ -66,10 +74,28 @@ def update(): if BSupdate == 0: ret.append(u"bs") BSupdate = 1 - elif bctype == "hu" or bctype == u"hu": - if HUupdate == 0: - ret.append(u"hu") - HUupdate = 1 else: ret.append(bctype) - return ret \ No newline at end of file + return ret +def changeCHShow(chtxt,isshow): + rec10d.rec10db.change_visible_epg_ch(chtxt, isshow) +def updateLogo(): + ret=[] + BSCSUpdate=0 + for datum in rec10d.rec10db.select_get_updatelogo_epg_ch("720"): + bctype=datum[0] + if bctype == "cs1" or bctype == u"cs1": + if BSCSUpdate==0: + ret.append(u"bs") + BSCSUpdate=1 + elif bctype == "cs2" or bctype == u"cs2": + if BSCSUpdate==0: + ret.append(u"bs") + BSCSUpdate=1 + elif bctype == "bs" or bctype == u"bs": + if BSCSUpdate==0: + ret.append(u"bs") + BSCSUpdate=1 + else: + ret.append(bctype) + return ret