Commits

_vios  committed ba72488 Merge

Merge branch 'master' of github.com:viosgithub/rebook

  • Participants
  • Parent commits 5e8b3b3, a8bd92b

Comments (0)

Files changed (1)

         originalFile = path
         if not os.path.isdir(path):
             print "this is not direcotry!!"
-            ext = os.path.splitext(path)[1]
+            ext = os.path.splitext(path)[1].lower()
             if ext == ".zip":
                 print "zip!"
                 path = self.unzip(path)
         else:
             os.mkdir("tmp")
         targetZIP =  zipfile.ZipFile(path,"r")
-        print targetZIP.namelist()
+        countMax = len(targetZIP.namelist())
+        count = 0
+        dlg = wx.ProgressDialog(u"ZIPを展開中...","",maximum = countMax,parent=self,
+                style = wx.PD_APP_MODAL|wx.PD_ELAPSED_TIME|wx.PD_REMAINING_TIME|wx.PD_AUTO_HIDE|wx.PD_SMOOTH)
+        dlg.SetSize((500,150))
+
         for f in targetZIP.namelist():
+            count+=1
             if not os.path.basename(f):
                 os.mkdir(os.path.join("tmp",f))
             else:
                 unzipFile = file(os.path.join("tmp",f),"wb")
+                dlg.Update(count,u"%s を解凍中" % f)
                 unzipFile.write(targetZIP.read(f))
                 unzipFile.close()
+
         targetZIP.close()
+        dlg.Destroy()
         return os.path.abspath("tmp")