Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.buildout
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
6
Merge Requests
6
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
slapos.buildout
Commits
260bc0c4
Commit
260bc0c4
authored
Oct 19, 2015
by
Kazuhiko Shiozaki
Committed by
Julien Muchembled
Dec 04, 2019
4
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cache downloaded data in zc/buildout/buildout.py:_open() in memory to accelerate remote extends.
parent
f01fe7df
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
src/zc/buildout/buildout.py
src/zc/buildout/buildout.py
+14
-6
No files found.
src/zc/buildout/buildout.py
View file @
260bc0c4
...
@@ -27,6 +27,11 @@ try:
...
@@ -27,6 +27,11 @@ try:
except
ImportError
:
except
ImportError
:
from
collections
import
MutableMapping
as
DictMixin
from
collections
import
MutableMapping
as
DictMixin
try
:
from
cStringIO
import
StringIO
except
ImportError
:
from
io
import
StringIO
import
zc.buildout.configparser
import
zc.buildout.configparser
import
copy
import
copy
import
datetime
import
datetime
...
@@ -1206,10 +1211,6 @@ class Buildout(DictMixin):
...
@@ -1206,10 +1211,6 @@ class Buildout(DictMixin):
self
[
name
]
# Add to parts
self
[
name
]
# Add to parts
def
parse
(
self
,
data
):
def
parse
(
self
,
data
):
try
:
from
cStringIO
import
StringIO
except
ImportError
:
from
io
import
StringIO
import
textwrap
import
textwrap
sections
=
zc
.
buildout
.
configparser
.
parse
(
sections
=
zc
.
buildout
.
configparser
.
parse
(
...
@@ -1622,6 +1623,7 @@ def _default_globals():
...
@@ -1622,6 +1623,7 @@ def _default_globals():
return
globals_defs
return
globals_defs
_open_download_cache
=
{}
def
_open
(
base
,
filename
,
seen
,
dl_options
,
override
,
downloaded
):
def
_open
(
base
,
filename
,
seen
,
dl_options
,
override
,
downloaded
):
"""Open a configuration file and return the result as a dictionary,
"""Open a configuration file and return the result as a dictionary,
...
@@ -1651,8 +1653,14 @@ def _open(base, filename, seen, dl_options, override, downloaded):
...
@@ -1651,8 +1653,14 @@ def _open(base, filename, seen, dl_options, override, downloaded):
base
=
os
.
path
.
dirname
(
filename
)
base
=
os
.
path
.
dirname
(
filename
)
else
:
else
:
filename
=
base
+
'/'
+
filename
filename
=
base
+
'/'
+
filename
downloaded_filename
,
is_temp
=
download
(
filename
)
data
=
_open_download_cache
.
get
(
filename
)
fp
=
open
(
downloaded_filename
)
if
data
is
None
:
downloaded_filename
,
is_temp
=
download
(
filename
)
data
=
open
(
downloaded_filename
).
read
()
_open_download_cache
[
filename
]
=
data
else
:
is_temp
=
False
fp
=
StringIO
(
data
)
base
=
filename
[:
filename
.
rfind
(
'/'
)]
base
=
filename
[:
filename
.
rfind
(
'/'
)]
else
:
else
:
filename
=
os
.
path
.
join
(
base
,
filename
)
filename
=
os
.
path
.
join
(
base
,
filename
)
...
...
Julien Muchembled
@jm
mentioned in commit
2242d941
·
May 05, 2020
mentioned in commit
2242d941
mentioned in commit 2242d9416ee4e383d34213661c16dd641b6add9f
Toggle commit list
Xavier Thompson
@xavier_thompson
mentioned in merge request
!30 (merged)
·
Apr 02, 2024
mentioned in merge request
!30 (merged)
mentioned in merge request !30
Toggle commit list
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