From cec4c2c2811bfc2042e9cadc42e6ab5d6e30bda7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Metin?= Date: Mon, 20 Jun 2005 13:33:28 +0000 Subject: [PATCH] =?UTF-8?q?bir=20toplevel=20dizin=20i=C3=A7in=20t=C3=BCm?= =?UTF-8?q?=20dosya=20ve=20hash=20bilgisini=20olu=C5=9Fturan=20generator?= =?UTF-8?q?=20(get=5Ffile=5Fhashes)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pisi/util.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pisi/util.py b/pisi/util.py index b62c6045..cd700f8e 100644 --- a/pisi/util.py +++ b/pisi/util.py @@ -63,6 +63,12 @@ def copy_file(src,dest): # fd.write(l) shutil.copyfile(src, dest) +def get_file_hashes(top): + for root, dirs, files in os.walk(top, topdown=False): + for file in files: + f = os.path.join(root, file) + yield (f, md5_file(f)) + def copy_dir(src, dest): """copy source dir to destination dir recursively""" raise UtilError("not implemented")