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
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Rafael Monnerat
slapos.buildout
Commits
0b87d146
Commit
0b87d146
authored
Dec 13, 2014
by
Kazuhiko Shiozaki
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
931a4b73
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
3 deletions
+16
-3
CHANGES.SlapOS.txt
CHANGES.SlapOS.txt
+5
-0
setup.py
setup.py
+1
-1
src/zc/buildout/buildout.py
src/zc/buildout/buildout.py
+10
-2
No files found.
CHANGES.SlapOS.txt
View file @
0b87d146
1.7.1-dev-SlapOS-005
--------------------
- Cache downloaded data in zc/buildout/buildout.py:_open() in memory to accelerate remote extends.
1.7.1-dev-SlapOS-004
1.7.1-dev-SlapOS-004
--------------------
--------------------
...
...
setup.py
View file @
0b87d146
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
#
#
##############################################################################
##############################################################################
name
=
"zc.buildout"
name
=
"zc.buildout"
version
=
"1.7.1-dev-SlapOS-00
4
"
version
=
"1.7.1-dev-SlapOS-00
5
"
import
os
import
os
from
setuptools
import
setup
from
setuptools
import
setup
...
...
src/zc/buildout/buildout.py
View file @
0b87d146
...
@@ -22,6 +22,7 @@ except ImportError:
...
@@ -22,6 +22,7 @@ except ImportError:
from
md5
import
md5
from
md5
import
md5
import
ConfigParser
import
ConfigParser
from
cStringIO
import
StringIO
import
copy
import
copy
import
distutils.errors
import
distutils.errors
import
glob
import
glob
...
@@ -1691,6 +1692,7 @@ def _save_options(section, options, f):
...
@@ -1691,6 +1692,7 @@ def _save_options(section, options, f):
for
option
in
sorted
(
options
.
keys
()):
for
option
in
sorted
(
options
.
keys
()):
_save_option
(
option
,
options
.
get
(
option
),
f
)
_save_option
(
option
,
options
.
get
(
option
),
f
)
_open_download_cache
=
{}
_open_parser_cache
=
{}
_open_parser_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,
...
@@ -1722,8 +1724,14 @@ def _open(base, filename, seen, dl_options, override, downloaded):
...
@@ -1722,8 +1724,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
data
=
_open_download_cache
.
get
(
filename
)
if
data
is
None
:
path
,
is_temp
=
download
(
filename
)
path
,
is_temp
=
download
(
filename
)
fp
=
open
(
path
)
data
=
file
(
path
).
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
)
...
...
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