Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
lxml
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OpenVMS
Python
Modules
lxml
Commits
81e3cbf0c230
Commit
81e3cbf0c230
authored
9 years ago
by
Stefan Behnel
Browse files
Options
Downloads
Patches
Plain Diff
remove legacy code
parent
652a02a342bd
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
buildlibxml.py
+2
-49
2 additions, 49 deletions
buildlibxml.py
with
2 additions
and
49 deletions
buildlibxml.py
+
2
−
49
View file @
81e3cbf0
...
...
@@ -182,54 +182,6 @@
urlretrieve
(
full_url
,
dest_filename
)
return
dest_filename
## Backported method of tarfile.TarFile.extractall (doesn't exist in 2.4):
def
_extractall
(
self
,
path
=
"
.
"
,
members
=
None
):
"""
Extract all members from the archive to the current working
directory and set owner, modification time and permissions on
directories afterwards. `path
'
specifies a different directory
to extract to. `members
'
is optional and must be a subset of the
list returned by getmembers().
"""
import
copy
is_ignored_file
=
re
.
compile
(
r
'''
[\\/]((test|results?)[\\/]
|doc[\\/].*(Log|[.](out|imp|err|ent|gif|tif|pdf))$
|tests[\\/](.*[\\/])?(?!Makefile)[^\\/]*$
|python[\\/].*[.]py$
)
'''
,
re
.
X
).
search
directories
=
[]
if
members
is
None
:
members
=
self
for
tarinfo
in
members
:
if
is_ignored_file
(
tarinfo
.
name
):
continue
if
tarinfo
.
isdir
():
# Extract directories with a safe mode.
directories
.
append
((
tarinfo
.
name
,
tarinfo
))
tarinfo
=
copy
.
copy
(
tarinfo
)
tarinfo
.
mode
=
448
# 0700
self
.
extract
(
tarinfo
,
path
)
# Reverse sort directories.
directories
.
sort
()
directories
.
reverse
()
# Set correct owner, mtime and filemode on directories.
for
name
,
tarinfo
in
directories
:
dirpath
=
os
.
path
.
join
(
path
,
name
)
try
:
self
.
chown
(
tarinfo
,
dirpath
)
self
.
utime
(
tarinfo
,
dirpath
)
self
.
chmod
(
tarinfo
,
dirpath
)
except
tarfile
.
ExtractError
:
if
self
.
errorlevel
>
1
:
raise
else
:
self
.
_dbg
(
1
,
"
tarfile: %s
"
%
sys
.
exc_info
()[
1
])
def
unpack_tarball
(
tar_filename
,
dest
):
print
(
'
Unpacking %s into %s
'
%
(
os
.
path
.
basename
(
tar_filename
),
dest
))
...
...
@@ -242,7 +194,7 @@
else
:
if
base_dir
!=
base_name
:
print
(
'
Unexpected path in %s: %s
'
%
(
tar_filename
,
base_name
))
_
extractall
(
tar
,
dest
)
tar
.
extractall
(
dest
)
tar
.
close
()
return
os
.
path
.
join
(
dest
,
base_dir
)
...
...
@@ -246,6 +198,7 @@
tar
.
close
()
return
os
.
path
.
join
(
dest
,
base_dir
)
def
call_subprocess
(
cmd
,
**
kw
):
try
:
from
subprocess
import
proc_call
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment