diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2014-05-17 22:58:50 -0400 |
|---|---|---|
| committer | Jason R. Coombs <jaraco@jaraco.com> | 2014-05-17 22:58:50 -0400 |
| commit | e980c6cd2646e95f9bca0ebbeda428840ba6d8d8 (patch) | |
| tree | a6faafce32af63c13cd01f554e7aabdbc855ccd5 | |
| parent | 220f60274f3e6bd4e871917dae5f585f8a756b84 (diff) | |
| download | python-setuptools-bitbucket-e980c6cd2646e95f9bca0ebbeda428840ba6d8d8.tar.gz | |
Clean up whitespace
| -rwxr-xr-x | setuptools/archive_util.py | 54 |
1 files changed, 7 insertions, 47 deletions
diff --git a/setuptools/archive_util.py b/setuptools/archive_util.py index 1109f346..a5be2f98 100755 --- a/setuptools/archive_util.py +++ b/setuptools/archive_util.py @@ -6,7 +6,11 @@ __all__ = [ "UnrecognizedFormat", "extraction_drivers", "unpack_directory", ] -import zipfile, tarfile, os, shutil, posixpath +import zipfile +import tarfile +import os +import shutil +import posixpath from pkg_resources import ensure_directory from distutils.errors import DistutilsError @@ -14,34 +18,12 @@ class UnrecognizedFormat(DistutilsError): """Couldn't recognize the archive type""" def default_filter(src,dst): - """The default progress/filter callback; returns True for all files""" + """The default progress/filter callback; returns True for all files""" return dst - - - - - - - - - - - - - - - - - - - - - def unpack_archive(filename, extract_dir, progress_filter=default_filter, - drivers=None -): + drivers=None): """Unpack `filename` to `extract_dir`, or raise ``UnrecognizedFormat`` `progress_filter` is a function taking two arguments: a source path @@ -75,11 +57,6 @@ def unpack_archive(filename, extract_dir, progress_filter=default_filter, ) - - - - - def unpack_directory(filename, extract_dir, progress_filter=default_filter): """"Unpack" a directory, using the same interface as for archives @@ -94,7 +71,6 @@ def unpack_directory(filename, extract_dir, progress_filter=default_filter): for d in dirs: paths[os.path.join(base,d)] = src+d+'/', os.path.join(dst,d) for f in files: - name = src+f target = os.path.join(dst,f) target = progress_filter(src+f, target) if not target: @@ -105,22 +81,6 @@ def unpack_directory(filename, extract_dir, progress_filter=default_filter): shutil.copystat(f, target) - - - - - - - - - - - - - - - - def unpack_zipfile(filename, extract_dir, progress_filter=default_filter): """Unpack zip `filename` to `extract_dir` |
