OSDN Git Service

fix some miss.
authorgn64_jp <gn64_jp@4e526526-5e11-4fc0-8910-f8fd03428081>
Fri, 14 May 2010 06:45:12 +0000 (06:45 +0000)
committergn64_jp <gn64_jp@4e526526-5e11-4fc0-8910-f8fd03428081>
Fri, 14 May 2010 06:45:12 +0000 (06:45 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/rec10@600 4e526526-5e11-4fc0-8910-f8fd03428081

rec10/trunk/src/guess.py

index c520092..4b1cbb5 100644 (file)
@@ -24,9 +24,10 @@ def detSeriesNum(execpath):
     for file in files:
         ftitle=os.path.splitext(file)
         fname=ftitle[0]
-        fname=zenhan.toHankaku(unicode(fname))
+        fname=zenhan.toHankaku(unicode(fname,"utf-8"))
+        print type(fname)
         st=detNameType(fname, execpath)['title']
-        if not len(ss[st])>0:
+        if not ss.has_key(st):
             ss[st]=[]
         ss[detNum(fname,execpath)]=ftitle
     return ss
@@ -38,12 +39,12 @@ def detNum(title,movepath):
     ff=[]
     maxnum=0
     for file in files:
-        recdblist.printutf8(file)
+        recdblist.printutf8(unicode(file,'utf-8'))
         file=os.path.join(movepath,file)
         if os.path.isfile(file):
             name=os.path.splitext(os.path.split(file)[1])
             name=name[0]
-            name=zenhan.toHankaku(unicode(name))
+            name=zenhan.toHankaku(unicode(name,'utf-8'))
             p1=detNameType(name,movepath)
             recdblist.printutf8(p1['title']+" "+str(p1['num']))
             time1=time.localtime(os.path.getmtime(file))
@@ -142,7 +143,7 @@ def detNameType(title,path):
         ret['type']="A"
         ret['title']=tA.group(1)
         ret['num']=int(tA.group(2))
-        ret['folder']=searchFolder(tA.group(1),path)
+        ret['folder']=searchFolder(tA.group(1),unicode(path,'utf-8'))
     if tAj:
         recdblist.printutf8("typeA")
         recdblist.printutf8("title="+tAj.group(1))
@@ -150,7 +151,7 @@ def detNameType(title,path):
         ret['type']="Aj"
         ret['title']=tAj.group(1)
         ret['num']=int(tAj.group(2))
-        ret['folder']=searchFolder(tAj.group(1),path)
+        ret['folder']=searchFolder(tAj.group(1),unicode(path,'utf-8'))
     elif tB:
         recdblist.printutf8("typeB")
         recdblist.printutf8("title="+tB.group(1))
@@ -159,7 +160,7 @@ def detNameType(title,path):
         ret['type']="B"
         ret['title']=tB.group(1)
         ret['num']=int(tB.group(2))
-        ret['folder']=searchFolder(tB.group(1),path)
+        ret['folder']=searchFolder(tB.group(1),unicode(path,'utf-8'))
         ret['subtitle']=tB.group(3)
     else:#type C or type D
         #fold=searchFolder(title, path)
@@ -168,7 +169,7 @@ def detNameType(title,path):
         rt=["",0,""]
         for t in ts:
             tt=tt+" "+t
-            ft1=searchFolder(tt,path)
+            ft1=searchFolder(tt,unicode(path,'utf-8'))
             recdblist.printutf8(tt)
             #print ft1
             if ft1!="":