From 912678e8351e0aeeb28022e723a11f2114df062d Mon Sep 17 00:00:00 2001 From: darko-poljak Date: Mon, 27 Jan 2014 08:22:37 +0100 Subject: [PATCH] do_with_file_dups changed to more appropriate iter_file_dups. --- README.rst | 2 +- sweeper/__init__.py | 2 +- sweeper/sweeper.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index aa312c7..455420d 100644 --- a/README.rst +++ b/README.rst @@ -26,7 +26,7 @@ Perform custom action .. code:: python from sweeper import file_dups - for files in do_with_file_dups(['images']): + for files in iter_file_dups(['images']): for fname in files: print('found duplicte file with name: %s' % fname) diff --git a/sweeper/__init__.py b/sweeper/__init__.py index 107312c..6816de0 100644 --- a/sweeper/__init__.py +++ b/sweeper/__init__.py @@ -1,4 +1,4 @@ from __future__ import absolute_import from .sweeper import file_dups -__all__ = ['file_dups', 'mv_file_dups', 'rm_file_dups', 'do_with_file_dups'] +__all__ = ['file_dups', 'mv_file_dups', 'rm_file_dups', 'iter_file_dups'] diff --git a/sweeper/sweeper.py b/sweeper/sweeper.py index 7d9d4da..2101453 100644 --- a/sweeper/sweeper.py +++ b/sweeper/sweeper.py @@ -25,7 +25,7 @@ __version__ = '0.1.0' __license__ = 'GPLv3' __all__ = [ - 'file_dups', 'rm_file_dups', 'mv_file_dups', 'do_with_file_dups' + 'file_dups', 'rm_file_dups', 'mv_file_dups', 'iter_file_dups' ] import sys @@ -101,7 +101,7 @@ def mv_file_dups(topdirs=['./'], hashalg='md5', block_size=4096, dest_dir='dups' shutil.move(f, dest_dir) -def do_with_file_dups(topdirs=['./'], hashalg='md5', block_size=4096): +def iter_file_dups(topdirs=['./'], hashalg='md5', block_size=4096): """Yield list of duplicate files when found in specified directory list. """ dups = file_dups(topdirs, hashalg, block_size)