From: gn64_jp Date: Fri, 28 May 2010 04:31:52 +0000 (+0000) Subject: implement new log system. X-Git-Url: http://git.osdn.net/view?p=rec10%2Frec10-git.git;a=commitdiff_plain;h=32a94871fd17066724ca9e39f3f68068d89ae7e7 implement new log system. git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/rec10@609 4e526526-5e11-4fc0-8910-f8fd03428081 --- diff --git a/rec10/trunk/src/dbMySQL.py b/rec10/trunk/src/dbMySQL.py index 396b008..23c2074 100644 --- a/rec10/trunk/src/dbMySQL.py +++ b/rec10/trunk/src/dbMySQL.py @@ -1144,4 +1144,10 @@ class DB_MySQL: db[1].execute("\ ALTER TABLE timeline ADD epgexp VARCHAR(200)") self.close_db(db) - self.change_version_in_status("95") \ No newline at end of file + self.change_version_in_status("95") + def update_db_95to96(self): + db = self.connect_db() + self.drop_in_settings() + self.new_in_settings() + self.close_db(db) + self.change_version_in_status("96") \ No newline at end of file diff --git a/rec10/trunk/src/epgdb.py b/rec10/trunk/src/epgdb.py index 2b9993f..7fb0968 100644 --- a/rec10/trunk/src/epgdb.py +++ b/rec10/trunk/src/epgdb.py @@ -41,9 +41,7 @@ def updatebc(bctype): time.sleep(5) rec10d.rec10db.update_by_bctype_epg_ch(bctype) except Exception, inst: - recdblist.printutf8("error occurs in updatebc(epgdb)") - recdblist.printutf8(str(type(inst))) - recdblist.printutf8(str(inst)) + recdblist.Commonlogex("Error","updatebc(epgdb.py)", str(type(inst)), str(inst)) xml2db_dom.xml2db_dom(tmppath + bctype + "epgdata.bak.xml", bctype) rec10d.rec10db.update_status_by_bctype_epg_ch(bctype, "2") def updatebc_bak(bctype): diff --git a/rec10/trunk/src/install.py b/rec10/trunk/src/install.py index 6b457a1..a2b70ae 100644 --- a/rec10/trunk/src/install.py +++ b/rec10/trunk/src/install.py @@ -288,5 +288,7 @@ def update_db(version): rec10d.rec10db.update_db_93to94() elif version==94: rec10d.rec10db.update_db_94to95() + elif version==95: + rec10d.rec10db.update_db_95to96() if __name__ == "__main__": move() diff --git a/rec10/trunk/src/readme.txt b/rec10/trunk/src/readme.txt index cac20aa..8cb9c4c 100644 --- a/rec10/trunk/src/readme.txt +++ b/rec10/trunk/src/readme.txt @@ -1,7 +1,7 @@ ########################################### -# Rec10 for PT1 # -# Ver.0.9.5 # -# 2010/05/12 Yukikaze # +# Rec10 -Ts Recording system. # +# Ver.0.9.6 # +# 2010/05/28 Yukikaze & long.inus # # Copyright (C) 2009-2010 Yukikaze # ########################################### @@ -20,7 +20,7 @@ java(jre1.6で動作を確認) [必要環境:Webインターフェース部分] perl -一部のperlモジュール( rectool.pl) +一部のperlモジュール(rectool.pl,rec10webg2) [必要環境:外部ツール] jTsSplitter(included) @@ -29,6 +29,9 @@ epgdump(included) b25(non-included) recpt1(recfriioでもいいはずです)(non-included) +事前準備: +pt1などのドライバーをインストールした上で、recpt1などのソフトを導入、 +b25をインストールしておいてください。 1:install.shを実行 2:表示にしたがって設定の変更(チャンネルなど) @@ -66,13 +69,15 @@ chdata.pyを実行してください(python chdata.py) yukikaze.jp@gmail.com [History] -0.9.5 +10/05/29 0.9.6 release +バグ修正 +ログシステムの修正 +0.9.5(内部リリース) b25自動削除機能の改善 自動仕分け機能のアップデート Caption2Assやaac取り出しがうまくいかないときの自動復帰処理の実装 バグ修正 - 10/04/02 0.9.4 release バグ修正 インストーラーの大幅な改善 diff --git a/rec10/trunk/src/recdblist.py b/rec10/trunk/src/recdblist.py index 50b3cd2..8e43f7c 100644 --- a/rec10/trunk/src/recdblist.py +++ b/rec10/trunk/src/recdblist.py @@ -6,6 +6,7 @@ """ task names """ +import datetime import os import os.path @@ -69,16 +70,33 @@ REC_AUTO_SUGGEST_AP2FP = "auto_suggest_ap2fp" REC_AUTO_KEYWORD = "auto_keyword" REC_BAYES_SUGGEST ="bayes_suggest" -version = 95 +version = 96 def printutf8(unicode): str=unicode.encode('utf-8') print str +def printuft8ex(unicode): + str=unicode.encode('utf-8') + print str logfname="/var/log/rec10" mode="a" if os.path.exists(logfname): f=open(logfname,mode) f.write(str+"\n") f.close() +def Commonlogex(type,place,inst,txt): + lt=datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")+u":" + lt=lt+u"["+type+u"] "+place+u" "+inst+u"\n"+txt + lt=lt.encode('utf-8') + logfname="/var/log/rec10" + mode="a" + print lt + if os.path.exists(logfname): + f=open(logfname,mode) + 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): logo=tspath logo=logo.replace("_1.wav",".ts") @@ -109,6 +127,7 @@ def addlog(tspath,txt,log_title): stxt=stxt+txt[s-800+st:] else: stxt=txt - txtw="\n####"+log_title+"####\n"+stxt + txtw= datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") + txtw=txtw+"\n####"+log_title+"####\n"+stxt f.write(txtw.encode('utf-8')) f.close() \ No newline at end of file diff --git a/rec10/trunk/src/timerec.py b/rec10/trunk/src/timerec.py index 04b7642..58a2c3c 100644 --- a/rec10/trunk/src/timerec.py +++ b/rec10/trunk/src/timerec.py @@ -272,16 +272,12 @@ def search_keyword(key): topt=status.getSettings_auto_opt() recdb.recreserv(titlet,chtxtt, btimet, etimet,topt) except Exception, inst: - recdblist.printutf8("error occures in search_keyword_auto_jbk") - recdblist.printutf8(str(type(inst))) - recdblist.printutf8(str(inst)) + recdblist.Commonlogex("Error", "search_keyword_auto_jbk(timerec.py)", str(type(inst)),str(inst)) else: try: recdb.add_auto_keyword(chtxtt, titlet, btimet, etimet) except Exception, inst: - recdblist.printutf8("error occures in search_keyword") - recdblist.printutf8(str(type(inst))) - recdblist.printutf8(str(inst)) + recdblist.Commonlogex("Error", "search_keyword(timerec.py)", str(type(inst)),str(inst)) 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") @@ -319,9 +315,7 @@ def type_reserve(typetxt,chtxt,title,bt,et,opt): auto_rec.add_key("ALL", titlen,exp+" "+longexp) recdblist.printutf8(u"追いかけ機能実行中: "+title+" : "+titlen+" "+btimen+" "+etimen) except Exception, inst: - recdblist.printutf8("Error happened in Oikake DB") - recdblist.printutf8(str(type(inst))) - recdblist.printutf8(str(inst)) + recdblist.Commonlogex("Error", "Oikake DB(timerec.py)", str(type(inst)),str(inst)) else: recdblist.printutf8(u"追いかけ機能エラー:番組データが見付かりません。") else: @@ -348,18 +342,16 @@ def type_reserve(typetxt,chtxt,title,bt,et,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) - recdblist.printutf8(u"追いかけ機能実行中: "+title+" : "+titlen+" "+btimen+" "+etimen) + #recdblist.printutf8(u"追いかけ機能実行中: "+title+" : "+titlen+" "+btimen+" "+etimen) + recdblist.Commonlogex(u"通常", "Oikake (timerec.py)",u"追いかけ機能実行中",u"追いかけ機能実行中: "+title+" : "+titlen+" "+btimen+" "+etimen) except Exception, inst: - recdblist.printutf8("Error happened in Oikake DB") - recdblist.printutf8(str(type(inst))) - recdblist.printutf8(str(inst)) + recdblist.Commonlogex("Error", "Oikake DB(timerec.py)", str(type(inst)),str(inst)) 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.printutf8(str(type(inst))) - recdblist.printutf8(str(inst)) + recdblist.Commonlogex("Error", "Oikake DB(timerec.py)", str(type(inst)),str(inst)) 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") @@ -393,7 +385,7 @@ def type_final(typetxt,chtxt,title,bt,et,opt): newtime=bt newtitle=newtitle+u"_"+iff+newtime.strftime("%Y-%m-%dT%H-%M-%S") recdb.rec_reckey(typetxting, newtitle, chtxt, btime, etime, opt) - recdblist.printutf8(u"録画開始 "+newtitle+" "+btime+" "+etime) + recdblist.Commonlogex(u"通常","timerec.py",u"録画開始 "+newtitle+" "+btime+" "+etime) tv2avi.timetv2b25(recpath + "/" + newtitle + ".avi", chtxt, btime, etime, opt) recdb.del_reckey(typetxting, newtitle, chtxt, btime) if not re.search("R", opt): @@ -444,7 +436,7 @@ def type_keyword(typetxt,chtxt,title,bt,et,opt,deltatime): 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.printutf8(u"key "+title+u" : "+titlet+u" "+btimet+u" "+etimet) + recdblist.Commonlogex(u"通常","timerec.py",u"key "+title+u" : "+titlet+u" "+btimet+u" "+etimet,"") #except Exception, inst: # recdblist.printutf8("Error happened in REC_KEYWORD DB") # recdblist.printutf8(type(inst)) @@ -544,11 +536,10 @@ def type_decode_que(typetxt,chtxt,title,bt,et,opt): try: shutil.copy(os.path.join(recpath,title+".ts"), os.path.join(movepath,title+".ts")) except Exception, inst: - errtxt="Error happened in type_decode_que in timerec.\n" - errtxt=errtxt+"move ts error.\n" - errtxt=errtxt+str(type(inst))+"\n" - errtxt=errtxt+str(inst) - recdblist.addlog(os.path.join(recpath,title+".ts"), errtxt, "timerec-move(Decode) error") + errtxt1="move ts error.\n" + errtxt2=str(type(inst))+"\n" + errtxt2=errtxt2+str(inst) + recdblist.Commonlogex("Error", "type_decode_que(timerec.py)", errtxt1,errtxt2) recdb.rec_reckey(recdblist.REC_MOVE_END, title, chtxt, btime, etime, opt) else: recdb.del_reckey(typetxtnow, title, chtxt, btime) @@ -666,11 +657,10 @@ def type_encode_que(typetxt,chtxt,title,bt,et,opt): elif os.path.exists(os.path.join(recpath,title+".mkv")): shutil.copy(os.path.join(recpath,title+".mkv"), os.path.join(movepath,title+".mkv")) except Exception, inst: - errtxt="Error happened in type_encode_que in timerec.\n" - errtxt=errtxt+"move mkv/mp4 error.\n" - errtxt=errtxt+str(type(inst))+"\n" - errtxt=errtxt+str(inst) - recdblist.addlog(os.path.join(recpath,title+".ts"), errtxt, "timerec-move(Encode) error") + errtxt1="move mkv/mp4 error." + errtxt2=str(type(inst))+"\n" + errtxt2=errtxt2+str(inst) + recdblist.Commonlogex("Error", "type_encode_que(timerec.py)", errtxt1,errtxt2) recdb.rec_reckey(recdblist.REC_MOVE_END, title, chtxt, btime, etime, opt) recdb.rec_reckey(typetxtfin, title, chtxt, btime, etime, opt) sys.exit() diff --git a/rec10/trunk/src/ts2epg.py b/rec10/trunk/src/ts2epg.py index f1f7243..88f1804 100644 --- a/rec10/trunk/src/ts2epg.py +++ b/rec10/trunk/src/ts2epg.py @@ -26,8 +26,7 @@ def write_time(pout, ch ,times): """ 指定された時間分tsを取得してepgの入ったxmlとして書き出す """ - recdblist.printutf8(u"Ts-EPG XML書き出し処理開始") - recdblist.printutf8(u"CH:"+ch) + recdblist.Commonlogex(u"通常","write_time(ts2epg.py)",u"Ts-EPG XML書き出し処理開始" ,u"CH:"+ch) timet = times if re.search(u'CS', ch): mode = "/CS" @@ -42,6 +41,7 @@ def write_time(pout, ch ,times): 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,"") os.system(exe) time.sleep(10) diff --git a/rec10/trunk/src/ts2x264.py b/rec10/trunk/src/ts2x264.py index 8d44261..18e59f3 100644 --- a/rec10/trunk/src/ts2x264.py +++ b/rec10/trunk/src/ts2x264.py @@ -66,16 +66,12 @@ def ts2x264(pin, pout, opts):#sizeは"HD"か"SD" tm2v=pin.replace(".ts",".m2v") encode(tm2v, pout,size,is24fps,quality,crf) except Exception, inst: - recdblist.printutf8("error occures in ts2x264.py encode") - recdblist.printutf8(str(type(inst))) - recdblist.printutf8(str(inst)) + recdblist.Commonlogex("Error", "ts2x264(ts2x264.py)", str(type(inst)), str(inst)) else: try: encode(pin, pout,size,is24fps,quality,crf) except Exception, inst: - recdblist.printutf8("error occures in ts2x264.py encode") - recdblist.printutf8(str(type(inst))) - recdblist.printutf8(str(inst)) + recdblist.Commonlogex("Error", "ts2x264(ts2x264.py)", str(type(inst)), str(inst)) def encode(pin,pout,size,is24fps,quality,crf): mencoder=configreader.getpath("mencoder") x264=configreader.getpath("x264") @@ -160,15 +156,13 @@ def encode(pin,pout,size,is24fps,quality,crf): encexe=encexe+u" nice -n 19 "+x264+" "+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) - txt=txt+"Cmd : "+encexe+"\n" - txtt="" + txt="" try: - txtt=unicode(commands.getoutput(encexe.encode('utf-8')),'utf-8') + txt=unicode(commands.getoutput(encexe.encode('utf-8')),'utf-8') except: "" os.system("rm "+streampath) - txt=txt+txtt - recdblist.addlog( pin, txt, "mencoder-log") + recdblist.addCommandLog(pin, u"Mencoder", encexe, txt) def encode_ffmpeg(pin,pout,size,is24fps,quality,crf): """ @@ -240,15 +234,12 @@ def encode_ffmpeg(pin,pout,size,is24fps,quality,crf): os.environ['LANG']="ja_JP.UTF-8" exe=ffmpeg+u" -y -i \""+pin+"\" -vsync 400 -vcodec rawvideo -pix_fmt yuv420p "+s+fps+"-deinterlace -an -f rawvideo - |" exe=exe+u" nice -n 19 "+x264+" "+x264crf+u" "+x264_addline+u" --threads "+x264_thread+" "+x264profile+x264preset+" "+x264tune+" "+x264fps+" -o \""+pout+"\" - "+x264streamsize - txt=txt+"Cmd : "+exe+"\n" exe = "nice -n 19 " + exe - txt=txt+"Cmd : "+exe+"\n" - txtt="" + txt="" recdblist.printutf8(exe) try: - txtt=unicode(commands.getoutput(exe.encode('utf-8')),'utf-8') + txt=unicode(commands.getoutput(exe.encode('utf-8')),'utf-8') except: "" - txt=txt+txtt - recdblist.addlog( pin, txt, "dual audio ffmpeg-log") + recdblist.addCommandLog(pin, u"FFmpeg動画エンコード", exe, txt) \ No newline at end of file diff --git a/rec10/trunk/src/tv2audio.py b/rec10/trunk/src/tv2audio.py index 560eedc..32743e1 100644 --- a/rec10/trunk/src/tv2audio.py +++ b/rec10/trunk/src/tv2audio.py @@ -15,27 +15,27 @@ def wav2aac_nero(pin,pout): os.environ['LANG']="ja_JP.UTF-8" neroaac=configreader.getpath('NeroAAC') exe=neroaac+" -br 128000 -2pass -if \""+pin+"\" -of \""+pout+"\"" - txt=u"Cmd : "+exe+"\n" try: - txt=txt+commands.getoutput(exe.encode('utf-8')) - recdblist.addlog(pin, txt, "Wav2aac_Nero log") + txt=commands.getoutput(exe.encode('utf-8')) + 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=u"Cmd : "+exe+"\n" - txt=txt+commands.getoutput(exe.encode('utf-8')) - recdblist.addlog(pin, txt, "Wav2aac_Lame log") + txt=commands.getoutput(exe.encode('utf-8')) + 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" exe=lame+" -b 128 \""+pin+"\" \""+pout+"\"" - txt=u"Cmd : "+exe+"\n" try: - txt=txt+commands.getoutput(exe.encode('utf-8')) + txt=commands.getoutput(exe.encode('utf-8')) except: "" - recdblist.addlog(pin, txt, "Wav2aac_Lame log") + recdblist.addlog(pin, exe, u"Wav2aac_Lameログ-コマンド") + recdblist.addlog(pin, txt, u"Wav2aac_Lameログ-詳細") def ts2single_audio(pts): paac=pts.replace(".ts",".aac") ffmpeg=configreader.getpath("ffmpeg") @@ -63,7 +63,8 @@ def ts2single_audio(pts): tv2audio.wav2mp3_lame(ain,aout) else: logt=unicode(p0.communicate()[0], "UTF-8") - recdblist.addlog(pts,logt, "FFmpeg-getAudio-Log") + recdblist.addlog(pts,e0, "FFmpeg音声取り出しログ-コマンド") + recdblist.addlog(pts,logt, "FFmpeg音声取り出しログ-詳細") if os.path.exists(pts.replace(".ts",".mp3")) and os.path.getsize(paac)<1000:#1mで1kb以下の場合自動で終了 ts2singlewav(pts) useNero=0 @@ -92,3 +93,5 @@ def ts2singlewav(pts): recdblist.printutf8(exe) p=subprocess.Popen(exe.encode('utf-8'),shell=True) os.waitpid(p.pid, 0) + logt=unicode(p.communicate()[0], "UTF-8") + recdblist.addCommandLog(ots, u"BonTsDemux 音声取り出し", exe, logt) diff --git a/rec10/trunk/src/tv2avi.py b/rec10/trunk/src/tv2avi.py index e76c190..a74b6c7 100644 --- a/rec10/trunk/src/tv2avi.py +++ b/rec10/trunk/src/tv2avi.py @@ -79,9 +79,7 @@ def b252ts(pout, chtxt, btime, etime, opt): if singleaudiosplit ==1: singleaudio2sep(aviin) except Exception, inst: - recdblist.printutf8("Error happened in b252ts in tv2avi") - recdblist.printutf8(str(type(inst))) - recdblist.printutf8(str(inst)) + recdblist.Commonlogex("Error", "b252ts(tv2avi.py)", str(type(inst)), str(inst)) status.changeB25Decoding(-1) def ts2avi(pin, pout, opt): status.changeEncoding(1) @@ -116,7 +114,7 @@ def dualaudio2sep(pin, delay): exe = xvfb + ' -a ' + exe txt=commands.getoutput(exe.encode('utf-8')) try: - recdblist.addlog(pin, txt, "dualaudio-sep1 BontsDemux") + recdblist.addCommandLog(pin, u"BonTsDemux 第一音声取り出し", exe, txt) except: "" ffpin = pin.replace(".ts", "") @@ -131,7 +129,7 @@ def dualaudio2sep(pin, delay): exe = xvfb + ' -a ' + exe txt=commands.getoutput(exe.encode('utf-8')) try: - recdblist.addlog(pin, txt, "dualaudio-sep1 BontsDemux") + recdblist.addCommandLog(pin, u"BonTsDemux 第二音声取り出し", exe, txt) except: "" #os.system(exe) @@ -168,7 +166,7 @@ def pentaaudio2sep(pin): recdblist.printutf8(exe) txt=commands.getoutput(exe.encode('utf-8')) try: - recdblist.addlog(pin, txt, "pentaaudio-sep1 BontsDemux") + recdblist.addCommandLog(pin, u"BonTsDemux5.1ch 第一音声取り出し", exe, txt) except: "" ffpin = pin.replace(".ts", "") @@ -181,7 +179,7 @@ def pentaaudio2sep(pin): recdblist.printutf8(exe) txt=commands.getoutput(exe.encode('utf-8')) try: - recdblist.addlog(pin, txt, "pentaaudio-sep2(raw aac) ffmpeg") + recdblist.addCommandLog(pin, u"FFmpeg 5.1ch 第二音声(raw AAC)取り出し", exe, txt) except: "" ffpout21=ffpout1.replace(".wav",".mp3") @@ -202,7 +200,7 @@ def pentaaudio2sep(pin): recdblist.printutf8(exe) txt=commands.getoutput(exe.encode('utf-8')) try: - recdblist.addlog(pin, txt, "pentaaudio-sep Downmix (5.1ch error) BontsDemux") + recdblist.addCommandLog(pin, u"BonTsDemux 修正版第二音声(2chDownmix)取り出し", exe, txt) except: "" shutil.move(ffpin1, ffpout1) @@ -229,7 +227,7 @@ def singleaudio2sep(pin): recdblist.printutf8(exe) txt=commands.getoutput(exe.encode('utf-8')) try: - recdblist.addlog(pin, txt, "singleaaudio-sep1 BontsDemux") + recdblist.addCommandLog(pin, u"BonTsDemux 音声(wav化)取り出し", exe, txt) except: "" ffpin = pin.replace(".ts", "") @@ -242,7 +240,7 @@ def singleaudio2sep(pin): recdblist.printutf8(exe) txt=commands.getoutput(exe.encode('utf-8')) try: - recdblist.addlog(pin, txt, "singleaudio-sep2(raw aac) ffmpeg") + recdblist.addCommandLog(pin, u"FFmpeg 音声(raw AAC)取り出し", exe, txt) except: "" ffpout21=ffpout1.replace(".wav",".mp3") diff --git a/rec10/trunk/src/tv2mp4.py b/rec10/trunk/src/tv2mp4.py index 27c2928..daaf0a0 100644 --- a/rec10/trunk/src/tv2mp4.py +++ b/rec10/trunk/src/tv2mp4.py @@ -53,7 +53,8 @@ def raw2mp4(pin,pout,opt): execmp4box(pin, pout, e1) addAudio(pints, pout, opt) addCaption(pints, pout) - recdblist.addlog(pout, txt, "mp4box-log") + #recdblist.addlog(pout, txt, "mp4boxログ-コマンド") + #recdblist.addlog(pout, txt, "mp4boxログ-詳細") if status.getSettings_auto_del_tmp()==1: if os.path.exists(pout): if re.search(opt,"MW8") or re.search(opt,"MW9"): @@ -90,7 +91,7 @@ def mkv2mp4(pin,pout): txt=txt+execcomd(exe3)+"\n" except: "" - recdblist.addlog(pin, txt, "MKV2MP4-log") + recdblist.addlog(pin, txt, u"MKV2MP4-log") txt = "\n####MKV2MP4-log####\n"+txt time.sleep(10) if status.getSettings_auto_del_tmp()==1: @@ -116,7 +117,8 @@ def addCaption(pts,pmp4):##字幕の追加を試みる。 #else: os.waitpid(p0.pid, 0) logt=unicode(p0.communicate()[0], "UTF-8") - recdblist.addlog(pts,logt, "Caption-Log") + recdblist.addlog(pts,e0, u"Captionログ-コマンド") + recdblist.addlog(pts,logt, u"Captionログ-詳細") if os.path.getsize(pincap)>1000: exe = configreader.getpath("mp4box") e1s=exe +u" -add \""+pincap+"\" \""+pmp4+"\"" @@ -162,7 +164,8 @@ def execmp4box(pin,pout,cmd): txt= "error occures in execmp4box\n" txt=txt+ str(type(inst))+"\n" txt=txt+str(inst) - recdblist.addlog(pin, txt, "MP4Box-log") + recdblist.addlog(pin, cmdn, u"MP4Boxログ-コマンド") + recdblist.addlog(pin, txt, u"MP4Boxログ-詳細") time.sleep(5) shutil.move(ptin,pin) shutil.move(ptout,pout) @@ -192,7 +195,8 @@ def addmp4(padd,pout,cmd):#without video txt= "error occures in addmp4\n" txt=txt+ str(type(inst))+"\n" txt=txt+str(inst) - recdblist.addlog(pout, txt, "MP4Box-log-add") + recdblist.addlog(pout, cmdn, u"MP4Box追加ログ-コマンド") + recdblist.addlog(pout, txt, u"MP4Box追加ログ-詳細") time.sleep(5) os.remove(ptoutb) shutil.move(ptadd,padd) diff --git a/rec10/trunk/src/tv2ts.py b/rec10/trunk/src/tv2ts.py index 3015ca4..3f7d74b 100644 --- a/rec10/trunk/src/tv2ts.py +++ b/rec10/trunk/src/tv2ts.py @@ -29,9 +29,7 @@ def tv2ts(pout, ch, csch, time): try: tv2b25ts(pout + ".b25", ch, time) except Exception, inst: - recdblist.printutf8("error occures in tv2ts.py tv2ts") - recdblist.printutf8(str(type(inst))) - recdblist.printutf8(str(inst)) + recdblist.Commonlogex(u"Error",u"tv2ts(tv2ts.py)", str(type(inst)),str(inst)) if len(ch) > 2:#BS/CSは100とかCS??とかなので3文字以上 status.changeBSCSRecording(-1) else: @@ -83,11 +81,10 @@ def tv2b25ts(pout, ch, time): try: doexe = exe + ' ' + ch + ' ' + time + ' \'' + pout + '\'' recdblist.printutf8(doexe) - recdblist.addlog(pout, unicode(commands.getoutput(doexe.encode('utf-8')),'utf-8'), u"recpt1-log") + recdblist.addlog(pout, doexe, u"recpt1ログ-コマンド") + recdblist.addlog(pout, unicode(commands.getoutput(doexe.encode('utf-8')),'utf-8'), u"recpt1ログ-詳細") except Exception, inst: - recdblist.printutf8("error occures in tv2ts.py tv2b25ts") - recdblist.printutf8(str(type(inst))) - recdblist.printutf8(str(inst)) + recdblist.Commonlogex(u"Error",u"tv2b25ts(tv2ts.py)", str(type(inst)),str(inst)) if len(ch) > 2:#BS/CSは100とかCS??とかなので3文字以上 status.changeBSCSRecording(-1) else: @@ -103,19 +100,21 @@ def b252tsmix(pin, pout): try: exe = configreader.getpath('b25_env')+" && " except: - recdblist.printutf8(u"b25_remoteがオンになっていますが、b25_envが設定されていないかコメントアウトされています。") + inst=u"b25_remoteがオンになっていますが、b25_envが設定されていないかコメントアウトされています。" + recdblist.Commonlogex(u"Error",u"b252tsmix(tv2ts.py)", "",inst) exe = exe + "nice -n 17 " + configreader.getpath('b25') doexe = exe + u' \"' + pin + u'\" \"' + pout + u'\"' recdblist.printutf8(doexe) txt = unicode(commands.getoutput(doexe.encode('utf-8')),'utf-8') - recdblist.addlog(pin, txt, u"b25-log") + 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 = "nice -n 18 " + doexe os.environ['LANG']="ja_JP.UTF-8" txt = unicode(commands.getoutput(doexe.encode('utf-8')),'utf-8') - txt = doexe+"\n\n"+txt - recdblist.addlog(pin, txt, "tssplit-log") + 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)