From: longinus Date: Fri, 4 Jan 2013 15:46:22 +0000 (+0000) Subject: add manual mode to classify.pl X-Git-Url: http://git.osdn.net/view?p=rec10%2Frec10-git.git;a=commitdiff_plain;h=3ebb101303a74c7239e34337f10e16b0bbbb2eba add manual mode to classify.pl git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/rec10@951 4e526526-5e11-4fc0-8910-f8fd03428081 --- diff --git a/rec10/trunk/src/auto_move.py b/rec10/trunk/src/auto_move.py index 288e49d..9f7f95e 100644 --- a/rec10/trunk/src/auto_move.py +++ b/rec10/trunk/src/auto_move.py @@ -107,7 +107,8 @@ def veryfySize(path): return ret def execMove(title,temppath,recpath,ext,autodel): srcpath=os.path.join(temppath,title+ext) - sf=guess.searchFolder(title, recpath) + # patched. orig: searchFolder(title, recpath) + sf=guess.searchFolder(title, recpath,200) if sf!="": destpath=os.path.join(sf,getMoveDestpath(title, temppath, sf, ext)+ext) if os.path.exists(destpath): @@ -135,7 +136,10 @@ def execMove(title,temppath,recpath,ext,autodel): os.remove(dp) "" except: - "" + "" + else: + recdblist.printutf8("sf not fonud @ execMove",verbose_level=100) + def execDelete(title,temppath): delpath=getDelpath(temppath, title,0) recdblist.printutf8(title+u" 関連の一時ファイルを削除します") diff --git a/rec10/trunk/src/classify.py b/rec10/trunk/src/classify.py index 29c72ee..9d0ca14 100644 --- a/rec10/trunk/src/classify.py +++ b/rec10/trunk/src/classify.py @@ -27,6 +27,7 @@ if __name__ == "__main__": parser.add_option("-t","--tssearch",action="store_true",dest="tssearch",default=False,help="Ts move auto search") parser.add_option("-T","--Tsmove",action="store_true",dest="tsmove",default=False,help="Ts auto move.") parser.add_option("-S","--SeriesNum",action="store",type="string",dest="seriespath",default="",metavar="TITLE",help="Search Series Number in the path.") + parser.add_option("-m","--manual",action="store_true",dest="manual",default=False,help="manual classifying mode asking for y/n(not a test)") #parser.add_option("-f","--filenumlist",action="store_true",dest="filenumlist",default=False,help="Guess Program Number.") (opts,args)=parser.parse_args(sys.argv) @@ -54,7 +55,7 @@ if __name__ == "__main__": sa=auto_move.searchFile(recpath, recordedpath, ".mp4") for t in sa: recdblist.printutf8(u"自動推測実行中-MP4",verbose_level=100) - sf=guess.searchFolder(t,recordedpath) + sf=guess.searchFolder(t,recordedpath,200) if sf!="": recdblist.printutf8(u"移動先",verbose_level=100) recdblist.printutf8(t+" : "+os.path.join(sf, auto_move.getMoveDestpath(t, recpath,sf,".mp4")+".mp4"),verbose_level=100) @@ -62,6 +63,24 @@ if __name__ == "__main__": auto_move.execMove(t, recpath, recordedpath,".mp4",1) else: recdblist.printutf8(t+" can't find matching folder",verbose_level=100) + elif opts.manual:##-m の場合 + # mkv無視します + sa=auto_move.searchFile(recpath, recordedpath, ".mp4") + for t in sa: + sf=guess.searchFolder(t,recordedpath,200) + if sf!="": + recdblist.printutf8(u"○候補:"+os.path.join(sf, auto_move.getMoveDestpath(t, recpath,sf,".mp4")+".mp4"),verbose_level=100) + ans = raw_input("移動しますか? (y/n/h)") + if ans == 'y': + recdblist.printutf8(u"移動を実行します",verbose_level=100) + auto_move.execMove(t, recpath, recordedpath,".mp4",1) + elif ans == 'n': + recdblist.printutf8(u"移動を中止します",verbose_level=100) + elif ans == 'h': + recdblist.printutf8(u"移動のヒント",verbose_level=100) + recdblist.printutf8(u"FIXME:not implemented",verbose_level=100) + else: + recdblist.printutf8(u"×不明:"+t,verbose_level=100) elif opts.delete:##-Dの場合 sa=auto_move.searchFile(recpath, recordedpath,".mkv") for t in sa: