From b9e60da5456eaec51d850f5ad879964e1ca2f443 Mon Sep 17 00:00:00 2001 From: Bastian Kleineidam Date: Mon, 9 Apr 2012 12:26:54 +0200 Subject: [PATCH] Allow verbose option in diff and repack commands. --- patoolib/__init__.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/patoolib/__init__.py b/patoolib/__init__.py index 391484c..7b3998f 100644 --- a/patoolib/__init__.py +++ b/patoolib/__init__.py @@ -468,7 +468,7 @@ def rmtree_log_error (func, path, exc): util.log_error(msg) -def _diff_archives (archive1, archive2): +def _diff_archives (archive1, archive2, **kwargs): """Show differences between two archives.""" diff = util.find_program("diff") if not diff: @@ -476,23 +476,23 @@ def _diff_archives (archive1, archive2): tmpdir1 = util.tmpdir() tmpdir2 = util.tmpdir() try: - path1 = _handle_archive(archive1, 'extract', outdir=tmpdir1) - path2 = _handle_archive(archive2, 'extract', outdir=tmpdir2) + path1 = _handle_archive(archive1, 'extract', outdir=tmpdir1, **kwargs) + path2 = _handle_archive(archive2, 'extract', outdir=tmpdir2, **kwargs) return util.run([diff, "-urN", path1, path2]) finally: shutil.rmtree(tmpdir1, onerror=rmtree_log_error) shutil.rmtree(tmpdir2, onerror=rmtree_log_error) -def _repack_archive (archive1, archive2): +def _repack_archive (archive1, archive2, **kwargs): """Repackage an archive to a different format.""" tmpdir = util.tmpdir() try: - _handle_archive(archive1, 'extract', outdir=tmpdir) + _handle_archive(archive1, 'extract', outdir=tmpdir, **kwargs) archive = os.path.abspath(archive2) files = tuple(os.listdir(tmpdir)) os.chdir(tmpdir) - _handle_archive(archive, 'create', *files) + _handle_archive(archive, 'create', *files, **kwargs) return 0 finally: shutil.rmtree(tmpdir, onerror=rmtree_log_error)