OSDN Git Service

improve some function.
[rec10/rec10-git.git] / rec10 / trunk / src / checker.py
index 5766689..33bb680 100644 (file)
@@ -5,16 +5,20 @@
 import time
 import os
 def checkB25Decode(b25filepath,decodedfilepath):
+    ret=0
     if os.path.isfile(decodedfilepath):##tsファイルが存在している
         dtime=time.time()-os.path.getmtime(decodedfilepath)
         dtime=int(dtime)
         if dtime > 120 :
-            return compareFilesize(b25filepath,decodedfilepath,10) and minimizeCheck(decodedfilepath, 1000)
+            if (compareFilesize(b25filepath,decodedfilepath,10) and minimizeCheck(decodedfilepath, 800)):
+                ret=1
         else:
             time.sleep(100)
             if dtime > 120 :
-                return compareFilesize(b25filepath,decodedfilepath,10) and minimizeCheck(decodedfilepath, 1000)
-    return 0
+                if (compareFilesize(b25filepath,decodedfilepath,10) and minimizeCheck(decodedfilepath, 800)):
+                    ret=1
+    print "delete b25 is "+str(ret)
+    return ret
 def compareFilesize(pathbase,path,percentage):
     """
     return true if size of path is larger than that of pathbase.
@@ -31,6 +35,7 @@ def minimizeCheck(filepath,minsize):
     """
     minsize is Megabytes
     """
+    print os.path.getsize(filepath)
     if os.path.getsize(filepath)>minsize*1000*1000:
         return 1
     else: