OSDN Git Service

add manual mode to classify.pl
authorlonginus <longinus@4e526526-5e11-4fc0-8910-f8fd03428081>
Fri, 4 Jan 2013 15:46:22 +0000 (15:46 +0000)
committerlonginus <longinus@4e526526-5e11-4fc0-8910-f8fd03428081>
Fri, 4 Jan 2013 15:46:22 +0000 (15:46 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/rec10@951 4e526526-5e11-4fc0-8910-f8fd03428081

rec10/trunk/src/auto_move.py
rec10/trunk/src/classify.py

index 288e49d..9f7f95e 100644 (file)
@@ -107,7 +107,8 @@ def veryfySize(path):
     return ret\r
 def execMove(title,temppath,recpath,ext,autodel):\r
     srcpath=os.path.join(temppath,title+ext)\r
-    sf=guess.searchFolder(title, recpath)\r
+    # patched. orig: searchFolder(title, recpath)
+    sf=guess.searchFolder(title, recpath,200)\r
     if sf!="":\r
         destpath=os.path.join(sf,getMoveDestpath(title, temppath, sf, ext)+ext)\r
         if os.path.exists(destpath):\r
@@ -135,7 +136,10 @@ def execMove(title,temppath,recpath,ext,autodel):
                         os.remove(dp)\r
                         ""\r
                     except:\r
-                        ""\r
+                        ""
+    else:
+        recdblist.printutf8("sf not fonud @ execMove",verbose_level=100)
+\r
 def execDelete(title,temppath):\r
     delpath=getDelpath(temppath, title,0)\r
     recdblist.printutf8(title+u" 関連の一時ファイルを削除します")\r
index 29c72ee..9d0ca14 100644 (file)
@@ -27,6 +27,7 @@ if __name__ == "__main__":
     parser.add_option("-t","--tssearch",action="store_true",dest="tssearch",default=False,help="Ts move auto search")\r
     parser.add_option("-T","--Tsmove",action="store_true",dest="tsmove",default=False,help="Ts auto move.")\r
     parser.add_option("-S","--SeriesNum",action="store",type="string",dest="seriespath",default="",metavar="TITLE",help="Search Series Number in the path.")\r
+    parser.add_option("-m","--manual",action="store_true",dest="manual",default=False,help="manual classifying mode asking for y/n(not a test)")\r
     #parser.add_option("-f","--filenumlist",action="store_true",dest="filenumlist",default=False,help="Guess Program Number.")\r
 \r
     (opts,args)=parser.parse_args(sys.argv)\r
@@ -54,7 +55,7 @@ if __name__ == "__main__":
         sa=auto_move.searchFile(recpath, recordedpath, ".mp4")\r
         for t in sa:\r
             recdblist.printutf8(u"自動推測実行中-MP4",verbose_level=100)\r
-            sf=guess.searchFolder(t,recordedpath)\r
+            sf=guess.searchFolder(t,recordedpath,200)\r
             if sf!="":\r
                 recdblist.printutf8(u"移動先",verbose_level=100)\r
                 recdblist.printutf8(t+" : "+os.path.join(sf, auto_move.getMoveDestpath(t, recpath,sf,".mp4")+".mp4"),verbose_level=100)\r
@@ -62,6 +63,24 @@ if __name__ == "__main__":
                 auto_move.execMove(t, recpath, recordedpath,".mp4",1)\r
             else:\r
                 recdblist.printutf8(t+" can't find matching folder",verbose_level=100)\r
+    elif opts.manual:##-m の場合\r
+        # mkv無視します
+        sa=auto_move.searchFile(recpath, recordedpath, ".mp4")\r
+        for t in sa:\r
+            sf=guess.searchFolder(t,recordedpath,200)\r
+            if sf!="":\r
+                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)\r
+                    auto_move.execMove(t, recpath, recordedpath,".mp4",1)
+                elif ans == 'n':\r
+                    recdblist.printutf8(u"移動を中止します",verbose_level=100)\r
+                elif ans == 'h':\r
+                    recdblist.printutf8(u"移動のヒント",verbose_level=100)\r
+                    recdblist.printutf8(u"FIXME:not implemented",verbose_level=100)\r
+            else:\r
+                recdblist.printutf8(u"×不明:"+t,verbose_level=100)\r
     elif opts.delete:##-Dの場合\r
         sa=auto_move.searchFile(recpath, recordedpath,".mkv")\r
         for t in sa:\r