88888888q commited on
Commit
85d893d
1 Parent(s): d4a3428

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -2
app.py CHANGED
@@ -847,13 +847,29 @@ def reverse(file,presid,type):
847
  wb = openpyxl.load_workbook(file.name)
848
  ws = wb.active
849
  pbs = {}
 
 
 
850
  print(file.name)
851
-
852
- files = os.listdir("/tmp/gradio/")
853
  # 打印所有文件名
854
  for xfile in files:
 
855
  print(xfile)
 
 
 
 
 
 
 
 
 
856
 
 
 
 
857
  for zc in presid.split("\n"):
858
  xx = zc.split("\t")
859
  pb = presideOverBean()
 
847
  wb = openpyxl.load_workbook(file.name)
848
  ws = wb.active
849
  pbs = {}
850
+
851
+
852
+ wz="/tmp/gradio/"
853
  print(file.name)
854
+ files = os.listdir(wz)
855
+ print("文件信息")
856
  # 打印所有文件名
857
  for xfile in files:
858
+ print("--------------")
859
  print(xfile)
860
+ if(os.path.isdir(wz+xfile)):
861
+ ftime = time.strftime("%Y-%m-%d", time.localtime(os.stat(wz + xfile).st_ctime))
862
+ mtime = time.strftime("%Y-%m-%d", time.localtime(time.time()))
863
+ print(time.strftime("%Y-%m-%d",time.localtime(os.stat(wz+xfile).st_ctime)))
864
+ print(time.strftime("%Y-%m-%d",time.localtime(time.time())))
865
+
866
+ if(ftime!=mtime):
867
+ shutil.rmtree(wz + xfile)
868
+ print(ftime,xfile,"移除")
869
 
870
+
871
+
872
+
873
  for zc in presid.split("\n"):
874
  xx = zc.split("\t")
875
  pb = presideOverBean()