OSDN Git Service

change function name.
authorgn64_jp <gn64_jp@4e526526-5e11-4fc0-8910-f8fd03428081>
Thu, 2 Dec 2010 23:40:23 +0000 (23:40 +0000)
committergn64_jp <gn64_jp@4e526526-5e11-4fc0-8910-f8fd03428081>
Thu, 2 Dec 2010 23:40:23 +0000 (23:40 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/rec10@778 4e526526-5e11-4fc0-8910-f8fd03428081

35 files changed:
rec10/trunk/src/auto_move.py
rec10/trunk/src/auto_process.py
rec10/trunk/src/auto_rec.py
rec10/trunk/src/auto_test.py
rec10/trunk/src/chdata.py
rec10/trunk/src/chdb.py
rec10/trunk/src/chlist_bs.xml [deleted file]
rec10/trunk/src/chlist_cs.xml [deleted file]
rec10/trunk/src/chlist_sample_kobe.xml [deleted file]
rec10/trunk/src/chlist_sample_nagoya.xml [deleted file]
rec10/trunk/src/chlist_sample_tokyo.xml [deleted file]
rec10/trunk/src/classify.py
rec10/trunk/src/configreader.py
rec10/trunk/src/configwriter.py
rec10/trunk/src/dbMySQL.py
rec10/trunk/src/epgdb.py
rec10/trunk/src/install.py
rec10/trunk/src/n_gram.py
rec10/trunk/src/rec10d.py
rec10/trunk/src/recdb.py
rec10/trunk/src/recdblist.py
rec10/trunk/src/recque.py
rec10/trunk/src/scan_ch.py
rec10/trunk/src/status.py
rec10/trunk/src/tester.py
rec10/trunk/src/timerec.py
rec10/trunk/src/ts2epg.py
rec10/trunk/src/ts2x264.py
rec10/trunk/src/tv2audio.py
rec10/trunk/src/tv2avi.py
rec10/trunk/src/tv2mkv.py
rec10/trunk/src/tv2mp4.py
rec10/trunk/src/tv2ts.py
rec10/trunk/src/xml2db_dom.py
rec10/trunk/src/zenhan.py

index bfe5509..dedaf6d 100644 (file)
@@ -37,7 +37,7 @@ def getTitle(title):
     elif tT5:
         ntitle=tT5.group(1)
     return ntitle
-def search_file(temppath,recpath,ext):
+def searchFile(temppath,recpath,ext):
     """
     録画一時フォルダ内ファイルを検索
     """
@@ -56,7 +56,7 @@ def search_file(temppath,recpath,ext):
                 if veryfySize(avipath):
                     ret.append(title)
     return ret
-def get_move_dest_path(title,temppath,recpath,ext):
+def getMoveDestpath(title,temppath,recpath,ext):
     dstpath=os.path.join(recpath,title+ext)
     srcpath=os.path.join(temppath,title+ext)
     if os.path.exists(dstpath):
@@ -64,7 +64,7 @@ def get_move_dest_path(title,temppath,recpath,ext):
             gmtime=time.gmtime(os.path.getmtime(srcpath))
             iff=""
             try:
-                iff=u"("+configreader.getenv("iff")+u")_"
+                iff=u"("+configreader.getEnvSetting("iff")+u")_"
                 if iff==u"()_":
                     iff = u""
             except:
@@ -74,7 +74,7 @@ def get_move_dest_path(title,temppath,recpath,ext):
             recdblist.printutf8(u"同サイズのファイルが存在します")
 
     return title
-def get_delpath(temppath,title,addfp=1):
+def getDelpath(temppath,title,addfp=1):
     delpath=[os.path.join(temppath,title+".ts")]
     delpath.append(os.path.join(temppath,title+".avi"))
     if addfp==1:
@@ -108,13 +108,13 @@ def execMove(title,temppath,recpath,ext,autodel):
     srcpath=os.path.join(temppath,title+ext)
     sf=guess.searchFolder(title, recpath)
     if sf!="":
-        destpath=os.path.join(sf,get_move_dest_path(title, temppath, sf, ext)+ext)
+        destpath=os.path.join(sf,getMoveDestpath(title, temppath, sf, ext)+ext)
         if os.path.exists(destpath):
             if os.path.getsize(destpath) == os.path.getsize(srcpath):
                 recdblist.printutf8(u"同名同サイズのファイルが存在します。")
                 if autodel==1:
                     recdblist.printutf8(u"関連ファイルを削除します。")
-                    delpath=get_delpath(temppath, title)
+                    delpath=getDelpath(temppath, title)
                     for dp in delpath:
                         try:
                             os.remove(dp)
@@ -128,7 +128,7 @@ def execMove(title,temppath,recpath,ext,autodel):
             shutil.copy(srcpath, destpath)
             #shutil.copy(srcpath, destpath)
             if autodel==1:
-                delpath=get_delpath(temppath, title)
+                delpath=getDelpath(temppath, title)
                 for dp in delpath:
                     try:
                         os.remove(dp)
@@ -136,7 +136,7 @@ def execMove(title,temppath,recpath,ext,autodel):
                     except:
                         ""
 def execDelete(title,temppath):
-    delpath=get_delpath(temppath, title,0)
+    delpath=getDelpath(temppath, title,0)
     recdblist.printutf8(title+u" 関連の一時ファイルを削除します")
     for dp in delpath:
         try:
index 7ae3bb5..b289b49 100644 (file)
@@ -17,7 +17,7 @@ import recdblist
 import rec10d
 import tv2mp4
 import epgdb
-def Update_to_MP4(path):
+def updateToMP4(path):
     """
     !現在未使用!
     録画一時フォルダ内mp4ファイルを検索
@@ -161,7 +161,7 @@ def update_timeline_epg_schedule(btime,etime):
         ret=[]
         #[chtxtt, title, btime, etime,exp,longexp,category]
         if db['type']==recdblist.REC_KEYWORD or db['type']==recdblist.REC_KEYWORD_EVERY_SOME_DAYS:
-            ret=epgdb.searchtime2(db['title'], db['btime'], db['deltatime'], db['chtxt'])
+            ret=epgdb.searchTime(db['title'], db['btime'], db['deltatime'], db['chtxt'])
             if len(ret)>4 and len(ret[2])>18:
                 rec10d.rec10db.update_epg_timeline(db['type'], db['chtxt'], db['title'], db['btime'], ret[2],ret[3],ret[1],ret[4])
                 if not (db['btime'] == ret[2] and  db['etime']==ret[3]):
@@ -171,7 +171,7 @@ def update_timeline_epg_schedule(btime,etime):
             else:
                 rec10d.rec10db.update_status_change_timeline(db['type'], db['chtxt'], db['title'], db['btime'], "1")
         elif db['type']==recdblist.REC_RESERVE or db['type']==recdblist.REC_FINAL_RESERVE :
-            ret=epgdb.searchtime2(db['title'], db['btime'],"5", db['chtxt'])
+            ret=epgdb.searchTime(db['title'], db['btime'],"5", db['chtxt'])
             if len(ret)>4 and len(ret[2])>18:
                 rec10d.rec10db.update_epg_timeline(db['type'], db['chtxt'], db['title'], db['btime'], ret[2],ret[3],ret[1],ret[4])
                 if not (db['btime'] == ret[2] and  db['etime']==ret[3]):
@@ -184,9 +184,9 @@ def update_timeline_dup(epgbtime,epgetime):
     dbl=rec10d.rec10db.select_byepgtime_all_timeline(epgbtime, epgetime)
     for db in dbl:
         if db['type']==recdblist.REC_KEYWORD or db['type']==recdblist.REC_KEYWORD_EVERY_SOME_DAYS:
-            dbn=epgdb.count_epgschedule(db['epgbtime'], db['epgetime'])
+            dbn=epgdb.countEpgSchedule(db['epgbtime'], db['epgetime'])
             try:
-                bctypet=chdb.chtxtsearch(db['chtxt'])['bctype']
+                bctypet=chdb.searchFromCHtxt(db['chtxt'])['bctype']
                 if bctypet.find("cs") > -1 or bctypet.find("bs") > -1 :
                     if dbn[1]>status.getRecordingMax()[1]:
                         rec10d.rec10db.update_status_dup_timeline(db['type'], db['chtxt'], db['title'], db['btime'], "1")
@@ -260,7 +260,7 @@ def deltmpfile(path,title,ext):
             elif os.path.getsize(os.path.join(path,title+".ts"))>200*1000*1000:
                 dp.append(os.path.join(path,title+".ts.b25"))
     if level > 4 :
-        if configreader.getenv("remove_ts")=="1":
+        if configreader.getEnvSetting("remove_ts")=="1":
             dp.append(os.path.join(path,title+".ts"))
     if level > 9 :
         dp.append(os.path.join(path,title+".avi"))
index dc78984..bedf260 100644 (file)
@@ -4,69 +4,69 @@
 # Copyright (C) 2009-2010 Yukikaze
 import n_gram
 import rec10d
-def get_db_key(key,chtxt):
+def getDBKey(key,chtxt):
     return rec10d.rec10db.select_by_key_in_auto_bayes_key(key, chtxt)
-def change_db_epg(chtxt,beforenum,newnum):
+def changeDBEpg(chtxt,beforenum,newnum):
     rec10d.rec10db.change_ratio_all_reduce_in_auto_bayes_key(chtxt, beforenum, newnum)
-def change_db_num(chtxt,recaddnum,alladdnum):
+def changeDBNum(chtxt,recaddnum,alladdnum):
     """
     add num.(Not change)
     """
     rec10d.rec10db.add_num_in_auto_bayes_key(chtxt, recaddnum,alladdnum)
-def change_db_ratio_rec(key,chtxt,beforenum,addnum):
+def changeDBRatioRec(key,chtxt,beforenum,addnum):
     rec10d.rec10db.change_ratio_rec_in_auto_bayes_key(key, chtxt, beforenum, addnum)
-def change_db_ratio_rec_many(chtxt,beforenum,list):
+def changeDBRatioMultiRec(chtxt,beforenum,list):
     rec10d.rec10db.change_multi_ratio_rec_in_auto_bayes_key(chtxt, beforenum, list)
-def change_db_reduce_ratio_rec(chtxt,beforenum,addnum):
+def changeDBReduceRatioRec(chtxt,beforenum,addnum):
     rec10d.rec10db.change_ratio_rec_reduce_in_auto_bayes_key(chtxt, beforenum, addnum)
-def change_db_ratio_all(key,chtxt,beforenum,addnum):
+def changeDBRatioAll(key,chtxt,beforenum,addnum):
     rec10d.rec10db.change_ratio_all_in_auto_bayes_key(key, chtxt, beforenum, addnum)
-def change_db_ratio_all_many(chtxt,beforenum,list):
+def changeDBRatioMultiAll(chtxt,beforenum,list):
     rec10d.rec10db.change_multi_ratio_all_in_auto_bayes_key(chtxt,beforenum, list)
-def get_db_num(chtxt):
-    ret=get_db_key("NUM", chtxt)
+def getDBNum(chtxt):
+    ret=getDBKey("NUM", chtxt)
     if len(ret)<3:
         rec10d.rec10db.add_in_auto_bayes_key("NUM", chtxt, 1,1)
-        ret=get_db_key("NUM", chtxt)
+        ret=getDBKey("NUM", chtxt)
     return ret
-def update_recall(chtxt,titles,descs,newnum):
+def updateRecall(chtxt,titles,descs,newnum):
     """
     update recall
     """
     titles=" "+titles+" "
     descs=" "+descs+" "
     str1=titles*2+descs+titles*2
-    noun=n_gram.get_noun_quad_gram(str1)
-    bnum=get_db_num(chtxt)[3]
+    noun=n_gram.getNounQuadGram(str1)
+    bnum=getDBNum(chtxt)[3]
     if bnum<1:
         bnum=100
-    change_db_ratio_all_many(chtxt, bnum,noun)
-    change_db_epg(chtxt, bnum, newnum)
-    change_db_num(chtxt, 0, newnum)
-def add_key(chtxt,title,desc):
+    changeDBRatioMultiAll(chtxt, bnum,noun)
+    changeDBEpg(chtxt, bnum, newnum)
+    changeDBNum(chtxt, 0, newnum)
+def addKey(chtxt,title,desc):
     title=u" "+title+u" "
     desc=u" "+desc+u" "
     str1=title*2+desc+title*2##タイトルは重視したいので幾度か足す。
-    noun=n_gram.get_noun_quad_gram(str1)#nounは辞書のキーに文字を、中身に出現回数を書いたもの。
-    bnum=get_db_num(chtxt)[2]
+    noun=n_gram.getNounQuadGram(str1)#nounは辞書のキーに文字を、中身に出現回数を書いたもの。
+    bnum=getDBNum(chtxt)[2]
     if bnum<1:
         bnum=1
-    change_db_ratio_rec_many(chtxt, bnum, noun)
-    change_db_num(chtxt,1,0)
-    change_db_reduce_ratio_rec(chtxt, bnum,1)
-def calc_key(chtxt,title,desc):
+    changeDBRatioMultiRec(chtxt, bnum, noun)
+    changeDBNum(chtxt,1,0)
+    changeDBReduceRatioRec(chtxt, bnum,1)
+def calcKey(chtxt,title,desc):
     """
 
     """
     title=u" "+title+u" "
     desc=u" "+desc+u" "
     str1=title*2+desc+title*2##タイトルは重視したいので幾度か足す。
-    noun=n_gram.get_noun_quad_gram(str1)#nounは辞書のキーに文字を、中身に出現回数を書いたもの。
+    noun=n_gram.getNounQuadGram(str1)#nounは辞書のキーに文字を、中身に出現回数を書いたもの。
     tnum=1
     nump=0
     for key,num in noun.items():
-        pp=get_db_key(key,chtxt)
-        pp2=get_db_key(key,"ALL")
+        pp=getDBKey(key,chtxt)
+        pp2=getDBKey(key,"ALL")
         if len(pp)>3:
             tarec=0
             taall=0
index 82641cd..75ff69e 100644 (file)
@@ -13,10 +13,10 @@ import configreader
 import chdb
 import tv2mp4
 import tv2ts
-def test_all_ch_encode(option,stime):
-    chl=chdb.getall()
+def testAllCHEncode(option,stime):
+    chl=chdb.getAll()
     print chl
-    path= configreader.getpath("test")
+    path= configreader.getPathSetting("test")
     tpath=os.path.join(path, "encode_test")
     if not os.path.exists(tpath):
         os.mkdir(tpath)
@@ -40,4 +40,4 @@ if __name__ == "__main__":
     (opts,args)=parser.parse_args(sys.argv)
     if opts.encode_option != "":##-sの場合
         print "test_all_ch_encode"
-        test_all_ch_encode(opts.encode_option, "10")
\ No newline at end of file
+        testAllCHEncode(opts.encode_option, "10")
\ No newline at end of file
index 249aeb0..ae2a1b4 100644 (file)
@@ -10,31 +10,31 @@ import rec10d
 
 path = str(os.path.dirname(os.path.abspath(__file__))) + "/"
 
-def chadd(bctype, chtxt, ch, csch):#すべて文字列
+def chAdd(bctype, chtxt, ch, csch):#すべて文字列
     rec10d.rec10db.add_epg_ch(bctype,chtxt, ch, csch, u"2010-01-01 00:00:00")
-def chlistadd(cl):
+def addCHlist(cl):
     if len(cl)>0:
         for c in cl:
-            chadd(c[0],c[1],c[2],c[3])
-def new_chdata(bs,cs):
+            chAdd(c[0],c[1],c[2],c[3])
+def newCHdata(bs,cs):
     rec10d.rec10db.new_epg_ch()
-    chlistadd(getChList(os.path.join(path,"chlist.xml")))
+    addCHlist(getCHlist(os.path.join(path,"chlist.xml")))
     if bs==1:
         #bs放送の設定 全国共通のはず
-        chlistadd(getChList(os.path.join(path,"chlist_bs.xml")))
+        addCHlist(getCHlist(os.path.join(path,"chlist_bs.xml")))
     if cs==1:
         #CS放送(スカパーe2)主に基本パックに入ってるものを中心に
-        chlistadd(getChList(os.path.join(path,"chlist_cs.xml")))
-def new_chdata_all():
+        addCHlist(getCHlist(os.path.join(path,"chlist_cs.xml")))
+def newAllCHdata():
     bs=0
     cs=0
     try:
-        bs=int(configreader.getenv("bs"))
-        cs=int(configreader.getenv("cs"))
+        bs=int(configreader.getEnvSetting("bs"))
+        cs=int(configreader.getEnvSetting("cs"))
     except:
         ""
-    new_chdata(bs,cs)
-def getChList(xmlpath):
+    newCHdata(bs,cs)
+def getCHlist(xmlpath):
     dom=xml.dom.minidom.parse(file(xmlpath))
     chlist=[]
     for ch in dom.getElementsByTagName('channel'):
@@ -46,4 +46,4 @@ def getChList(xmlpath):
         chlist.append([bctype,ontv,chtxt,chd,csch])
     return chlist
 if __name__ == "__main__":
-    new_chdata_all()
\ No newline at end of file
+    newAllCHdata()
\ No newline at end of file
index adfc074..4a4852f 100644 (file)
@@ -5,7 +5,7 @@
     # モジュール属性 argv を取得するため
 import rec10d
 
-def chtxtsearch(chtxtin):
+def searchFromCHtxt(chtxtin):
     chtxtt=chtxtin.replace("_0","_%")
     ret = []
     for datum in rec10d.rec10db.select_by_chtxt_epg_ch(chtxtt):
@@ -14,7 +14,10 @@ def chtxtsearch(chtxtin):
     if len(ret) == 0:
         ret.append(None)
     return ret[0]
-def bctypesearch(bctypein):
+def getChCSchFromCHtxt(chtxt):
+    ret = {'csch':chtxt.split("_")[1],'ch':chtxt.split("_")[0]}
+    return ret
+def searchFromBctype(bctypein):
     ret = []
     for datum in rec10d.rec10db.select_by_bctype_epg_ch(bctypein):
         rett = {'bctype':datum[0], 'chtxt':datum[1], 'ch':datum[2], 'csch':datum[3], 'update':datum[4]}
@@ -22,7 +25,7 @@ def bctypesearch(bctypein):
     if len(ret) == 0:
         ret.append(None)
     return ret[0]
-def chsearch(chin):
+def searchFromCH(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], 'update':datum[4]}
@@ -30,7 +33,7 @@ def chsearch(chin):
     if len(ret) == 0:
         ret.append(None)
     return ret[0]
-def getall():
+def getAll():
     ret = []
     for datum in rec10d.rec10db.select_all_epg_ch():
         rett = {'bctype':datum[0], 'chtxt':datum[1], 'ch':datum[2], 'csch':datum[3], 'update':datum[4]}
diff --git a/rec10/trunk/src/chlist_bs.xml b/rec10/trunk/src/chlist_bs.xml
deleted file mode 100644 (file)
index ab67eed..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<rec10_ch>\r
-    <channel bctype="bs" ch="101" csch="0" chtxt="bs-nhk-1" ontvcode="3001.ontvjapan.com"/>\r
-    <channel bctype="bs" ch="102" csch="0" chtxt="bs-nhk-2" ontvcode="3002.ontvjapan.com"/>\r
-    <channel bctype="bs" ch="103" csch="0" chtxt="bs-nhk-hi" ontvcode="3003.ontvjapan.com"/>\r
-    <channel bctype="bs" ch="141" csch="0" chtxt="bs-nittere" ontvcode="3004.ontvjapan.com"/>\r
-    <channel bctype="bs" ch="151" csch="0" chtxt="bs-asahi" ontvcode="3005.ontvjapan.com"/>\r
-    <channel bctype="bs" ch="161" csch="0" chtxt="bs-tbs" ontvcode="3006.ontvjapan.com"/>\r
-    <channel bctype="bs" ch="171" csch="0" chtxt="bs-japan" ontvcode="3007.ontvjapan.com"/>\r
-    <channel bctype="bs" ch="181" csch="0" chtxt="bs-fuji" ontvcode="3008.ontvjapan.com"/>\r
-    <channel bctype="bs" ch="211" csch="0" chtxt="bs-11" ontvcode="3013.ontvjapan.com"/>\r
-</rec10_ch>\r
diff --git a/rec10/trunk/src/chlist_cs.xml b/rec10/trunk/src/chlist_cs.xml
deleted file mode 100644 (file)
index d0356bd..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<rec10_ch>\r
-    <!--\r
-    bctypeのcs1,cs2は放送の衛星ごとに変えてください。\r
-    番組表データがそれぞれの衛星チャンネルのものしか含まれないためです。\r
-    -->\r
-    <!--標準のパックに入ったもの-->\r
-    <!--映画-->\r
-    <channel bctype="cs2" ch="CS6" csch="223" chtxt="neco" ontvcode="1008.ontvjapan.com"/>\r
-    <channel bctype="cs2" ch="CS6" csch="224" chtxt="yo-ga" ontvcode="1009.ontvjapan.com"/>\r
-    <channel bctype="cs1" ch="CS10" csch="228" chtxt="thecinema" ontvcode="1217.ontvjapan.com"/>\r
-    <channel bctype="cs1" ch="CS2" csch="239" chtxt="nihoneiga" ontvcode="1086.ontvjapan.com"/>\r
-    <channel bctype="cs2" ch="CS18" csch="240" chtxt="movieplus" ontvcode="1007.ontvjapan.com"/>\r
-    <!--スポーツ-->\r
-    <!--音楽-->\r
-    <!--バラエティ-->\r
-    <channel bctype="cs2" ch="CS22" csch="293" chtxt="family" ontvcode="1015.ontvjapan.com"/>\r
-    <!--総合エンターテインメント-->\r
-    <!--<channel bctype="cs2" ch="CS24" csch="300" chtxt="nittereplus" ontvcode="300ch.ontvjapan.com"/>-->\r
-    <channel bctype="cs2" ch="CS22" csch="301" chtxt="tbsch" ontvcode="3201.ontvjapan.com"/>\r
-    <channel bctype="cs2" ch="CS12" csch="303" chtxt="tereasa" ontvcode="1092.ontvjapan.com"/>\r
-    <!--<channel bctype="cs2" ch="CS16" csch="305" chtxt="ginga" ontvcode="305ch.ontvjapan.com"/>-->\r
-    <channel bctype="cs2" ch="CS20" csch="307" chtxt="fuji-one" ontvcode="1073.ontvjapan.com"/>\r
-    <channel bctype="cs2" ch="CS20" csch="308" chtxt="fuji-two" ontvcode="1072.ontvjapan.com"/>\r
-    <!--海外ドラマ-->\r
-    <channel bctype="cs2" ch="CS6" csch="311" chtxt="axn" ontvcode="1014.ontvjapan.com"/>\r
-    <channel bctype="cs2" ch="CS4" csch="312" chtxt="fox" ontvcode="1016.ontvjapan.com"/>\r
-    <!--アニメ-->\r
-    <channel bctype="cs1" ch="CS8" csch="335" chtxt="kidshd" ontvcode="335ch.ontvjapan.com"/>\r
-    <channel bctype="cs2" ch="CS20" csch="332" chtxt="animax" ontvcode="1047.ontvjapan.com"/>\r
-    <channel bctype="cs2" ch="CS4" csch="334" chtxt="disney" ontvcode="1213.ontvjapan.com"/>\r
-    <!--ドキュメンタリー-->\r
-    <channel bctype="cs2" ch="CS20" csch="340" chtxt="disch" ontvcode="1062.ontvjapan.com"/>\r
-    <channel bctype="cs2" ch="CS20" csch="341" chtxt="anipla" ontvcode="1193.ontvjapan.com"/>\r
-    <channel bctype="cs2" ch="CS16" csch="342" chtxt="hisch" ontvcode="1050.ontvjapan.com"/>\r
-    <channel bctype="cs2" ch="CS6" csch="343" chtxt="natiogeo" ontvcode="1204.ontvjapan.com"/>\r
-    <!--ニュース-->\r
-    <channel bctype="cs2" ch="CS12" csch="353" chtxt="bbc" ontvcode="1070.ontvjapan.com"/>\r
-    <channel bctype="cs2" ch="CS12" csch="354" chtxt="cnn" ontvcode="1069.ontvjapan.com"/>\r
-    <!--趣味-->\r
-    <!--その他-->\r
-    <channel bctype="cs1" ch="CS10" csch="800" chtxt="ch800" ontvcode="800ch.epgdata.ontvjapan"/>\r
-    <channel bctype="cs1" ch="CS10" csch="801" chtxt="ch801" ontvcode="801ch.epgdata.ontvjapan"/>\r
-    <channel bctype="cs1" ch="CS10" csch="802" chtxt="ch802" ontvcode="802ch.epgdata.ontvjapan"/>\r
-    <!--\r
-    <channel bctype="cs2" ch="CS16" csch="333" chtxt="atx" ontvcode="1201.ontvjapan.com"/>\r
-    -->\r
-</rec10_ch>
\ No newline at end of file
diff --git a/rec10/trunk/src/chlist_sample_kobe.xml b/rec10/trunk/src/chlist_sample_kobe.xml
deleted file mode 100644 (file)
index 9f4733f..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<rec10_ch>\r
-    <channel bctype="te13" ch="13" csch="0" chtxt="nhk-k" ontvcode="0502.ontvjapan.com"/>\r
-    <channel bctype="te14" ch="14" csch="0" chtxt="yomiuri" ontvcode="0507.ontvjapan.com"/>\r
-    <channel bctype="te15" ch="15" csch="0" chtxt="abc" ontvcode="0505.ontvjapan.com"/>\r
-    <channel bctype="te16" ch="16" csch="0" chtxt="mbs" ontvcode="0504.ontvjapan.com"/>\r
-    <channel bctype="te17" ch="17" csch="0" chtxt="kansai" ontvcode="0506.ontvjapan.com"/>\r
-    <channel bctype="te18" ch="18" csch="0" chtxt="tv-osaka" ontvcode="0513.ontvjapan.com"/>\r
-    <channel bctype="te22" ch="22" csch="0" chtxt="nhk-s" ontvcode="0501.ontvjapan.com"/>\r
-    <channel bctype="te26" ch="26" csch="0" chtxt="sun-tv" ontvcode="0509.ontvjapan.com"/>\r
-</rec10_ch>
\ No newline at end of file
diff --git a/rec10/trunk/src/chlist_sample_nagoya.xml b/rec10/trunk/src/chlist_sample_nagoya.xml
deleted file mode 100644 (file)
index 524e837..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<rec10_ch>\r
-    <channel bctype="te13" ch="13" csch="0" chtxt="nhk-k" ontvcode="0442.ontvjapan.com"/>\r
-    <channel bctype="te20" ch="20" csch="0" chtxt="nhk-s" ontvcode="0432.ontvjapan.com"/>\r
-    <channel bctype="te22" ch="22" csch="0" chtxt="me-tere" ontvcode="0404.ontvjapan.com"/>\r
-    <channel bctype="te18" ch="18" csch="0" chtxt="cbc" ontvcode="0405.ontvjapan.com"/>\r
-    <channel bctype="te21" ch="21" csch="0" chtxt="toukai" ontvcode="0406.ontvjapan.com"/>\r
-    <channel bctype="te19" ch="19" csch="0" chtxt="chukyo" ontvcode="0407.ontvjapan.com"/>\r
-    <channel bctype="te23" ch="23" csch="0" chtxt="aichi" ontvcode="0420.ontvjapan.com"/>\r
-    <channel bctype="te27" ch="27" csch="0" chtxt="mie" ontvcode="0417.ontvjapan.com"/>\r
-</rec10_ch>
\ No newline at end of file
diff --git a/rec10/trunk/src/chlist_sample_tokyo.xml b/rec10/trunk/src/chlist_sample_tokyo.xml
deleted file mode 100644 (file)
index 3b13690..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<rec10_ch>\r
-    <channel bctype="te27" ch="27" csch="0" chtxt="nhk-s" ontvcode="0031.ontvjapan.com"/>\r
-    <channel bctype="te26" ch="26" csch="0" chtxt="nhk-k" ontvcode="0041.ontvjapan.com"/>\r
-    <channel bctype="te25" ch="25" csch="0" chtxt="nittere" ontvcode="0004.ontvjapan.com"/>\r
-    <channel bctype="te22" ch="22" csch="0" chtxt="tbs" ontvcode="0005.ontvjapan.com"/>\r
-    <channel bctype="te21" ch="21" csch="0" chtxt="fuji" ontvcode="0006.ontvjapan.com"/>\r
-    <channel bctype="te24" ch="24" csch="0" chtxt="asahi" ontvcode="0007.ontvjapan.com"/>\r
-    <channel bctype="te23" ch="23" csch="0" chtxt="tokyo" ontvcode="0008.ontvjapan.com"/>\r
-    <!--<channel bctype="te" ch="" csch="0" chtxt="tvk" ontvcode="0009.ontvjapan.com"/>\r
-    <channel bctype="te" ch="" csch="0" chtxt="chiba" ontvcode="0010.ontvjapan.com"/>\r
-    <channel bctype="te" ch="" csch="0" chtxt="gunma" ontvcode="0011.ontvjapan.com"/>\r
-    <channel bctype="te" ch="" csch="0" chtxt="tama" ontvcode="0012.ontvjapan.com"/>-->\r
-    <channel bctype="tehu" ch="28" csch="1088" chtxt="housou1" ontvcode="0013a.ontvjapan.com"/>\r
-    <channel bctype="tehu" ch="28" csch="1089" chtxt="housou2" ontvcode="0013b.ontvjapan.com"/>\r
-    <channel bctype="tehu" ch="28" csch="1090" chtxt="housou3" ontvcode="0013c.ontvjapan.com"/>\r
-    <channel bctype="te20" ch="20" csch="0" chtxt="mxtv" ontvcode="0016.ontvjapan.com"/>\r
-    <!--<channel bctype="te" ch="" csch="0" chtxt="tochigi" ontvcode="0018.ontvjapan.com"/>-->\r
-</rec10_ch>
\ No newline at end of file
index 6dfab35..39e4217 100644 (file)
@@ -51,7 +51,7 @@ if __name__ == "__main__":
                 auto_move.execMove(t, recpath, recordedpath,".mkv",1)
             else:
                 recdblist.printutf8(t+" can't find matching folder",verbose_level=100)
-        sa=auto_move.search_file(recpath, recordedpath, ".mp4")
+        sa=auto_move.searchFile(recpath, recordedpath, ".mp4")
         for t in sa:
             recdblist.printutf8(u"自動推測実行中-MP4",verbose_level=100)
             sf=guess.searchFolder(t,recordedpath)
@@ -66,7 +66,7 @@ if __name__ == "__main__":
         sa=auto_move.search_file(recpath, recordedpath,".mkv")
         for t in sa:
             auto_move.execDelete(t, recpath)
-        sa=auto_move.search_file(recpath, recordedpath,".mp4")
+        sa=auto_move.searchFile(recpath, recordedpath,".mp4")
         for t in sa:
             auto_move.execDelete(t, recpath)
     elif opts.list:##-lの場合
@@ -75,7 +75,7 @@ if __name__ == "__main__":
             sf=guess.searchFolder(t,recordedpath)
             if sf!="":
                 recdblist.printutf8(t+u" : "+os.path.join(sf, auto_move.get_move_dest_path(t, recpath,sf,".mkv")+".mkv"),verbose_level=100)
-        sa=auto_move.search_file(recpath, recordedpath,".mp4")
+        sa=auto_move.searchFile(recpath, recordedpath,".mp4")
         for t in sa:
             sf=guess.searchFolder(t,recordedpath)
             if sf!="":
@@ -92,13 +92,13 @@ if __name__ == "__main__":
         except:
             ""
         if tsmovepath!="":
-            sa=auto_move.search_file(recpath, tsmovepath,".ts")
+            sa=auto_move.searchFile(recpath, tsmovepath,".ts")
             for t in sa:
                 sf=guess.searchFolder(t,tsmovepath,700)
                 if sf!="":
                     recdblist.printutf8(t+u" : "+os.path.join(sf, auto_move.get_move_dest_path(t, recpath,sf,".ts")+".ts"))
                     print "\n"
-            sa=auto_move.search_file(recpath, tsmovepath,".ts")
+            sa=auto_move.searchFile(recpath, tsmovepath,".ts")
         else:
             recdblist.printutf8(u"ts_movepathが設定されていません。/etc/rec10.confを設定してください。",verbose_level=100)
     elif opts.tsmove:##-Tの場合
@@ -109,7 +109,7 @@ if __name__ == "__main__":
             ""
         if tsmovepath!="":
             sa=auto_move.search_file(recpath, tsmovepath,".ts")
-            for t in sa:
+       searchFilein sa:
                 sf=guess.searchFolder(t,tsmovepath,700)
                 if sf!="":
                     recdblist.printutf8(u"移動先",verbose_level=100)
@@ -141,5 +141,3 @@ if __name__ == "__main__":
                     recdblist.printutf8(sstitle+" "+str(maxt))
                 else:
                     recdblist.printutf8(u"**"+sstitle+" |"+str(maxt)+"| "+nuke)
-
-
index f4a8b93..ff66978 100644 (file)
@@ -16,15 +16,15 @@ elif os.path.exists(os.path.join("/etc","rec10.conf")):
 elif os.path.exists(os.path.join("/etc/rec10","rec10.conf")):
     confpath=os.path.join("/etc/rec10","rec10.conf")
 confp.read(confpath)
-def getpath(string):
+def getPathSetting(string):
     global confp
     return confp.get('path', string)
-def getdbpath(string):
+def getDBPathSetting(string):
     global confp
     return confp.get('db', string)
-def getenv(string):
+def getEnvSetting(string):
     global confp
     return confp.get('env', string)
-def getlog(string):
+def getLogSetting(string):
     global confp
     return confp.get('log', string)
index 0545778..c755ba0 100644 (file)
@@ -10,25 +10,25 @@ confp = ConfigParser.SafeConfigParser()
 Conf = 'rec10.conf'
 confpath=os.path.join(mypath,Conf)
 confp.read(confpath)
-def getpath(string):
+def getPathSetting(string):
     global confp
     return confp.get('path', string)
-def getdbpath(string):
+def getDBPathSetting(string):
     global confp
     return confp.get('db', string)
-def getenv(string):
+def getEnvSetting(string):
     global confp
     return confp.get('env', string)
-def setpath(option,value):
+def setPath(option,value):
     global confp
     return confp.set('path',option,value)
-def setdbpath(option,value):
+def setDBPath(option,value):
     global confp
     return confp.set('db',option,value)
-def setenv(option,value):
+def setEnv(option,value):
     global confp
     return confp.set('env',option,value)
-def writeconf():
+def writeConf():
     global confp
     f=open(confpath,"w")
     confp.write(f)
index 4dd6346..a681a11 100644 (file)
@@ -29,7 +29,7 @@ class DB_MySQL:
             con.close()
         except Exception, inst:
             if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
-                recdblist.Commonlogex("Error", "init (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
+                recdblist.addCommonlogEX("Error", "init (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
         db = self.connect_db()
         try:
             db[1].execute('\
@@ -55,7 +55,7 @@ class DB_MySQL:
             )')
         except Exception, inst:
             if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
-                recdblist.Commonlogex("Error", "init (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
+                recdblist.addCommonlogEX("Error", "init (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
         self.close_db(db)
         self.new_epg_timeline("")
         self.new_in_timeline_log()
@@ -82,7 +82,7 @@ class DB_MySQL:
             db[1].execute('drop table epg_ch')
         except Exception, inst:
             if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and (inst[0]==1050 or inst[0]==1051))):
-                recdblist.Commonlogex("Error", "new_epg_ch drop (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
+                recdblist.addCommonlogEX("Error", "new_epg_ch drop (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
 
         try:
             db[1].execute('\
@@ -99,7 +99,7 @@ class DB_MySQL:
             )')
         except Exception, inst:
             if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
-                recdblist.Commonlogex("Error", "new_epg_ch (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
+                recdblist.addCommonlogEX("Error", "new_epg_ch (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
 
         self.close_db(db)
     def add_epg_ch(self, bctype, chtxt, ch, csch, updatetime):
@@ -261,7 +261,7 @@ class DB_MySQL:
             db[1].execute('drop table auto_proc_tmp')
         except Exception, inst:
             if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and (inst[0]==1050 or inst[0]==1051))):
-                recdblist.Commonlogex("Error", "new_auto_proc_tmp drop (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
+                recdblist.addCommonlogEX("Error", "new_auto_proc_tmp drop (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
 
         try:
             db[1].execute('\
@@ -274,7 +274,7 @@ class DB_MySQL:
             )')
         except Exception, inst:
             if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
-                recdblist.Commonlogex("Error", "new_auto_proc_tmp (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
+                recdblist.addCommonlogEX("Error", "new_auto_proc_tmp (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
 
         self.close_db(db)
     def update_auto_proc(self):
@@ -283,7 +283,7 @@ class DB_MySQL:
             db[1].execute('INSERT INTO auto_proc SELECT * FROM auto_proc_tmp')
         except Exception, inst:
             if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
-                recdblist.Commonlogex("Error", "update_auto_proc (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
+                recdblist.addCommonlogEX("Error", "update_auto_proc (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
 
         self.close_db(db)
     def new_auto_proc(self):
@@ -292,7 +292,7 @@ class DB_MySQL:
             db[1].execute('drop table auto_proc')
         except Exception, inst:
             if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and (inst[0]==1050 or inst[0]==1051))):
-                recdblist.Commonlogex("Error", "new_auto_proc drop (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
+                recdblist.addCommonlogEX("Error", "new_auto_proc drop (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
 
         try:
             db[1].execute('\
@@ -305,7 +305,7 @@ class DB_MySQL:
             )')
         except Exception, inst:
             if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
-                recdblist.Commonlogex("Error", "new_auto_proc (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
+                recdblist.addCommonlogEX("Error", "new_auto_proc (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
 
         self.close_db(db)
     def add_auto_proc(self,type,title,chtxt):
@@ -322,7 +322,7 @@ class DB_MySQL:
             db[1].execute('drop table in_settings')
         except Exception, inst:
             if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and (inst[0]==1050 or inst[0]==1051))):
-                recdblist.Commonlogex("Error", "drop_in_settings (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
+                recdblist.addCommonlogEX("Error", "drop_in_settings (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
         self.close_db(db)
     def new_in_settings(self):
         db = self.connect_db()
@@ -338,7 +338,7 @@ class DB_MySQL:
             db[1].execute("INSERT IGNORE into in_settings VALUE (0,0,\"H\",1)")
         except Exception, inst:
             if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
-                recdblist.Commonlogex("Error", "new_in_settings (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
+                recdblist.addCommonlogEX("Error", "new_in_settings (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
 
         self.close_db(db)
     def select_all_in_settings(self):
@@ -399,7 +399,7 @@ class DB_MySQL:
             )')
         except Exception, inst:
             if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
-                recdblist.Commonlogex("Error", "new_in_timeline_log (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
+                recdblist.addCommonlogEX("Error", "new_in_timeline_log (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
 
         self.close_db(db)
     def select_chtxt_by_title_timeline_log(self,title):
@@ -700,7 +700,7 @@ class DB_MySQL:
             )")
         except Exception, inst:
             if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
-                recdblist.Commonlogex("Error", "new_in_auto_jbk_key (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
+                recdblist.addCommonlogEX("Error", "new_in_auto_jbk_key (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
         self.close_db(db)
     def add_in_auto_jbk_key(self,key):
         db = self.connect_db()
@@ -728,7 +728,7 @@ class DB_MySQL:
             db[1].execute('drop table in_status')
         except Exception, inst:
             if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and (inst[0]==1050 or inst[0]==1051))):
-                recdblist.Commonlogex("Error", "drop_in_status (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
+                recdblist.addCommonlogEX("Error", "drop_in_status (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
         self.close_db(db)
     def new_in_status(self):
         db = self.connect_db()
@@ -746,7 +746,7 @@ class DB_MySQL:
             db[1].execute("INSERT IGNORE into in_status VALUE (0,0,0,0,0,0)")
         except Exception, inst:
             if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
-                recdblist.Commonlogex("Error", "new_in_status (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
+                recdblist.addCommonlogEX("Error", "new_in_status (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
         self.close_db(db)
     def select_all_in_status(self):
         db = self.connect_db()
@@ -783,7 +783,7 @@ class DB_MySQL:
                 version=int(str(r[0]))
         except Exception, inst:
             if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
-                recdblist.Commonlogex("Error", "select_version_in_status (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
+                recdblist.addCommonlogEX("Error", "select_version_in_status (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
         return version
     def change_version_in_status(self,version):
         db = self.connect_db()
@@ -866,7 +866,7 @@ class DB_MySQL:
                           (bctype,))
         except Exception, inst:
             if not ((type(inst)==MySQLdb.ProgrammingError and (inst[0]==1007 or inst[0]==1146))or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
-                recdblist.Commonlogex("Error", "new_epg_timeline delete (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
+                recdblist.addCommonlogEX("Error", "new_epg_timeline delete (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
         try:
             db[1].execute("\
             CREATE TABLE epg_timeline \
@@ -883,7 +883,7 @@ class DB_MySQL:
             )")
         except Exception, inst:
             if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
-                recdblist.Commonlogex("Error", "new_epg_timeline (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
+                recdblist.addCommonlogEX("Error", "new_epg_timeline (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
         #db.commit()
         self.close_db(db)
     def add_epg_timeline(self, bctype, channel, start, stop, title, desc,longdesc, category):
@@ -962,7 +962,7 @@ class DB_MySQL:
             db[1].execute('CREATE INDEX keycharindex ON in_auto_bayes_key(keychar)')
         except Exception, inst:
             if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
-                recdblist.Commonlogex("Error", "new_in_auto_bayes_key (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
+                recdblist.addCommonlogEX("Error", "new_in_auto_bayes_key (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
         self.close_db(db)
 
     def add_in_auto_bayes_key(self,key,chtxt,ratio_rec,ratio_all):
@@ -1024,7 +1024,7 @@ class DB_MySQL:
                 ratio_all=CONVERT((ratio_all*%s+%s)/%s,DECIMAL(32,14))",retl)
             except Exception, inst:
                 if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
-                    recdblist.Commonlogex("Error", "change_multi_ratio_all_in_auto_bayes_key (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
+                    recdblist.addCommonlogEX("Error", "change_multi_ratio_all_in_auto_bayes_key (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
         self.close_db(db)
     def change_ratio_rec_reduce_in_auto_bayes_key(self,chtxt,beforenum,newnum):
         beforenum=str(beforenum)
@@ -1056,7 +1056,7 @@ class DB_MySQL:
                 ratio_rec=CONVERT((ratio_rec*%s+%s)/%s,DECIMAL(32,14))",retl)
             except Exception, inst:
                 if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
-                    recdblist.Commonlogex("Error", "change_multi_ratio_rec_in_auto_bayes_key (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
+                    recdblist.addCommonlogEX("Error", "change_multi_ratio_rec_in_auto_bayes_key (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
         self.close_db(db)
     def select_by_key_in_auto_bayes_key(self,key,chtxt):
         db = self.connect_db()
@@ -1088,7 +1088,7 @@ class DB_MySQL:
             )')
         except Exception, inst:
             if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
-                recdblist.Commonlogex("Error", "new_auto_timeline_keyword (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
+                recdblist.addCommonlogEX("Error", "new_auto_timeline_keyword (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
     def add_auto_timeline_keyword(self,chtxt="", title="", btime="", etime=""):
         db = self.connect_db()
         db[1].execute('\
@@ -1121,7 +1121,7 @@ class DB_MySQL:
             )')
         except Exception, inst:
             if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
-                recdblist.Commonlogex("Error", "new_auto_timeline_bayes (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
+                recdblist.addCommonlogEX("Error", "new_auto_timeline_bayes (dbMySQL.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
     def add_auto_timeline_bayes(self,chtxt="", title="", btime="", etime="",point=""):
         db = self.connect_db()
         db[1].execute('\
@@ -1187,8 +1187,6 @@ class DB_MySQL:
         db[1].execute("\
         UPDATE timeline INNER JOIN epg_ch ON timeline.chtxt=epg_ch.chtxt SET timeline.chtxt=CONCAT(CONCAT(epg_ch.ch,'_'),epg_ch.csch)")
         db[1].execute("\
-        UPDATE timeline INNER JOIN epg_ch ON timeline.chtxt=epg_ch.chtxt SET timeline.chtxt=CONCAT('CS_',epg_ch.csch) where timeline.chtxt LIKE 'CS%'")
-        db[1].execute("\
         ALTER TABLE epg_ch DROP ontv")
         db[1].execute("\
         ALTER TABLE in_auto_jbk_key ADD auto TINYINT DEFAULT 0")
index bc23f54..d42160a 100644 (file)
@@ -17,40 +17,35 @@ import xml2db_dom
 import configreader
 import recdblist
 path = str(os.path.dirname(os.path.abspath(__file__))) + "/"
-tmppath = configreader.getpath("tmp")+"/"
+tmppath = configreader.getPathSetting("tmp")+"/"
 if tmppath=="/":
     tmppath=path
 def update(chtxt):
     recdblist.printutf8(chtxt)
     tnow = datetime.datetime.now()
     try:
-        lastup = datetime.datetime.strptime(chdb.chtxtsearch(chtxt)[0]['update'], "%Y-%m-%d %H:%M:%S")
+        lastup = datetime.datetime.strptime(chdb.searchFromCHtxt(chtxt)[0]['update'], "%Y-%m-%d %H:%M:%S")
     except:
         lastup = datetime.datetime.strptime("2009-04-01 00:00:00", "%Y-%m-%d %H:%M:%S")
     dt = tnow-lastup
     dt = dt.days * 24 * 60 + dt.seconds
     if dt > 2 * 60 * 60:
-        ts2epg.write(os.path.join(tmppath, chtxt + "epgdata.xml"), chdb.chtxtsearch(chtxt)['ch'])
-        xml2db_dom.xml2db_dom(os.path.join(tmppath, chtxt + "epgdata.xml"), chdb.chtxtsearch(chtxt)['bctype'])
-def updatebc(bctype):
-    bctypel = chdb.bctypesearch(bctype)
+        ts2epg.write(os.path.join(tmppath, chtxt + "epgdata.xml"), chdb.getChCSchFromCHtxt(chtxt)['ch'])
+        xml2db_dom.xml2db_dom(os.path.join(tmppath, chtxt + "epgdata.xml"), chdb.searchFromCHtxt(chtxt)['bctype'])
+def updateForBctype(bctype):
+    bctypel = chdb.searchFromBctype(bctype)
     #print bctype
     try:
-        ts2epg.write(tmppath + bctype + "epgdata.xml", chdb.bctypesearch(bctype)['ch'])
+        ts2epg.write(tmppath + bctype + "epgdata.xml", chdb.searchFromBctype(bctype)['ch'])
         xml2db_dom.xml2db_dom(tmppath + bctype + "epgdata.xml", bctype)
         shutil.copyfile(tmppath + bctype + "epgdata.xml", tmppath + bctype + "epgdata.bak.xml")
         time.sleep(5)
         rec10d.rec10db.update_by_bctype_epg_ch(bctype)
     except Exception, inst:
-        recdblist.Commonlogex("Error","updatebc(epgdb.py)", str(type(inst)), str(inst)+"\n"+traceback.format_exc(),log_level=200)
+        recdblist.addCommonlogEX("Error","updatebc(epgdb.py)", str(type(inst)), str(inst)+"\n"+traceback.format_exc(),log_level=200)
         xml2db_dom.xml2db_dom(tmppath + bctype + "epgdata.bak.xml", bctype)
         rec10d.rec10db.update_status_by_bctype_epg_ch(bctype, "2")
-def updatebc_bak(bctype):
-    """
-    update epg data by .bak file
-    """
-    xml2db_dom.xml2db_dom(tmppath + bctype + "epgdata.bak.xml", bctype)
-def searchtime2(titletxt, timet, deltatime, chtxt):
+def searchTime(titletxt, timet, deltatime, chtxt):
     time = datetime.datetime.strptime(timet, "%Y-%m-%d %H:%M:%S")
     ret = []
     deltatime = int(deltatime)
@@ -87,7 +82,7 @@ def searchtime2(titletxt, timet, deltatime, chtxt):
     ret = one
     #print ret
     return ret
-def searchtime_auto(keytxt, timet, deltatime):
+def searchTimeAuto(keytxt, timet, deltatime):
     time = datetime.datetime.strptime(timet, "%Y-%m-%d %H:%M:%S")
     ret = []
     deltatime = int(deltatime)
@@ -102,7 +97,7 @@ def searchtime_auto(keytxt, timet, deltatime):
         etime = etime[0:4] + "-" + etime[4:6] + "-" + etime[6:8] + " " + etime[8:10] + ":" + etime[10:12] + ":00"
         ret.append([chtxtt, title, btime, etime,exp,longexp,category])
     return ret
-def count_schedule(btime,etime):
+def countSchedule(btime,etime):
     """
     return rec num (int return[0]:TE /int return[1]:BS/CS)
     """
@@ -144,7 +139,7 @@ def count_schedule(btime,etime):
             retcount[1] = ret1[1]
     return retcount
 
-def search_schedule(btime,etime):
+def searchSchedule(btime,etime):
     """
     return rec num (int return[0]:TE /int return[1]:BS/CS)
     """
@@ -184,7 +179,7 @@ def search_schedule(btime,etime):
     ret = list(set(ret))
     return ret
 
-def count_epgschedule(epgbtime,epgetime):
+def countEpgSchedule(epgbtime,epgetime):
     """
     return rec num (int return[0]:TE /int return[1]:BS/CS)
     """
@@ -226,7 +221,7 @@ def count_epgschedule(epgbtime,epgetime):
         if retcount[1] < ret1[1]:
             retcount[1] = ret1[1]
     return retcount
-def search_epgschedule(epgbtime,epgetime):
+def searchEpgSchedule(epgbtime,epgetime):
     """
     return rec num (int return[0]:TE /int return[1]:BS/CS)
     """
index d6430ea..daac879 100644 (file)
@@ -68,7 +68,7 @@ def install():
     recdblist.printutf8(u"おめでとうございます 初期設定は完了しました。",verbose_level=100)
     recdblist.printutf8(u"rec10を実行するユーザーのcrontabに"+os.path.join(path,"rec10")+u"を追加してください(5分周期が目安)",verbose_level=100)
     
-def getpath(cmd):
+def getLocalPath(cmd):
     printutf8(cmd+u"の場所を確認中")
     txt=commands.getoutput(u"which "+cmd)
     if len(txt.split(" "))>3:
@@ -85,14 +85,14 @@ def move():
     printutf8(u"rec10 ver "+recdblist.version_str+" installer.")
     printutf8(u"rec10のインストールを開始します。")
     maxn=16
-    configwriter.setpath(u"wine", getpath(u"wine"))
-    configwriter.setpath(u"recpt1", getpath(u"recpt1"))
+    configwriter.setPath(u"wine", getLocalPath(u"wine"))
+    configwriter.setPath(u"recpt1", getLocalPath(u"recpt1"))
     #configwriter.setpath(u"x264", getpath(u"x264"))
-    configwriter.setpath(u"mp4box", getpath(u"MP4Box"))
-    configwriter.setpath(u"mencoder", getpath(u"mencoder"))
-    configwriter.setpath(u"ffmpeg", getpath(u"ffmpeg"))
-    configwriter.setpath(u"mkvmerge", getpath(u"mkvmerge"))
-    configwriter.setpath(u"b25", getpath(u"b25"))
+    configwriter.setPath(u"mp4box", getLocalPath(u"MP4Box"))
+    configwriter.setPath(u"mencoder", getLocalPath(u"mencoder"))
+    configwriter.setPath(u"ffmpeg", getLocalPath(u"ffmpeg"))
+    configwriter.setPath(u"mkvmerge", getLocalPath(u"mkvmerge"))
+    configwriter.setPath(u"b25", getLocalPath(u"b25"))
     printutf8(u"必須環境の設定が完了しました")
     printutf8(u"個人設定に入ります")
     if os.path.exists("/etc/rec10.conf"):
@@ -107,21 +107,21 @@ def move():
     printutf8(u"rec10の録画ファイルが置かれる場所を入力してください(1/"+str(maxn)+")")
     printutf8(u"100GB程度は確保されている必要があります")
     recpath=getConf(useB,"/etc/rec10.conf","path","recpath","path : ")
-    configwriter.setpath(u"recpath",recpath)
+    configwriter.setPath(u"recpath",recpath)
     printutf8(u"DBの設定に入ります。")
     printutf8(u"rec10が使用するMySQLのユーザーを設定してください。(2/"+str(maxn)+")")
     mysql_user=getConf(useB,"/etc/rec10.conf","db","mysql_user","mysql_user : ")
-    configwriter.setdbpath("mysql_user", mysql_user)
+    configwriter.setDBPath("mysql_user", mysql_user)
     printutf8(u"パスワードを設定してください(3/"+str(maxn)+")")
     mysql_passwd=getConf(useB,"/etc/rec10.conf","db","mysql_passwd","mysql_passwd : ")
-    configwriter.setdbpath("mysql_passwd", mysql_passwd)
+    configwriter.setDBPath("mysql_passwd", mysql_passwd)
     printutf8(u"同時録画可能数の設定に入ります")
     printutf8(u"TE(地デジ)録画可能数(PT*だと2 白Friioだと1)(4/"+str(maxn)+")")
     te_max=str(int(getConf(useB,"/etc/rec10.conf","env","te_max","te_max : ")))
-    configwriter.setenv("te_max", te_max)
+    configwriter.setEnv("te_max", te_max)
     printutf8(u"BS/CS110録画可能数(PT*だと2 黒Friioだと1)(5/"+str(maxn)+")")
     bscs_max=str(int(getConf(useB,"/etc/rec10.conf","env","bscs_max","bscs_max : ")))
-    configwriter.setenv("bscs_max", bscs_max)
+    configwriter.setEnv("bscs_max", bscs_max)
     printutf8(u"同時エンコード最大数を設定してください(6/"+str(maxn)+")")
     printutf8(u"CPUのコア数が目安です")
     enc_max=raw_input("[2]:")
@@ -129,43 +129,43 @@ def move():
         enc_max="2"
     else:
         enc_max=str(int(enc_max))
-    configwriter.setenv("enc_max", enc_max)
+    configwriter.setEnv("enc_max", enc_max)
     printutf8(u"二カ国語放送/5.1ch放送の音声変換の設定です。\nNeroAACエンコーダーを使用しますか?(NeroAACEncを別途入手してtstoolsに入れてください。))")
     printutf8(u"入手先:http://www.nero.com/jpn/technologies-aac-codec.html\n (7/"+str(maxn)+")")
     audioenc=raw_input("[y/N]:  ")
     if audioenc=="y" or audioenc=="Y":
-        configwriter.setpath("useNeroAAC", "1")
+        configwriter.setPath("useNeroAAC", "1")
         printutf8(u"NeroAACEncのパスを指定してください")
         aacpath=getConf(useB,"/etc/rec10.conf","path","NeroAAC","[/usr/local/bin/neroAacEnc] : ")
         if aacpath.replace(" ","")=="":
             aacpath="/usr/local/bin/neroAacEnc"
         configwriter.setpath("NeroAAC",aacpath)
     else:
-        configwriter.setpath("useNeroAAC", "0")
+        configwriter.setPath("useNeroAAC", "0")
         printutf8(u"lameを使用します。")
     printutf8(u"x264のパスを指定してください(7/"+str(maxn)+")")
     x264path=getConf(useB,"/etc/rec10.conf","path","x264","x264 path : ")
     if x264path.replace(" ","")=="" or not os.path.isfile(x264path):
-        x264path=getpath(u"x264")
-    configwriter.setpath("x264",x264path)
+        x264path=getLocalPath(u"x264")
+    configwriter.setPath("x264",x264path)
     printutf8(u"保存する画質を教えてください(8/"+str(maxn)+")")
     printutf8(u"x264のcrfの値です。標準だと30分で800MBほどになります")
     crf=getConf(useB,"/etc/rec10.conf","env","crf","[24] : ")
     if crf.replace(" ","")=="":
         crf="24"
-    configwriter.setenv("crf", crf)
+    configwriter.setEnv("crf", crf)
     printutf8(u"アニメーションを保存する画質を教えてください(9/"+str(maxn)+")")
     printutf8(u"x264のcrfの値です。標準だと30分で800MBほどになります")
     a_crf=getConf(useB,"/etc/rec10.conf","env","animation_crf","[20] : ")
     if a_crf.replace(" ","")=="":
         a_crf="20"
-    configwriter.setenv("animation_crf", a_crf)
+    configwriter.setEnv("animation_crf", a_crf)
     printutf8(u"x264の圧縮率を設定してください(10/"+str(maxn)+")")
     printutf8(u"x264のpresetの値です。標準だとmedium、小さければ小さいほど高圧縮になります")
     preset=getConf(useB,"/etc/rec10.conf","env","x264_preset","[4] : ")
     if preset.replace(" ","")=="":
         preset="4"
-    configwriter.setenv("x264_preset", preset)
+    configwriter.setEnv("x264_preset", preset)
     printutf8(u"保存するコンテナの設定(11/"+str(maxn)+")")
     printutf8(u"MP4を標準にしますか(もしくはMKVが使えます)")
     useMP4=raw_input("[y/N]:")
@@ -173,7 +173,7 @@ def move():
         useMP4="1"
     else:
         useMP4="0"
-    configwriter.setenv("make_mp4", useMP4)
+    configwriter.setEnv("make_mp4", useMP4)
     printutf8(u"TSファイルの自動削除(12/"+str(maxn)+")")
     printutf8(u"中間体のtsファイルを削除しますか")
     printutf8(u"(削除するとやり直しができないため残しておくことを推奨します。)")
@@ -182,7 +182,7 @@ def move():
         removeTS="1"
     else:
         removeTS="0"
-    configwriter.setenv("remove_ts", removeTS)
+    configwriter.setEnv("remove_ts", removeTS)
     printutf8(u"チャンネルの設定に入ります(13/"+str(maxn)+")")
     printutf8(u"rec10を設置する地域を選んでください。")
     printutf8(u"1:東京 2:神戸 3:名古屋 4:その他")
@@ -214,7 +214,7 @@ def move():
         bsok="1"
     else:
         bsok="0"
-    configwriter.setenv("bs", bsok)
+    configwriter.setEnv("bs", bsok)
     printutf8(u"CS放送(スカパーe2)は受信可能ですか?(15/"+str(maxn)+")")
     csok=raw_input("y/N:")
     if csok=="Y" or csok == "y" :
@@ -222,34 +222,34 @@ def move():
         printutf8(u"標準パックの番組は入力してありますがそれ以外は追加でchlist_cs.xmlに追加する必要があります。")
     else:
         csok="0"
-    configwriter.setenv("cs", csok)
+    configwriter.setEnv("cs", csok)
 
     printutf8(u"自機識別オプション(16/"+str(maxn)+")")
     printutf8(u"本rec10の識別名を入力してください")
     printutf8(u"複数台のrec10を運用する場合に効果的です。空白でもかまいません。")
     printutf8(u"例 kobe01")
     iff=getConf(useB,"/etc/rec10.conf","env","iff","[] : ")
-    configwriter.setenv("iff", iff)
+    configwriter.setEnv("iff", iff)
     confp = ConfigParser.SafeConfigParser()
     confp.read("/etc/rec10.conf")
     if useB:
-        configwriter.setpath("recorded",confp.get("path","recorded"))
-        configwriter.setpath("move_destpath",confp.get("path","move_destpath"))
+        configwriter.setPath("recorded",confp.get("path","recorded"))
+        configwriter.setPath("move_destpath",confp.get("path","move_destpath"))
         configwriter.setpath("tmp",confp.get("path","tmp"))
         try:
             configwriter.setenv("x264_addline",confp.get("env","x264_addline"))
         except:
-            configwriter.setenv("x264_addline","")
+            configwriter.setEnv("x264_addline","")
         if confp.get("path","b25_remote")=="":
             configwriter.setpath("b25_remote", "0")
         elif confp.get("path","b25_remote")=="1":
-            configwriter.setpath("b25_remote", confp.get("path","b25_remote"))
-            configwriter.setpath("b25", confp.get("path","b25"))
+            configwriter.setPath("b25_remote", confp.get("path","b25_remote"))
+            configwriter.setPath("b25", confp.get("path","b25"))
             configwriter.setpath("b25_env", confp.get("path","b25_env"))
         else:
-            configwriter.setpath("b25_remote", confp.get("path","b25_remote"))
+            configwriter.setPath("b25_remote", confp.get("path","b25_remote"))
 
-    configwriter.writeconf()
+    configwriter.writeConf()
     printutf8(u"初期設定が終了しました。")
     printutf8(u"makeを実行した後にrootにてmake installを実行するとインストールされます。")
 def getConf(useBeforeConf,Confpath,dbsection,key,defaultstr):
index 970f44c..37e3371 100644 (file)
@@ -22,7 +22,7 @@ def bigram(str1, str2):
             tmp = x
     point = 0
     for x in gram:
-        i = find_gram(x, str2)
+        i = findGram(x, str2)
         if i > 0:
             i = 90 + 10 * i
         else:
@@ -51,7 +51,7 @@ def trigram(str1, str2):
     point = 0
     count = 0
     for x in gram:
-        i = find_gram(x, str2)
+        i = findGram(x, str2)
         if i > 0:
             i = 90 + 10 * i
             count=count + 1
@@ -62,7 +62,7 @@ def trigram(str1, str2):
     point = point / len(str1) * 10
     point = point / len(str2) * 10
     return point
-def find_gram(gram, s):
+def findGram(gram, s):
     """
     s中にあらわれるgramの数を調べる
     """
@@ -72,7 +72,7 @@ def find_gram(gram, s):
         i = i + 1
         st = st[st.find(gram) + 1:]
     return i
-def get_noun_quad_gram(s):
+def getNounQuadGram(s):
     """
     。
     """
@@ -89,27 +89,27 @@ def get_noun_quad_gram(s):
             else:
                 tmps=tmp1 + tmp2 + tmp3 + x
                 if tmps.find(" ")<0:
-                    if zenhan.check_Character_Type(tmp1)>0:
-                        if (zenhan.check_Character_Type(tmp1)==zenhan.check_Character_Type(tmp2)):
-                            if (zenhan.check_Character_Type(tmp2)==zenhan.check_Character_Type(tmp3)):
-                                if (zenhan.check_Character_Type(tmp3)==zenhan.check_Character_Type(x)):
+                    if zenhan.checkCharacterType(tmp1)>0:
+                        if (zenhan.checkCharacterType(tmp1)==zenhan.checkCharacterType(tmp2)):
+                            if (zenhan.checkCharacterType(tmp2)==zenhan.checkCharacterType(tmp3)):
+                                if (zenhan.checkCharacterType(tmp3)==zenhan.checkCharacterType(x)):
                                     gram[tmps]=gram.get(tmps,0)+1
                                     skipnum=0
                                 else:
                                     skipnum=3
                             else:
-                                if (zenhan.check_Character_Type(tmp3)==zenhan.check_Character_Type(x)):
+                                if (zenhan.checkCharacterType(tmp3)==zenhan.checkCharacterType(x)):
                                     skipnum=2
                                 else:
                                     skipnum=3
                         else:
-                            if (zenhan.check_Character_Type(tmp2)==zenhan.check_Character_Type(tmp3)):
-                                if (zenhan.check_Character_Type(tmp3)==zenhan.check_Character_Type(x)):
+                            if (zenhan.checkCharacterType(tmp2)==zenhan.checkCharacterType(tmp3)):
+                                if (zenhan.checkCharacterType(tmp3)==zenhan.checkCharacterType(x)):
                                     skipnum=0
                                 else:
                                     skipnum=3
                             else:
-                                if (zenhan.check_Character_Type(tmp3)==zenhan.check_Character_Type(x)):
+                                if (zenhan.checkCharacterType(tmp3)==zenhan.checkCharacterType(x)):
                                     skipnum=2
                                 else:
                                     skipnum=3
index 2e33b23..f89c0b1 100644 (file)
@@ -13,13 +13,13 @@ path = str(os.path.dirname(os.path.abspath(__file__))) + "/"
 global rec10db
 def main():
     timerec.task()
-db = configreader.getdbpath("db")
+db = configreader.getDBPathSetting("db")
 if db == "MySQL":
-    dbn = configreader.getdbpath("mysql_dbname")
-    dbh = configreader.getdbpath("mysql_host")
-    dbu = configreader.getdbpath("mysql_user")
-    dbpwd = configreader.getdbpath("mysql_passwd")
-    dbport = int(configreader.getdbpath("mysql_port"))
+    dbn = configreader.getDBPathSetting("mysql_dbname")
+    dbh = configreader.getDBPathSetting("mysql_host")
+    dbu = configreader.getDBPathSetting("mysql_user")
+    dbpwd = configreader.getDBPathSetting("mysql_passwd")
+    dbport = int(configreader.getDBPathSetting("mysql_port"))
     rec10db = dbMySQL.DB_MySQL(dbname=dbn, host=dbh, user=dbu, passwd=dbpwd, port=dbport)
     rec10db.new_in_status()
 else:
index 4597da0..6361821 100644 (file)
@@ -51,7 +51,7 @@ def countRecNow_minutes_BSCS(dminutes):
     for i in d:
         t = i['type']
         if t == "key" or t == "keyevery" or t == "rec" or t == "res":
-            if len(chdb.chtxtsearch(i['chtxt'])['ch']) > 2:
+            if len(chdb.getChCSchFromCHtxt(i['chtxt'])['ch']) > 2:
                 ret = ret + 1
     return ret
 def countRecNow_minutes_TE(dminutes):
@@ -60,7 +60,7 @@ def countRecNow_minutes_TE(dminutes):
     for i in d:
         t = i['type']
         if t == "key" or t == "keyevery" or t == "rec" or t == "res":
-            if len(chdb.chtxtsearch(i['chtxt'])['ch']) < 3:
+            if len(chdb.getChCSchFromCHtxt(i['chtxt'])['ch']) < 3:
                 ret = ret + 1
     return ret
 def delete_old(dhour):
@@ -72,7 +72,7 @@ def delete_old_auto_keyword(dhour):
     rec10d.rec10db.delete_old_auto_timeline_keyword(dhour)
 def delete_old_auto_bayes(dhour):
     rec10d.rec10db.delete_old_auto_timeline_bayes(dhour)
-def getall():
+def getAll():
     return rec10d.rec10db.select_all_timeline()
 def rec_reclog(title,chtxt,btime,etime,opt,exp,longexp,category):
     rec10d.rec10db.add_in_timeline_log(chtxt,title,btime,etime,opt,exp,longexp,category)
index b0c8d7a..bcaa133 100644 (file)
@@ -83,8 +83,8 @@ global verbose_level_now
 global log_level_now
 
 try:
-    log_level_now=int(configreader.getlog("log_level"))
-    verbose_level_now=int(configreader.getlog("verbose_level"))
+    log_level_now=int(configreader.getLogSetting("log_level"))
+    verbose_level_now=int(configreader.getLogSetting("verbose_level"))
 except:
     log_level_now=900
     verbose_level_now=400
@@ -94,7 +94,7 @@ def printutf8(unicode,verbose_level=500):
             str=unicode.encode('utf-8')
             print str
         except Exception, inst:
-            recdblist.Commonlogex("Error", "printutf8(recdblist.py)", str(type(inst)), str(inst)+traceback.format_exc(),log_level=200)
+            recdblist.addCommonlogEX("Error", "printutf8(recdblist.py)", str(type(inst)), str(inst)+traceback.format_exc(),log_level=200)
 def printuft8ex(unicode,verbose_level=500,log_level=500):
     str=unicode.encode('utf-8')
     if verbose_level_now > verbose_level:
@@ -106,7 +106,7 @@ def printuft8ex(unicode,verbose_level=500,log_level=500):
             f=open(logfname,mode)
             f.write(str+"\n")
             f.close()
-def Commonlogex(type,place,inst,txt,verbose_level=500,log_level=500):
+def addCommonlogEX(type,place,inst,txt,verbose_level=500,log_level=500):
     lt=datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")+u":"
     if txt=="":
         lt=lt+u"["+type+u"] "+place+u" "+inst
@@ -123,9 +123,9 @@ def Commonlogex(type,place,inst,txt,verbose_level=500,log_level=500):
             f.write(lt+"\n")
             f.close()
 def addCommandLog(tspath,log_title,cmd,cmd_log=""):
-    addlog(tspath,cmd,log_title+u"ログ-コマンド")
-    addlog(tspath,cmd_log,log_title+u"ログ-詳細")
-def addlog(tspath,txt,log_title):
+    addLog(tspath,cmd,log_title+u"ログ-コマンド")
+    addLog(tspath,cmd_log,log_title+u"ログ-詳細")
+def addLog(tspath,txt,log_title):
     logo=tspath
     logo=logo.replace("_1.wav",".ts")
     logo=logo.replace("_2.wav",".ts")
index 872f1c9..77125f1 100644 (file)
@@ -18,7 +18,7 @@ def writeRecQue(parentpath,chtxt,title,opts):
     #optt=opts.replace("E","")
     #optt=optt.replace("D","")
     #optt=optt.replace("R","")
-    str="99"+","+datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")+","+configreader.getenv("iff")+","+chtxt+","+title+","+optt
+    str="99"+","+datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")+","+configreader.getEnvSetting("iff")+","+chtxt+","+title+","+optt
     f.write(str.encode('utf-8'))
     f.close()
 
@@ -62,5 +62,5 @@ def searchRecQue(folderpath):
                 readRecQue(os.path.join(folderpath, file))
                 os.remove(os.path.join(folderpath, file))
             except Exception, inst:
-                recdblist.Commonlogex("Error", "searchRecQue(recque.py)", str(type(inst)), str(inst)+traceback.format_exc(),log_level=200)
+                recdblist.addCommonlogEX("Error", "searchRecQue(recque.py)", str(type(inst)), str(inst)+traceback.format_exc(),log_level=200)
                 
\ No newline at end of file
index 8b11384..cc8aedb 100644 (file)
@@ -12,8 +12,8 @@ import rec10d
 import configreader
 import recdblist
 import tv2ts
-tmppath = configreader.getpath("tmp")+"/"
-tssplitterp = configreader.getpath("tssplitter")
+tmppath = configreader.getPathSetting("tmp")+"/"
+tssplitterp = configreader.getPathSetting("tssplitter")
 def searchCh():
     #地上デジタル
     for i in xrange(13,62):
@@ -73,7 +73,7 @@ def addCh(ch,bctype,chtxthead):
             else:
                 rec10d.rec10db.add_epg_ch(bctype,chtxthead+"_"+lstr, ch, lstr, u"2010-01-01 00:00:00")
         except Exception, inst:
-            recdblist.Commonlogex("Warning", "addCh (scan_ch.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
+            recdblist.addCommonlogEX("Warning", "addCh (scan_ch.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
 def getChProgNum(ch):
     pout=os.path.join(tmppath,"ch_"+str(ch)+".ts")
     tv2ts.tv2tsmix(pout, ch, "10")
@@ -103,8 +103,8 @@ def getTsProgNum(ch,tspath):
             ret.append(str(int(l)))
         except:
             ""
-    recdblist.addlog(pin, doexe, u"TsSplitログ-コマンド")
-    recdblist.addlog(pin, txt, u"TsSplitログ-詳細")
+    recdblist.addLog(pin, doexe, u"TsSplitログ-コマンド")
+    recdblist.addLog(pin, txt, u"TsSplitログ-詳細")
     time.sleep(1)
     try:
         ""
index f5fb4a3..1248e57 100755 (executable)
@@ -38,4 +38,4 @@ def getSettings_auto_opt():
     return rec10d.rec10db.select_all_in_settings()[0][3]
 
 def getRecordingMax():
-    return [int(configreader.getenv("te_max")),int(configreader.getenv("bscs_max"))]
+    return [int(configreader.getEnvSetting("te_max")),int(configreader.getEnvSetting("bscs_max"))]
index 37294de..94b8b12 100644 (file)
@@ -43,4 +43,4 @@ recpath = "/home/ftpusr/ftp-tmp/Recording/"
 ftpusr = "/home/ftpusr/ftp-tmp"
 recordedpath = u"/home/ftpusr/ftp-video"
 if __name__ == "__main__":
-    print ts2x264.get_x264core_version()
\ No newline at end of file
+    print ts2x264.getX264CoreVersion()
\ No newline at end of file
index 6965e52..caef0a2 100644 (file)
@@ -26,8 +26,8 @@ import tv2mp4
 import install
 import recdblist
 import recque
-recpath = configreader.getpath('recpath')
-movepath = configreader.getpath('move_destpath')
+recpath = configreader.getPathSetting('recpath')
+movepath = configreader.getPathSetting('move_destpath')
 path = str(os.path.dirname(os.path.abspath(__file__))) + "/"
 def task():
     """
@@ -84,15 +84,15 @@ def task():
                 if bctype.find('te') > -1:
                     recnum = status.getTERecording() + recdb.countRecNow_minutes_TE("10")
                     recdblist.printutf8(u"放送種別:"+bctype + u"||該当チューナー実行中件数:" + str(status.getTERecording()) + u":直近予約件数:" + str(recdb.countRecNow_minutes_TE("10")),verbose_level=800)
-                    recnum = int(configreader.getenv("te_max")) -recnum
+                    recnum = int(configreader.getEnvSetting("te_max")) -recnum
                 else:
                     recnum = status.getBSCSRecording() + recdb.countRecNow_minutes_BSCS("10")
                     recdblist.printutf8(u"放送種別:"+bctype + u"||該当チューナー実行中件数:" + str(status.getBSCSRecording()) + u":直近予約件数:" + str(recdb.countRecNow_minutes_BSCS("10")),verbose_level=800)
-                    recnum = int(configreader.getenv("bscs_max")) -recnum
+                    recnum = int(configreader.getEnvSetting("bscs_max")) -recnum
                 if recnum >0 :
                     recdblist.printutf8(str(update),verbose_level=750)
                     rec10d.rec10db.update_status_by_bctype_epg_ch(bctype, "0")
-                    epgdb.updatebc(bctype)
+                    epgdb.updateForBctype(bctype)
                     update = chdb.update()
                     i = i + 1
                 if i > 0:
@@ -197,7 +197,7 @@ def task():
                 else:
                     makeMP4=0
                     try:
-                        if configreader.getenv("make_mp4")==1:
+                        if configreader.getEnvSetting("make_mp4")==1:
                             makeMP4=1
                     except:
                         ""
@@ -221,7 +221,7 @@ def task():
                 else:
                     makeMP4=0
                     try:
-                        if configreader.getenv("make_mp4")==1:
+                        if configreader.getEnvSetting("make_mp4")==1:
                             makeMP4=1
                     except:
                         ""
@@ -254,7 +254,7 @@ def search_keyword(key):
     tnow = datetime.datetime.now()
     nows =tnow.strftime("%Y-%m-%d %H:%M:%S")
     for k,auto,opt in key:
-        recdatum = epgdb.searchtime_auto(k,nows, "144")
+        recdatum = epgdb.searchTimeAuto(k,nows, "144")
         for recdata in recdatum:
             if recdata[1] != "":
                 chtxtt = recdata[0]
@@ -274,20 +274,20 @@ def search_keyword(key):
                         maxnum=0
                         if len(ch['ch'])>2:
                             maxnum=epgdb.count_schedule_timeline(btimet, etimet)[1]
-                            maxnum=int(configreader.getenv("bscs_max"))-maxnum
+                            maxnum=int(configreader.getEnvSetting("bscs_max"))-maxnum
                         else:
                             maxnum=epgdb.count_schedule_timeline(btimet, etimet)[0]
-                            maxnum=int(configreader.getenv("te_max"))-maxnum
+                            maxnum=int(configreader.getEnvSetting("te_max"))-maxnum
                         if maxnum>0:
                             if recdb.checkduplicate(titlet, chtxtt, btimet, etimet)==0:
                                 recdb.recreserv(titlet,chtxtt, btimet, etimet,topt)
                     except Exception, inst:
-                        recdblist.Commonlogex("Error", "search_keyword_auto_jbk(timerec.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
+                        recdblist.addCommonlogEX("Error", "search_keyword_auto_jbk(timerec.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
                 else:
                     try:
                         recdb.add_auto_keyword(chtxtt, titlet, btimet, etimet)
                     except Exception, inst:
-                        recdblist.Commonlogex("Error", "search_keyword(timerec.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
+                        recdblist.addCommonlogEX("Error", "search_keyword(timerec.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
 def type_reserve(typetxt,chtxt,title,bt,et,opt):
     btime = bt.strftime("%Y-%m-%d %H:%M:%S")
     etime = et.strftime("%Y-%m-%d %H:%M:%S")
@@ -299,12 +299,12 @@ def type_reserve(typetxt,chtxt,title,bt,et,opt):
     dtt = bt-tnow
     dt = dtt.days * 24 * 60 * 60 + dtt.seconds
     if (dt < 58 * 60 and dt > 30 * 60):
-        bctypet = chdb.chtxtsearch(chtxt)['bctype']
+        bctypet = chdb.searchFromCHtxt(chtxt)['bctype']
         chdatat = rec10d.rec10db.select_by_bctype_epg_ch(bctypet)
         dt1 = datetime.datetime.strptime(chdatat[0][4], "%Y-%m-%d %H:%M:%S")-datetime.datetime.now()
         dt1 = dt1.days * 24 * 60 * 60 + dt1.seconds
         if dt1 < 60 * 60:
-            recdata = epgdb.searchtime2(title, btime, "5", chtxt)
+            recdata = epgdb.searchTime(title, btime, "5", chtxt)
             chtxtn = recdata[0]
             titlen = recdata[1]
             btimen = recdata[2]
@@ -321,11 +321,11 @@ def type_reserve(typetxt,chtxt,title,bt,et,opt):
                     recdb.del_reckey(typetxtnow, title, chtxt, btime)
                     recdb.rec_reckey(typetxtfinal, titlen, chtxtn, btimen, etimen, opt)
                     recdb.rec_reclog(titlen, chtxtn, btimen, etimen, opt, exp, longexp, category)
-                    auto_rec.add_key(chtxt, titlen,exp+" "+longexp)
-                    auto_rec.add_key("ALL", titlen,exp+" "+longexp)
+                    auto_rec.addKey(chtxt, titlen,exp+" "+longexp)
+                    auto_rec.addKey("ALL", titlen,exp+" "+longexp)
                     recdblist.printutf8(u"追いかけ機能実行中: "+title+" : "+titlen+" "+btimen+" "+etimen)
                 except Exception, inst:
-                    recdblist.Commonlogex("Error", "Oikake DB(timerec.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
+                    recdblist.addCommonlogEX("Error", "Oikake DB(timerec.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
             else:
                 recdblist.printutf8(u"追いかけ機能エラー:番組データが見付かりません。")
         else:
@@ -333,7 +333,7 @@ def type_reserve(typetxt,chtxt,title,bt,et,opt):
                 rec10d.rec10db.update_status_by_bctype_epg_ch(bctypet, "3")
         sys.exit()
     elif (dt <= 30 * 60 and dt > 20 * 60):
-        recdata = epgdb.searchtime2(title, btime, "5", chtxt)
+        recdata = epgdb.searchTime(title, btime, "5", chtxt)
         chtxtn = recdata[0]
         titlen = recdata[1]
         btimen = recdata[2]
@@ -350,18 +350,18 @@ def type_reserve(typetxt,chtxt,title,bt,et,opt):
                 recdb.del_reckey(typetxtnow, title, chtxt, btime)
                 recdb.rec_reckey(typetxtfinal, titlen, chtxtn, btimen, etimen, opt)
                 recdb.rec_reclog(titlen, chtxtn, btimen, etimen, opt, exp, longexp, category)
-                auto_rec.add_key(chtxt, titlen,exp+" "+longexp)
-                auto_rec.add_key("ALL", titlen,exp+" "+longexp)
+                auto_rec.addKey(chtxt, titlen,exp+" "+longexp)
+                auto_rec.addKey("ALL", titlen,exp+" "+longexp)
                 #recdblist.printutf8(u"追いかけ機能実行中: "+title+" : "+titlen+" "+btimen+" "+etimen)
-                recdblist.Commonlogex(u"通常", "Oikake (timerec.py)",u"追いかけ機能実行中",u"追いかけ機能実行中: "+title+" : "+titlen+" "+btimen+" "+etimen,log_level=500)
+                recdblist.addCommonlogEX(u"通常", "Oikake (timerec.py)",u"追いかけ機能実行中",u"追いかけ機能実行中: "+title+" : "+titlen+" "+btimen+" "+etimen,log_level=500)
             except Exception, inst:
-                recdblist.Commonlogex("Error", "Oikake DB(timerec.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
+                recdblist.addCommonlogEX("Error", "Oikake DB(timerec.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
     elif dt <= 20 * 60:
         try:
             recdb.del_reckey(typetxtnow, title, chtxt, btime)
             recdb.rec_reckey(typetxtfinal, title, chtxt, btime, etime, opt)
         except Exception, inst:
-            recdblist.Commonlogex("Error", "Oikake DB(timerec.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
+            recdblist.addCommonlogEX("Error", "Oikake DB(timerec.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
 def type_final(typetxt,chtxt,title,bt,et,opt):
     btime = bt.strftime("%Y-%m-%d %H:%M:%S")
     etime = et.strftime("%Y-%m-%d %H:%M:%S")
@@ -389,13 +389,13 @@ def type_final(typetxt,chtxt,title,bt,et,opt):
         if re.search("N", opt) or tcheck>0:
             iff=""
             try:
-                iff=u"("+configreader.getenv("iff")+u")_"
+                iff=u"("+configreader.getEnvSetting("iff")+u")_"
             except:
                 iff=""
             newtime=bt
             newtitle=newtitle+u"_"+iff+newtime.strftime("%Y-%m-%dT%H-%M-%S")
         recdb.rec_reckey(typetxting, newtitle, chtxt, btime, etime, opt)
-        recdblist.Commonlogex(u"通常","timerec.py",u"録画開始 "+newtitle+" "+btime+" "+etime,"",log_level=500)
+        recdblist.addCommonlogEX(u"通常","timerec.py",u"録画開始 "+newtitle+" "+btime+" "+etime,"",log_level=500)
         tv2avi.timetv2b25(recpath + "/" + newtitle + ".avi", chtxt, btime, etime, opt)
         recdb.del_reckey(typetxting, newtitle, chtxt, btime)
         if not re.search("R", opt):
@@ -424,7 +424,7 @@ def type_final(typetxt,chtxt,title,bt,et,opt):
                 except:
                     ""
             except Exception, inst:
-                recdblist.Commonlogex("Error", "Move option(timerec.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
+                recdblist.addCommonlogEX("Error", "Move option(timerec.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
             recdb.rec_reckey(recdblist.REC_MOVE_END, newtitle, chtxt, btime, etime, opt)
         sys.exit()
 def type_keyword(typetxt,chtxt,title,bt,et,opt,deltatime):
@@ -439,7 +439,7 @@ def type_keyword(typetxt,chtxt,title,bt,et,opt,deltatime):
     dt = dtt.days * 24 * 60 * 60 + dtt.seconds
     recdblist.printutf8(str(dt), verbose_level=800)
     if dt < 90 * 60:
-        recdata = epgdb.searchtime2(title, btime, deltatime, chtxt)
+        recdata = epgdb.searchTime(title, btime, deltatime, chtxt)
         if recdata[1] != "":
             chtxtt = recdata[0]
             titlet = recdata[1]
@@ -456,9 +456,9 @@ def type_keyword(typetxt,chtxt,title,bt,et,opt,deltatime):
             recdb.del_reckey(typetxtnow, title, chtxt, btime)
             recdb.rec_reckey(typetxtres, titlet, chtxt, btimet, etimet, opt)
             recdb.rec_reclog(titlet, chtxtt, btimet, etimet, opt, exp,longexp,category)
-            auto_rec.add_key(chtxt, titlet,exp+" "+longexp)
-            auto_rec.add_key("ALL", titlet,exp+" "+longexp)
-            recdblist.Commonlogex(u"通常","timerec.py",u"key "+title+u" : "+titlet+u" "+btimet+u" "+etimet,"",log_level=500)
+            auto_rec.addKey(chtxt, titlet,exp+" "+longexp)
+            auto_rec.addKey("ALL", titlet,exp+" "+longexp)
+            recdblist.addCommonlogEX(u"通常","timerec.py",u"key "+title+u" : "+titlet+u" "+btimet+u" "+etimet,"",log_level=500)
             #except Exception, inst:
             #    recdblist.printutf8("Error happened in REC_KEYWORD DB")
             #    recdblist.printutf8(type(inst))
@@ -489,7 +489,7 @@ def type_keyword_every_day(type,chtxt,title,bt,et,opt,deltatime,deltaday,counter
             recdb.everyreserv(title, chtxt, btxt, etxt, deltatime, opt, deltaday,counter-1)
         elif counter==-1:
             recdb.everyreserv(title, chtxt, btxt, etxt, deltatime, opt, deltaday,-1)
-        recdata = epgdb.searchtime2(title, btime, deltatime, chtxt)
+        recdata = epgdb.searchTime(title, btime, deltatime, chtxt)
         if recdata[1] != "":
             chtxtt = recdata[0]
             titlet = recdata[1]
@@ -567,7 +567,7 @@ def type_decode_que(typetxt,chtxt,title,bt,et,opt):
                     errtxt1="move ts error.\n"
                     errtxt2=str(type(inst))+"\n"
                     errtxt2=errtxt2+str(inst)
-                    recdblist.Commonlogex("Error", "type_decode_que(timerec.py)", errtxt1,errtxt2+traceback.format_exc(),log_level=200)
+                    recdblist.addCommonlogEX("Error", "type_decode_que(timerec.py)", errtxt1,errtxt2+traceback.format_exc(),log_level=200)
                 recdb.rec_reckey(recdblist.REC_MOVE_END, title, chtxt, btime, etime, opt)
         else:
             recdb.del_reckey(typetxtnow, title, chtxt, btime)
@@ -591,7 +591,7 @@ def type_encode_que(typetxt,chtxt,title,bt,et,opt):
         typetxting=recdblist.REC_ENCODE_LOCAL
         typetxtfin=recdblist.REC_FIN_LOCAL
     if dt < 10 * 60:
-        if status.getEncoding() < int(configreader.getenv("enc_max")):
+        if status.getEncoding() < int(configreader.getEnvSetting("enc_max")):
             recdb.del_reckey(typetxtnow, title, chtxt, btime)
             recdb.rec_reckey(typetxting, title, chtxt, btime, etime, opt)
             recdblist.printutf8(opt)
@@ -614,7 +614,7 @@ def type_encode_que(typetxt,chtxt,title,bt,et,opt):
                 time.sleep(3)
             makeMP4=0
             try:
-                if configreader.getenv("make_mp4")=="1":
+                if configreader.getEnvSetting("make_mp4")=="1":
                     makeMP4=1
             except:
                 ""
@@ -700,7 +700,7 @@ def type_encode_que(typetxt,chtxt,title,bt,et,opt):
                     errtxt1="move mkv/mp4 error."
                     errtxt2=str(type(inst))+"\n"
                     errtxt2=errtxt2+str(inst)
-                    recdblist.Commonlogex("Error", "type_encode_que(timerec.py)", errtxt1,errtxt2+traceback.format_exc(),log_level=200)
+                    recdblist.addCommonlogEX("Error", "type_encode_que(timerec.py)", errtxt1,errtxt2+traceback.format_exc(),log_level=200)
                 recdb.rec_reckey(recdblist.REC_MOVE_END, title, chtxt, btime, etime, opt)
             recdb.rec_reckey(typetxtfin, title, chtxt, btime, etime, opt)
             sys.exit()
index 6214e30..e222d6e 100644 (file)
@@ -21,12 +21,12 @@ def write(pout, ch):
         timet = "180"
     elif len(ch)>2:
         timet = "240"
-    write_time(pout, ch ,timet)
-def write_time(pout, ch ,times):
+    writeTime(pout, ch ,timet)
+def writeTime(pout, ch ,times):
     """
     指定された時間分tsを取得してepgの入ったxmlとして書き出す
     """
-    recdblist.Commonlogex(u"通常","write_time(ts2epg.py)",u"Ts-EPG XML書き出し処理開始" ,u"CH:"+ch,log_level=500)
+    recdblist.addCommonlogEX(u"通常","write_time(ts2epg.py)",u"Ts-EPG XML書き出し処理開始" ,u"CH:"+ch,log_level=500)
     timet = times
     if re.search(u'CS', ch):
         mode = "/CS"
@@ -34,14 +34,14 @@ def write_time(pout, ch ,times):
         mode = "/BS"
     else:
         mode = str(chdb.bctypesearch(u'te' + ch)['ch'])
-    epgdump = configreader.getpath("epgdump")
+    epgsearchFromBctypegreader.getPathSetting("epgdump")
     if os.access(pout + ".ts", os.F_OK):
         os.remove(pout + ".ts")
     time.sleep(10)
     tv2ts.tv2tsmix(pout + ".ts", ch, timet)
     exe = "export LANG=ja_JP.UTF-8 && nice -n 15 " + epgdump + " " + mode + " " + pout + ".ts " + pout
     recdblist.printutf8(exe)
-    recdblist.Commonlogex(u"通常", "write_time(ts2epg.py)", exe,"",log_level=500)
+    recdblist.addCommonlogEX(u"通常", "write_time(ts2epg.py)", exe,"",log_level=500)
     os.system(exe)
     time.sleep(10)
 
index 0043e62..aebf113 100644 (file)
@@ -21,8 +21,8 @@ def ts2x264(pin, pout, opts):#sizeは"HD"か"SD"
     size="HD"
     crf=18
     quality=4
-    quality=int(configreader.getenv("x264_preset"))
-    crf=int(configreader.getenv("crf"))
+    quality=int(configreader.getEnvSetting("x264_preset"))
+    crf=int(configreader.getEnvSetting("crf"))
     deinterlace=1
     if re.search("H", opts):
         size = "HD"
@@ -40,10 +40,10 @@ def ts2x264(pin, pout, opts):#sizeは"HD"か"SD"
         crf=crf+2
     if re.search("v", opts):
         is24fps=1
-        crf=int(configreader.getenv("animation_crf"))
+        crf=int(configreader.getEnvSetting("animation_crf"))
     if re.search("a", opts):
         is24fps=1
-        crf=int(configreader.getenv("animation_crf"))
+        crf=int(configreader.getEnvSetting("animation_crf"))
     if re.search("I", opts):
         deinterlace=0
     if re.search("q",opts):
@@ -64,17 +64,17 @@ def ts2x264(pin, pout, opts):#sizeは"HD"か"SD"
         crf=crf-2
     if re.search("d",opts):#二カ国語放送の場合
         tm2v=pin.replace(".ts",".m2v")
-        encode_ffmpeg_sar(tm2v,pout,size,is24fps,quality,crf,deinterlace)
+        encodeFFmpegSar(tm2v,pout,size,is24fps,quality,crf,deinterlace)
     elif re.search("5",opts):#5.1chの場合
-        encode_ffmpeg_sar(pin,pout,size,is24fps,quality,crf,deinterlace)
+        encodeFFmpegSar(pin,pout,size,is24fps,quality,crf,deinterlace)
     else:
         try:
-            encode_sar(pin, pout,size,is24fps,quality,crf,deinterlace)
+            encodeSar(pin, pout,size,is24fps,quality,crf,deinterlace)
         except Exception, inst:
-            recdblist.Commonlogex("Error", "ts2x264(ts2x264.py)", str(type(inst)), str(inst)+traceback.format_exc(),log_level=200)
-def encode_sar(pin,pout,size,is24fps,quality,crf,deinterlace=1):
-    mencoder=configreader.getpath("mencoder")
-    encvf=""
+            recdblist.addCommonlogEX("Error", "ts2x264(ts2x264.py)", str(type(inst)), str(inst)+traceback.format_exc(),log_level=200)
+def encodeSar(pin,pout,size,is24fps,quality,crf,deinterlace=1):
+    mencoder=configreader.getPathSetting("mencoder")
+    egetPath
     txt=""
     encvf="-sws 9 -vf yadif=0,pp=l5"
     harddup=",hqdn3d=2:1:2,unsharp=l3x3:0.75:c3x3:0.75,harddup"
@@ -95,32 +95,32 @@ def encode_sar(pin,pout,size,is24fps,quality,crf,deinterlace=1):
         encvf="-sws 9 -vf pullup,softskip"
         harddup=",pp=l5,unsharp=l3x3:0.75:c3x3:0.75,hqdn3d=2:1:2,harddup"
     if size == "HD":
-        tsize=get_par_size(pin,720)
+        tsize=getParSize(pin,720)
         encvf = encvf + ",scale=-3:720::0:3"+harddup
         x264streamsize=str(tsize[0])+u"x720"
         x264_bitrate="2500"
     elif size == "WVGA":
-        tsize=get_par_size(pin,480)
+        tsize=getParSize(pin,480)
         encvf = encvf + ",scale=-3:480::0:3"+harddup
         x264streamsize=str(tsize[0])+u"x480"
         x264_bitrate="1500"
     elif size == "FullHD":
-        tsize=get_par_size(pin,1080)
+        tsize=getParSize(pin,1080)
         encvf = encvf + ",scale=-3:1080::0:3"+harddup
         x264streamsize=str(tsize[0])+u"x1080"
         x264_bitrate="5000"
     elif size == "QVGA_BASE":
-        tsize=get_par_size(pin,240)
+        tsize=getParSize(pin,240)
         encvf = encvf + ",scale=-3:240::0:3"+harddup
         x264streamsize=str(tsize[0])+u"x240"
         x264_bitrate="300"
     elif size == "WVGA_BASE":
-        tsize=get_par_size(pin,480)
+        tsize=getParSize(pin,480)
         encvf = encvf + ",scale=-3:480::0:3"+harddup
         x264streamsize=str(tsize[0])+u"x480"
         x264_bitrate="1500"
     else:
-        tsize=get_par_size(pin,720)
+        tsize=getParSize(pin,720)
         encvf = encvf + ",scale=-3:720::0:3"+harddup
         x264streamsize=str(tsize[0])+u"x720"
         x264_bitrate="2500"
@@ -171,7 +171,7 @@ def encode_sar(pin,pout,size,is24fps,quality,crf,deinterlace=1):
     streampath=os.path.join(os.path.dirname(pin),str(random.randint(10000, 99999999)))
     os.system(u"mkfifo "+streampath)
     encexe=mencoder+u" \""+pin+u"\" -vfm ffmpeg -quiet "+encvf+u",format=i420 "+fps+" "+ofps+" -oac mp3lame -ovc raw -of rawvideo -o \""+streampath+"\" & "
-    encexe=encexe+get_x264_commandline(x264preset, x264sar, x264fps, x264profile, x264tune, pout, streampath, x264streamsize, crf=x264crf)
+    encexe=encexe+getX264Commandline(x264preset, x264sar, x264fps, x264profile, x264tune, pout, streampath, x264streamsize, crf=x264crf)
     #encexe=encexe+u" nice -n 19 "+x264+" "+x264_sar+" "+x264crf+u" "+x264_addline+u"  --threads "+x264_thread+" "+x264profile+x264preset+" "+x264tune+" "+x264fps+" -o \""+pout+"\" "+streampath+" "+x264streamsize
     encexe=u"nice -n 19 " +encexe
     recdblist.printutf8(encexe)
@@ -182,11 +182,11 @@ def encode_sar(pin,pout,size,is24fps,quality,crf,deinterlace=1):
         ""
     os.system("rm "+streampath)
     recdblist.addCommandLog(pin, u"Mencoder", encexe, txt)
-def encode_ffmpeg_sar(pin,pout,size,is24fps,quality,crf,deinterlace=1):
+def encodeFFmpegSar(pin,pout,size,is24fps,quality,crf,deinterlace=1):
     """
 
     """
-    ffmpeg=configreader.getpath("ffmpeg")
+    ffmpeg=configreader.getPathSetting("ffmpeg")
     fps=u"-r 29.970030 "
     x264fps="30000/1001"
     x264streamsize=""
@@ -198,37 +198,37 @@ def encode_ffmpeg_sar(pin,pout,size,is24fps,quality,crf,deinterlace=1):
     filter="-deinterlace"
     x264sar=str(tsar[0])+":"+str(tsar[1])
     if size == "HD":
-        tsize=get_par_size(pin,720)
+        tsize=getParSize(pin,720)
         s = "-s "+str(tsize[0])+"x720 "
         x264streamsize=str(tsize[0])+u"x720"
         x264_bitrate="2500"
     elif size == "WVGA":
-        tsize=get_par_size(pin,480)
+        tsize=getParSize(pin,480)
         s = "-s "+str(tsize[0])+"x480 "
         x264streamsize=str(tsize[0])+u"x480"
         x264_bitrate="1500"
     elif size == "FullHD":
-        tsize=get_par_size(pin,1080)
+        tsize=getParSize(pin,1080)
         s = "-s "+str(tsize[0])+"x1080 "
         x264streamsize=str(tsize[0])+u"x1080"
         x264_bitrate="5000"
     elif size == "SD":
-        tsize=get_par_size(pin,480)
+        tsize=getParSize(pin,480)
         s = "-s "+str(tsize[0])+"x480 "
         x264streamsize=str(tsize[0])+u"x480"
         x264_bitrate="1250"
     elif size == "QVGA_BASE":
-        tsize=get_par_size(pin,240)
+        tsize=getParSize(pin,240)
         s = "-s "+str(tsize[0])+"x240 "
         x264streamsize=str(tsize[0])+u"x240"
         x264_bitrate="300"
     elif size == "WVGA_BASE":
-        tsize=get_par_size(pin,480)
+        tsize=getParSize(pin,480)
         s = "-s "+str(tsize[0])+"x480 "
         x264streamsize=str(tsize[0])+u"x480"
         x264_bitrate="1500"
     else:
-        tsize=get_par_size(pin,720)
+        tsize=getParSize(pin,720)
         s = "-s "+str(tsize[0])+"x720 "
         x264streamsize=str(tsize[0])+u"x720"
         x264_bitrate="2500"
@@ -260,7 +260,7 @@ def encode_ffmpeg_sar(pin,pout,size,is24fps,quality,crf,deinterlace=1):
     txt=""
     os.environ['LANG']="ja_JP.UTF-8"
     exe=ffmpeg+u" -y -i \""+pin+"\" -vsync 400 -vcodec rawvideo -pix_fmt yuv420p "+s+fps+" "+filter+" -an -f rawvideo - | "
-    exe=exe+get_x264_commandline(x264preset, x264sar, x264fps, x264profile, x264tune, pout,"-", x264streamsize, crf=x264crf)
+    exe=exe+getX264Commandline(x264preset, x264sar, x264fps, x264profile, x264tune, pout,"-", x264streamsize, crf=x264crf)
     exe = "nice -n 19 " + exe
     txt=""
     recdblist.printutf8(exe)
@@ -270,7 +270,7 @@ def encode_ffmpeg_sar(pin,pout,size,is24fps,quality,crf,deinterlace=1):
         ""
     recdblist.addCommandLog(pin, u"FFmpeg動画エンコード", exe, txt)
 def getMovieBaseSize(pin):
-    ffmpeg=configreader.getpath("ffmpeg")
+    ffmpeg=configreader.getPathSetting("ffmpeg")
     os.environ['LANG']="ja_JP.UTF-8"
     exe=ffmpeg+u" -i \""+pin+"\" 2>&1"
     txts=unicode(commands.getoutput(exe.encode('utf-8')),'utf-8','ignore')
@@ -292,7 +292,7 @@ def getMovieBaseSize(pin):
                 sizeMaxY=tY
     return [sizeMaxX,sizeMaxY]
 def getMovieBaseSize2(pin):##動画開始後すぐに解像度が変更されたときに対処
-    ffmpeg=configreader.getpath("ffmpeg")
+    ffmpeg=configreader.getPathSetting("ffmpeg")
     os.environ['LANG']="ja_JP.UTF-8"
     exe=ffmpeg+u" -ss 5 -fs 1 -i \""+pin+"\" \""+pin+".size.ts\" 2>&1"
     txts=unicode(commands.getoutput(exe.encode('utf-8')),'utf-8','ignore')
@@ -315,7 +315,7 @@ def getMovieBaseSize2(pin):##動画開始後すぐに解像度が変更された
     os.remove(pin+".size.ts")
     return [sizeMaxX,sizeMaxY]
 def getMoviePAR(pin):
-    ffmpeg=configreader.getpath("ffmpeg")
+    ffmpeg=configreader.getPathSetting("ffmpeg")
     os.environ['LANG']="ja_JP.UTF-8"
     exe=ffmpeg+u" -i \""+pin+"\" 2>&1"
     txts=unicode(commands.getoutput(exe.encode('utf-8')),'utf-8','ignore')
@@ -343,7 +343,7 @@ def getMoviePAR(pin):
                     pary=tEY
     return [parx,pary]
 def getMoviePAR2(pin):
-    ffmpeg=configreader.getpath("ffmpeg")
+    ffmpeg=configreader.getPathSetting("ffmpeg")
     os.environ['LANG']="ja_JP.UTF-8"
     exe=ffmpeg+u" -ss 5 -fs 1 -i \""+pin+"\" \""+pin+".size.ts\" 2>&1"
     txts=unicode(commands.getoutput(exe.encode('utf-8')),'utf-8','ignore')
@@ -372,7 +372,7 @@ def getMoviePAR2(pin):
     os.remove(pin+".size.ts")
     return [parx,pary]
 def getMovieDAR(pin):
-    ffmpeg=configreader.getpath("ffmpeg")
+    ffmpeg=configreader.getPathSetting("ffmpeg")
     os.environ['LANG']="ja_JP.UTF-8"
     exe=ffmpeg+u" -i \""+pin+"\" 2>&1"
     txts=unicode(commands.getoutput(exe.encode('utf-8')),'utf-8','ignore')
@@ -400,7 +400,7 @@ def getMovieDAR(pin):
                     dary=tEY
     return [darx,dary]
 def getMovieDAR2(pin):
-    ffmpeg=configreader.getpath("ffmpeg")
+    ffmpeg=configreader.getPathSetting("ffmpeg")
     os.environ['LANG']="ja_JP.UTF-8"
     exe=ffmpeg+u" -ss 5 -fs 1 -i \""+pin+"\" \""+pin+".size.ts\" 2>&1"
     txts=unicode(commands.getoutput(exe.encode('utf-8')),'utf-8','ignore')
@@ -428,7 +428,7 @@ def getMovieDAR2(pin):
                     dary=tEY
     os.remove(pin+".size.ts")
     return [darx,dary]
-def get_par_size(pin,y):
+def getParSize(pin,y):
     tSize=getMovieBaseSize2(pin)
     if tSize[1] != 0 :
         tX=tSize[0]*10*y/tSize[1]
@@ -441,8 +441,8 @@ def get_par_size(pin,y):
         tX=-1
         tY=-1
     return [tX,tY]
-def get_x264core_version():
-    x264=configreader.getpath("x264")
+def getX264CoreVersion():
+    x264=configreader.getPathSetting("x264")
     t1=commands.getoutput(x264+" --help|grep core")
     rT=re.compile(u"x264 core:(\d*)[\d]*.*\Z")
     rM=rT.match(t1)
@@ -450,8 +450,8 @@ def get_x264core_version():
     if rM:
         v=int(rM.group(1))
     return v
-def get_x264_commandline(preset,sar,fps,x264profile,x264tune,pout,pin,x264streamsize,crf=-1,bitrate=0):
-    x264=configreader.getpath("x264")
+def getX264Commandline(preset,sar,fps,x264profile,x264tune,pout,pin,x264streamsize,crf=-1,bitrate=0):
+    x264=configreader.getPathSetting("x264")
     os.environ['LANG']="ja_JP.UTF-8"
     x264_sar="--sar "+sar
     x264preset=u"--preset "+preset
@@ -460,17 +460,17 @@ def get_x264_commandline(preset,sar,fps,x264profile,x264tune,pout,pin,x264stream
         x264bitrate=u"--bitrate "+str(bitrate)
     else:
         x264crf=u"--crf "+str(crf)
-    x264_addline=configreader.getenv("x264_addline")
+    x264_addline=configreader.getEnvSetting("x264_addline")
     x264_thread="auto"
     try:
-        xtt=configreader.getenv("x264_thread")
+        xtt=configreader.getEnvSetting("x264_thread")
         xtt=int(xtt)
         if xtt>0:
             x264_thread=str(xtt)
     except:
         x264_thread="auto"
-    x264_addline=configreader.getenv("x264_addline")
-    if get_x264core_version()>103:
+    x264_addline=configreader.getEnvSetting("x264_addline")
+    if getX264CoreVersion()>103:
         x264res=u"--input-res "+x264streamsize
         exe=u"nice -n 19 "+x264+" "+x264_sar+" "+x264crf+u" "+x264_addline+u" --colormatrix bt709 --threads "+x264_thread+" "+x264profile+x264preset+" "+x264tune+" "+x264fps+" "+x264res+" -o \""+pout+"\" "+pin
     else:
index 5040190..55be78d 100644 (file)
@@ -18,19 +18,19 @@ import recdblist
 
 def wav2aac_nero(pin,pout):
     os.environ['LANG']="ja_JP.UTF-8"
-    neroaac=configreader.getpath('NeroAAC')
+    neroaac=configreader.getPathSetting('NeroAAC')
     exe=neroaac+" -br 128000 -2pass -if \""+pin+"\" -of \""+pout+"\""
     try:
         txt=commands.getoutput(exe.encode('utf-8'))
-        recdblist.addlog(pin, exe, u"Wav2aac_Neroログ-コマンド")
-        recdblist.addlog(pin, txt, u"Wav2aac_Neroログ-詳細")
+        recdblist.addLog(pin, exe, u"Wav2aac_Neroログ-コマンド")
+        recdblist.addLog(pin, txt, u"Wav2aac_Neroログ-詳細")
     except:
         if not os.path.exists(pout):
             lame="lame"
             exe=lame+" -b 128 \""+pin+"\" \""+pout+"\""
             txt=commands.getoutput(exe.encode('utf-8'))
-            recdblist.addlog(pin, exe, u"Wav2aac_Lameログ-コマンド")
-            recdblist.addlog(pin, txt, u"Wav2aac_Lameログ-詳細")
+            recdblist.addLog(pin, exe, u"Wav2aac_Lameログ-コマンド")
+            recdblist.addLog(pin, txt, u"Wav2aac_Lameログ-詳細")
 def wav2mp3_lame(pin,pout):
     os.environ['LANG']="ja_JP.UTF-8"
     lame="lame"
@@ -39,11 +39,11 @@ def wav2mp3_lame(pin,pout):
         txt=commands.getoutput(exe.encode('utf-8'))
     except:
         ""
-    recdblist.addlog(pin, exe, u"Wav2aac_Lameログ-コマンド")
-    recdblist.addlog(pin, txt, u"Wav2aac_Lameログ-詳細")
+    recdblist.addLog(pin, exe, u"Wav2aac_Lameログ-コマンド")
+    recdblist.addLog(pin, txt, u"Wav2aac_Lameログ-詳細")
 def ts2single_audio(pts,opts):
     paac=pts.replace(".ts",".aac")
-    ffmpeg=configreader.getpath("ffmpeg")
+    ffmpeg=configreader.getPathSetting("ffmpeg")
     e0=ffmpeg+" -i \""+pts+"\" -y -vn -f aac -acodec copy \""+paac+"\""
     p0=subprocess.Popen(e0,shell=True)
     os.waitpid(p0.pid, 0)
@@ -52,11 +52,11 @@ def ts2single_audio(pts,opts):
             if os.path.getsize(paac)<1000:#1mで1kb以下の場合自動で終了
                 try:
                     logt=unicode(p0.communicate()[0], "UTF-8")
-                    recdblist.addlog(pts,e0, "FFmpeg音声取り出しログ-コマンド")
-                    recdblist.addlog(pts,logt, "FFmpeg音声取り出しログ-詳細")
+                    recdblist.addLog(pts,e0, "FFmpeg音声取り出しログ-コマンド")
+                    recdblist.addLog(pts,logt, "FFmpeg音声取り出しログ-詳細")
                 except:
                     ""
-                recdblist.Commonlogex("[Error]", "ffmpeg aac getting. (ts2single_audio@tv2audio.py)", u"AAC demux error(ffmpeg)", "", verbose_level=200, log_level=200)
+                recdblist.addCommonlogEX("[Error]", "ffmpeg aac getting. (ts2single_audio@tv2audio.py)", u"AAC demux error(ffmpeg)", "", verbose_level=200, log_level=200)
                 os.kill(p0.pid,signal.SIGKILL)
                 os.remove(paac)
                 ts2single_mp3_ffmpeg(pts)
@@ -64,16 +64,16 @@ def ts2single_audio(pts,opts):
                     ts2single_fp_BonTsDemux(pts,opts)
             else:
                 logt=unicode(p0.communicate()[0], "UTF-8")
-                recdblist.addlog(pts,e0, "FFmpeg音声取り出しログ-コマンド")
-                recdblist.addlog(pts,logt, "FFmpeg音声取り出しログ-詳細")
+                recdblist.addLog(pts,e0, "FFmpeg音声取り出しログ-コマンド")
+                recdblist.addLog(pts,logt, "FFmpeg音声取り出しログ-詳細")
         else:
             try:
                 logt=unicode(p0.communicate()[0], "UTF-8")
-                recdblist.addlog(pts,e0, "FFmpeg音声取り出しログ-コマンド")
-                recdblist.addlog(pts,logt, "FFmpeg音声取り出しログ-詳細")
+                recdblist.addLog(pts,e0, "FFmpeg音声取り出しログ-コマンド")
+                recdblist.addLog(pts,logt, "FFmpeg音声取り出しログ-詳細")
             except:
                 ""
-            recdblist.Commonlogex("[Error]", "ffmpeg aac getting. (ts2single_audio@tv2audio.py)", u"AAC demux error(ffmpeg)", "", verbose_level=200, log_level=200)
+            recdblist.addCommonlogEX("[Error]", "ffmpeg aac getting. (ts2single_audio@tv2audio.py)", u"AAC demux error(ffmpeg)", "", verbose_level=200, log_level=200)
             try:
                 os.kill(p0.pid,signal.SIGKILL)
             except:
@@ -86,11 +86,11 @@ def ts2single_audio(pts,opts):
             if os.path.getsize(paac)<1000:#1mで1kb以下の場合自動で終了
                 try:
                     logt=unicode(p0.communicate()[0], "UTF-8")
-                    recdblist.addlog(pts,e0, "FFmpeg音声取り出しログ-コマンド")
-                    recdblist.addlog(pts,logt, "FFmpeg音声取り出しログ-詳細")
+                    recdblist.addLog(pts,e0, "FFmpeg音声取り出しログ-コマンド")
+                    recdblist.addLog(pts,logt, "FFmpeg音声取り出しログ-詳細")
                 except:
                     ""
-                recdblist.Commonlogex("[Error]", "ffmpeg aac getting. (ts2single_audio@tv2audio.py)", u"AAC demux error(ffmpeg)", "", verbose_level=200, log_level=200)
+                recdblist.addCommonlogEX("[Error]", "ffmpeg aac getting. (ts2single_audio@tv2audio.py)", u"AAC demux error(ffmpeg)", "", verbose_level=200, log_level=200)
                 os.remove(paac)
                 ts2single_mp3_ffmpeg(pts)
                 if not os.path.exists(pts.replace(".ts",".mp3")):
@@ -98,23 +98,23 @@ def ts2single_audio(pts,opts):
             else:
                 try:
                     logt=unicode(p0.communicate()[0], "UTF-8")
-                    recdblist.addlog(pts,e0, "FFmpeg音声取り出しログ-コマンド")
-                    recdblist.addlog(pts,logt, "FFmpeg音声取り出しログ-詳細")
+                    recdblist.addLog(pts,e0, "FFmpeg音声取り出しログ-コマンド")
+                    recdblist.addLog(pts,logt, "FFmpeg音声取り出しログ-詳細")
                 except:
                     ""
         else:
             try:
                 logt=unicode(p0.communicate()[0], "UTF-8")
-                recdblist.addlog(pts,e0, "FFmpeg音声取り出しログ-コマンド")
-                recdblist.addlog(pts,logt, "FFmpeg音声取り出しログ-詳細")
+                recdblist.addLog(pts,e0, "FFmpeg音声取り出しログ-コマンド")
+                recdblist.addLog(pts,logt, "FFmpeg音声取り出しログ-詳細")
             except:
                 ""
-            recdblist.Commonlogex("[Error]", "ffmpeg aac getting. (ts2single_audio@tv2audio.py)", u"AAC demux error(ffmpeg)", "", verbose_level=200, log_level=200)
+            recdblist.addCommonlogEX("[Error]", "ffmpeg aac getting. (ts2single_audio@tv2audio.py)", u"AAC demux error(ffmpeg)", "", verbose_level=200, log_level=200)
             ts2single_mp3_ffmpeg(pts)
             if not os.path.exists(pts.replace(".ts",".mp3")):
                 ts2single_fp_BonTsDemux(pts,opts)
 def ts2singlewav(pts,opts):
-    bontsdemux = configreader.getpath('bontsdemux')
+    bontsdemux = configreader.getPathSetting('bontsdemux')
     bonpin = "Z:\\" + pts[1:]
     outf = os.path.splitext(pts)[0]
     bonpout = "Z:\\" + outf[1:]
@@ -128,20 +128,20 @@ def ts2singlewav(pts,opts):
     recdblist.addCommandLog(ots, u"BonTsDemux 音声取り出し", exe, logt)
 def ts2single_mp3_ffmpeg(pts):
     pmp3=pts.replace(".ts",".mp3")
-    ffmpeg=configreader.getpath("ffmpeg")
+    ffmpeg=configreader.getPathSetting("ffmpeg")
     e0=ffmpeg+" -i \""+pts+"\" -y -vn -ab 128k \""+pmp3+"\""
     p0=subprocess.Popen(e0,shell=True)
     os.waitpid(p0.pid, 0)
     try:
         logt=unicode(p0.communicate()[0], "UTF-8")
-        recdblist.addlog(pts,e0, "FFmpeg_mp3音声取り出しログ-コマンド")
-        recdblist.addlog(pts,logt, "FFmpeg_mp3音声取り出しログ-詳細")
+        recdblist.addLog(pts,e0, "FFmpeg_mp3音声取り出しログ-コマンド")
+        recdblist.addLog(pts,logt, "FFmpeg_mp3音声取り出しログ-詳細")
     except:
         ""
 def ts2single_fp_BonTsDemux(pts,opts):
     useNero=0
     try:
-        if configreader.getpath("useNeroAAC")=="1" and os.path.exists(configreader.getpath("NeroAAC")):
+        if configreader.getPathSetting("useNeroAAC")=="1" and os.path.exists(configreader.getPathSetting("NeroAAC")):
             useNero=1
     except:
         useNero=0
@@ -163,8 +163,8 @@ def ts2dualaudio_BonTsDemux(pin, delay,opts):
     """
     delay is string
     """
-    bontsdemux = configreader.getpath('bontsdemux')
-    wine = configreader.getpath('wine')
+    bontsdemux = configreader.getPathSetting('bontsdemux')
+    wine = configreader.getPathSetting('wine')
     bonpin = "Z:\\" + pin[1:]
     outf = os.path.splitext(pin)[0]
     bonpout = "Z:\\" + outf[1:]
@@ -196,7 +196,7 @@ def ts2dualaudio_BonTsDemux(pin, delay,opts):
     ffpout22=ffpout2.replace(".wav",".mp3")
     useNero=0
     try:
-        if configreader.getpath("useNeroAAC")=="1" and os.path.exists(configreader.getpath("NeroAAC")):
+        if configreader.getPathSetting("useNeroAAC")=="1" and os.path.exists(configreader.getPathSetting("NeroAAC")):
             useNero=1
     except:
         useNero=0
@@ -212,8 +212,8 @@ def ts2dualaudio_BonTsDemux(pin, delay,opts):
     os.remove(ffpout1)
     os.remove(ffpout2)
 def ts2pentaaudio_BonTsDemux(pin, delay,opts):
-    bontsdemux = configreader.getpath('bontsdemux')
-    wine = configreader.getpath('wine')
+    bontsdemux = configreader.getPathSetting('bontsdemux')
+    wine = configreader.getPathSetting('wine')
     bonpin = "Z:\\" + pin[1:]
     outf = os.path.splitext(pin)[0]
     bonpout = "Z:\\" + outf[1:]
@@ -240,7 +240,7 @@ def ts2pentaaudio_BonTsDemux(pin, delay,opts):
     ffpout21=ffpout1.replace(".wav",".mp3")
     useNero=0
     try:
-        if configreader.getpath("useNeroAAC")=="1" and os.path.exists(configreader.getpath("NeroAAC")):
+        if configreader.getPathSetting("useNeroAAC")=="1" and os.path.exists(configreader.getPathSetting("NeroAAC")):
             useNero=1
     except:
         useNero=0
index f9481f1..05811cf 100644 (file)
@@ -47,7 +47,7 @@ def timetv2b25(pout, chtxt, btime, etime, opt):
     dt = et-tnow
     rectime = dt.seconds-5
     rectime = str(rectime)
-    tv2ts.tv2b25ts(tsout + ".ts.b25", chdb.chtxtsearch(chtxt)['ch'], rectime)
+    tv2ts.tv2b25ts(tsout + ".ts.b25", chdb.getChCSchFromCHtxt(chtxt)['ch'], rectime)
 def b252ts(pout, chtxt, btime, etime, opt):
     """
     poutはタイトル(自動的にtitle.b25 title.tsと名前がつきます。)
@@ -82,7 +82,7 @@ def b252ts(pout, chtxt, btime, etime, opt):
         if pentaaudio == 1:
             tv2audio.ts2pentaaudio_BonTsDemux(aviin, recdblist.BONTSDEMUX_DELAY, opt)
     except Exception, inst:
-        recdblist.Commonlogex("Error", "b252ts(tv2avi.py)", str(type(inst))+traceback.format_exc(), str(inst))
+        recdblist.addCommonlogEX("Error", "b252ts(tv2avi.py)", str(type(inst))+traceback.format_exc(), str(inst))
     status.changeB25Decoding(-1)
 def ts2avi(pin, pout, opt):
     status.changeEncoding(1)
index 3c2a9ce..0bcc9b2 100644 (file)
@@ -1,4 +1,3 @@
-import auto_process
 #!/usr/bin/python
 # coding: UTF-8
 # Rec10 TS Recording Tools
@@ -8,6 +7,7 @@ import os.path
 import tv2mp4
 import configreader
 import subprocess
+import auto_process
 def ts2mkv(pin, pout, opt):
     tpout=pout.replace(".mkv",".mp4")
     tv2mp4.ts2mp4(pin, tpout, opt)
@@ -15,7 +15,7 @@ def ts2mkv(pin, pout, opt):
     if os.path.exists(pout) and os.path.getsize(pout)>os.path.getsize(tpout)*0.9:
         os.remove(tpout)
 def mp42mkv(pmkv,pmp4):
-    exe = configreader.getpath("mkvmerge")
+    exe = configreader.getPathSetting("mkvmerge")
     e1=exe +" -o \""+pmkv+u"\" \""+pmp4+"\""
     p=subprocess.Popen(e1,shell=True)
     os.waitpid(p.pid, 0)
index 4def4dc..4b231f8 100644 (file)
@@ -51,7 +51,7 @@ def raw2mp4(pin,pout,opt):
         duration="-fps 29.970030 "##ffmpegが24fpsに対応していないための措置\r
     if re.search("I",opt):\r
         duration="-fps 29.970030 "\r
-    exe = configreader.getpath("mp4box")\r
+    exe = configreader.getPathSetting("mp4box")\r
     txt=""\r
     os.environ['LANG']="ja_JP.UTF-8"\r
     pints=pin.replace(".264",".ts")\r
@@ -68,10 +68,10 @@ def raw2mp4(pin,pout,opt):
             else:\r
                 auto_process.deltmpfile(dir, title, ".mp4")\r
 def mkv2mp4(pin,pout):\r
-    exeb = configreader.getpath(u"mkvextract")\r
-    exe = configreader.getpath(u"mp4Box")\r
-    #dtsedit=configreader.getpath("DtsEdit")\r
-    wineexe=configreader.getpath("wine")\r
+    exeb = configreader.getPathSetting(u"mkvextract")\r
+    exe = configreader.getPath(u"mp4Box")\r
+    #dtsedit=configreader.getPath("DtsEdit")\r
+    wineexe=configreader.getPathSetting("wine")\r
     dir=os.path.split(pin)[0]\r
     title=os.path.split(pin)[1]\r
     title=os.path.splitext(title)[0]\r
@@ -100,10 +100,10 @@ def mkv2mp4(pin,pout):
         if os.path.exists(pout):\r
             auto_process.deltmpfile(dir, title, ".mp4")\r
 def addCaption(pts,pmp4):##字幕の追加を試みる。\r
-    wineexe=configreader.getpath("wine")\r
+    wineexe=configreader.getPathSetting("wine")\r
     pincap=pts.replace(".ts",".srt")\r
     try:\r
-        cap2ass=configreader.getpath("caption2ass")\r
+        cap2ass=configreader.getPathSetting("caption2ass")\r
     except:\r
         cap2ass=""\r
     if os.path.isfile(cap2ass):\r
@@ -121,11 +121,11 @@ def addCaption(pts,pmp4):##字幕の追加を試みる。
             recdblist.addlog(pts,logt, u"Captionログ-詳細")\r
         if os.path.exists(pincap):\r
             if os.path.getsize(pincap)>1000:\r
-                exe = configreader.getpath("mp4box")\r
+                exe = configreader.getPathSetting("mp4box")\r
                 e1s=exe +u" -add \""+pincap+"\" \""+pmp4+"\""\r
                 addmp4(pincap,pmp4,e1s)\r
 def addAudio(pts,pmp4,opts):#オプションに応じた音声の追加を行う\r
-    exe = configreader.getpath("mp4box")\r
+    exe = configreader.getPathSetting("mp4box")\r
     if re.search("d",opts) or re.search("5",opts):#二カ国語放送/5.1ch放送の場合\r
         paac1=pts.replace(".ts","_1.aac")\r
         paac2=pts.replace(".ts","_2.aac")\r
index c104b11..d9cfb75 100644 (file)
@@ -30,7 +30,7 @@ def tv2ts(pout, ch, csch, time):
     try:
         tv2b25ts(pout + ".b25", ch, time)
     except Exception, inst:
-        recdblist.Commonlogex(u"Error",u"tv2ts(tv2ts.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
+        recdblist.addCommonlogEX(u"Error",u"tv2ts(tv2ts.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
     if len(ch) > 2:#BS/CSは100とかCS??とかなので3文字以上
         status.changeBSCSRecording(-1)
     else:
@@ -74,7 +74,7 @@ def b252ts(pout, ch, csch):
         except:
             ""
 def tv2b25ts(pout, ch, time):
-    exe = configreader.getpath('recpt1')
+    exe = configreader.getPathSetting('recpt1')
     if len(ch) > 2:#BS/CSは100とかCS??とかなので3文字以上
         status.changeBSCSRecording(1)
     else:
@@ -82,40 +82,40 @@ def tv2b25ts(pout, ch, time):
     try:
         doexe = exe + ' ' + ch + ' ' + time + ' \'' + pout + '\''
         recdblist.printutf8(doexe)
-        recdblist.addlog(pout, doexe, u"recpt1ログ-コマンド")
+        recdblist.addLog(pout, doexe, u"recpt1ログ-コマンド")
         recdblist.addlog(pout, unicode(commands.getoutput(doexe.encode('utf-8')),'utf-8'), u"recpt1ログ-詳細")
     except Exception, inst:
-        recdblist.Commonlogex(u"Error",u"tv2b25ts(tv2ts.py)", str(type(inst)),str(inst))
+        recdblist.addCommonlogEX(u"Error",u"tv2b25ts(tv2ts.py)", str(type(inst)),str(inst))
     if len(ch) > 2:#BS/CSは100とかCS??とかなので3文字以上
         status.changeBSCSRecording(-1)
     else:
         status.changeTERecording(-1)
 def tv2b25ts_b25(pout, ch, time):
-    exe = configreader.getpath('recpt1')
+    exe = configreader.getPathSetting('recpt1')
     doexe = exe + ' --b25 ' + ch + ' ' + time + ' \'' + pout + '\''
     os.system(doexe)
 def b252tsmix(pin, pout):
     if not (os.path.exists(pout) and os.path.getsize(pin)>os.path.getsize(pout)*0.95 and os.path.getsize(pin)<os.path.getsize(pout)*1.05):
         exe=""
-        if configreader.getpath('b25_remote')=="1":
+        if configreader.getPathSetting('b25_remote')=="1":
             try:
-                exe = configreader.getpath('b25_env')+" && "
+                exe = configreader.getPathSetting('b25_env')+" && "
             except:
                 inst=u"b25_remoteがオンになっていますが、b25_envが設定されていないかコメントアウトされています。"
-                recdblist.Commonlogex(u"Error",u"b252tsmix(tv2ts.py)", "",inst)
-        exe = exe + "nice -n 17 " + configreader.getpath('b25')
+                recdblist.addCommonlogEX(u"Error",u"b252tsmix(tv2ts.py)", "",inst)
+        exe = exe + "nice -n 17 " + configreader.getPathSetting('b25')
         doexe = exe + u' \"' + pin + u'\" \"' + pout + u'\"'
         recdblist.printutf8(doexe)
         txt = unicode(commands.getoutput(doexe.encode('utf-8')),'utf-8')
-        recdblist.addlog(pin, doexe, u"b25ログ-コマンド")
+        recdblist.addLog(pin, doexe, u"b25ログ-コマンド")
         recdblist.addlog(pin, txt, u"b25ログ-詳細")
 def tsmix2ts(pin, pout, csch):#csch=0ならcsの処理をしない
-    doexe = configreader.getpath("tssplitter") + " \""+ pin + "\" \""+ pout + "\" " + str(csch)
+    doexe = configreader.getPathSetting("tssplitter") + " \""+ pin + "\" \""+ pout + "\" " + str(csch)
     doexe = "nice -n 18 " + doexe
     os.environ['LANG']="ja_JP.UTF-8"
     txt = unicode(commands.getoutput(doexe.encode('utf-8')),'utf-8')
-    recdblist.addlog(pin, doexe, u"TsSplitログ-コマンド")
-    recdblist.addlog(pin, txt, u"TsSplitログ-詳細")
+    recdblist.addLog(pin, doexe, u"TsSplitログ-コマンド")
+    recdblist.addLog(pin, txt, u"TsSplitログ-詳細")
     time.sleep(1)
     if os.access(pout, os.F_OK) and os.path.getsize(pout)>10*1000*1000:
         os.remove(pin)
index 0f61e0d..d7872b9 100644 (file)
@@ -31,11 +31,11 @@ def getText_item(obj):
     for o in obj:
         rc=rc+getText(o)
     return rc
-def writemultitvDB(bctype,tvlists):
+def writeMultiTVDB(bctype,tvlists):
     rec10d.rec10db.new_epg_timeline(bctype)
     for channel,start,stop,title,desc,longdesc,category in tvlists:
         rec10d.rec10db.add_epg_timeline(bctype, channel, start, stop, title, desc, longdesc, category)
-def writemultichDB(chlists):
+def writeMultiCHDB(chlists):
     for chtxt,dn in chlists:
         rec10d.rec10db.update_chname_by_chtxt_epg_ch(chtxt,dn)
 def xml2db_dom(xmlpath, bctype):#bctypeは放送種別で'TE'(地デジ)BS,CSがある。地デジの場合は te数字 が入る
@@ -58,14 +58,14 @@ def xml2db_dom(xmlpath, bctype):#bctypeは放送種別で'TE'(地デジ)BS,CSが
         longdesc=zenhan.toHankaku_ABC123(getText_item(tv.getElementsByTagName("longdesc")))
         category=zenhan.toHankaku_ABC123(getText_item(tv.getElementsByTagName("category")))
         title=addTitle_Subtitle(rHisch,1,title,desc)
-        tch=chdb.chtxtsearch(channel)
+        tch=chdb.searchFromCHtxt(channel)
         if tch!=None:
             if tch.get('bctype',"")==bctype:
                 bt=bayes.get(tch['chtxt'],["","",0])
                 bt2=[bt[0]+title+" ",bt[1]+desc+" "+longdesc+" ",bt[2]+1]
                 bayes[tch['chtxt']]=bt2
                 tvlist.append([channel,start,stop,title,desc,longdesc,category])
-                p=auto_rec.calc_key(tch['chtxt'], title,desc+" "+longdesc)
+                p=auto_rec.calcKey(tch['chtxt'], title,desc+" "+longdesc)
                 if p>2000:
                     bttt=datetime.datetime.strptime(start,"%Y%m%d%H%M%S")
                     bttt=bttt-datetime.timedelta(seconds=1200)
@@ -86,10 +86,10 @@ def xml2db_dom(xmlpath, bctype):#bctypeは放送種別で'TE'(地デジ)BS,CSが
                                 maxnum=0
                                 if len(ch['ch'])>2:
                                     maxnum=epgdb.count_schedule_timeline(bttime, ettime)[1]
-                                    maxnum=int(configreader.getenv("bscs_max"))-maxnum
+                                    maxnum=int(configreader.getEnvSetting("bscs_max"))-maxnum
                                 else:
                                     maxnum=epgdb.count_schedule_timeline(bttime, ettime)[0]
-                                    maxnum=int(configreader.getenv("te_max"))-maxnum
+                                    maxnum=int(configreader.getEnvSetting("te_max"))-maxnum
                                 if maxnum>0:
                                     topt=status.getSettings_auto_opt()
                                     recdb.recreserv(title,tch['chtxt'], bttime, ettime,topt)
@@ -98,14 +98,14 @@ def xml2db_dom(xmlpath, bctype):#bctypeは放送種別で'TE'(地デジ)BS,CSが
 
     dom.unlink()
     if len(chlist) > 0:
-        writemultichDB(chlist)
+        writeMultiCHDB(chlist)
         chlist = []
         if len(tvlist) > 0:
-            writemultitvDB(bctype,tvlist)
+            writeMultiTVDB(bctype,tvlist)
         tvlist = []
         for ct,list in bayes.items():
-            auto_rec.update_recall(ct,list[0],list[1],list[2])
-            auto_rec.update_recall("ALL",list[0],list[1],list[2])
+            auto_rec.updateRecall(ct,list[0],list[1],list[2])
+            auto_rec.updateRecall("ALL",list[0],list[1],list[2])
     dtb=datetime.datetime.now()-dtb
     recdblist.printutf8(bctype + u" epg取り出し終了")
     recdblist.printutf8(str(dtb.days * 24 * 60 * 60 + dtb.seconds)+u"seconds taken for updating bayes-auto DB .")
@@ -118,6 +118,6 @@ def addTitle_Subtitle(recompiled,num,title,exp):
         else:
             newtitle=title
     except Exception, inst:
-        recdblist.Commonlogex("Error", "addTitle_Subtitle(xml2db_dob.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
+        recdblist.addCommonlogEX("Error", "addTitle_Subtitle(xml2db_dob.py)", str(type(inst)),str(inst)+traceback.format_exc(),log_level=200)
         newtitle=title
     return newtitle
\ No newline at end of file
index 876327b..d2787d4 100644 (file)
@@ -46,7 +46,7 @@ def toHankaku_ABC123(str):
             s = h_number[i]
         retstr = retstr + s
     return retstr
-def check_Character_Type(character):
+def checkCharacterType(character):
     """
     return code is 1:Alphabet 2:Hiragana 3:Katakana 4:Kanji
     """