From 7a28cc483b0bf62195cd3fea0045c84b45ae2298 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Metin?= Date: Sat, 2 Jul 2005 01:15:43 +0000 Subject: [PATCH] don't reimplement the wheel --- pisi/util.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/pisi/util.py b/pisi/util.py index bbb1ca4f..5788a361 100644 --- a/pisi/util.py +++ b/pisi/util.py @@ -143,13 +143,15 @@ def check_dir(dir): if not os.access(dir, os.F_OK): os.makedirs(dir) -def clean_dir(top): +def clean_dir(path): "Remove all content of a directory (top)" - for root, dirs, files in os.walk(top, topdown=False): - for name in files: - os.remove(os.path.join(root, name)) - for name in dirs: - os.rmdir(os.path.join(root, name)) +# for root, dirs, files in os.walk(top, topdown=False): +# for name in files: +# os.remove(os.path.join(root, name)) +# for name in dirs: +# os.rmdir(os.path.join(root, name)) +# don't reimplement the wheel + shutil.rmtree(path) def dir_size(dir): """ calculate the size of files under a dir