1
0
mirror of https://github.com/Tygs/0bin.git synced 2023-08-10 21:13:00 +03:00

fix(burn_after_reading): removes empty directories

This commit is contained in:
Jean-Christophe Saad-Dupuy 2014-07-14 17:25:58 +02:00
parent 4de492fb84
commit 9e5c4ea2b1

View File

@ -305,7 +305,9 @@ class Paste(object):
deleted_paste = 0 deleted_paste = 0
if os.path.exists(path): if os.path.exists(path):
for folder, _ , files in os.walk(path): for folder, subfolders , files in os.walk(path):
if len(files) == 0 and len(subfolders) == 0:
os.rmdir(folder)
for fname in files: for fname in files:
if fname in ignore_files: if fname in ignore_files:
continue continue