Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
setuptools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
setuptools
Commits
14f168f2
Commit
14f168f2
authored
May 17, 2014
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up whitespace
parent
f4955997
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
47 deletions
+7
-47
setuptools/archive_util.py
setuptools/archive_util.py
+7
-47
No files found.
setuptools/archive_util.py
View file @
14f168f2
...
...
@@ -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`
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment