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
Xavier Thompson
slapos.buildout
Commits
102f80a3
Commit
102f80a3
authored
Feb 04, 2016
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement dump command.
parent
53fc6369
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
1 deletion
+23
-1
src/zc/buildout/buildout.py
src/zc/buildout/buildout.py
+23
-1
No files found.
src/zc/buildout/buildout.py
View file @
102f80a3
...
...
@@ -39,6 +39,7 @@ import distutils.errors
import
errno
import
glob
import
itertools
import
json
import
logging
import
os
import
pkg_resources
...
...
@@ -916,6 +917,19 @@ class Buildout(DictMixin):
self
.
_logger
.
warning
(
"Unexpected entry, %r, in develop-eggs directory."
,
f
)
def
_dump
(
self
):
d
=
{}
for
section
,
data
in
sorted
(
self
.
_annotated
.
items
()):
for
k
,
v
in
sorted
(
data
.
items
()):
if
section
==
'buildout'
and
k
==
'directory'
:
continue
elif
v
[
1
]
==
'DEFAULT_VALUE'
:
continue
elif
k
==
'_profile_base_location_'
:
continue
d
.
setdefault
(
section
,
{}).
update
({
k
:
v
[
0
]})
return
json
.
dumps
(
d
,
sort_keys
=
True
,
indent
=
2
)
def
_compute_part_signatures
(
self
,
parts
):
# Compute recipe signature and add to options
for
part
in
parts
:
...
...
@@ -1260,6 +1274,9 @@ class Buildout(DictMixin):
def
annotate
(
self
,
args
=
None
):
_print_annotate
(
self
.
_annotated
)
def
dump
(
self
,
args
=
None
):
print_
(
self
.
_dump
())
def
print_options
(
self
):
for
section
in
sorted
(
self
.
_data
):
if
section
==
'buildout'
or
section
==
self
[
'buildout'
][
'versions'
]:
...
...
@@ -2098,6 +2115,11 @@ Commands:
sorted alphabetically, along with the origin of the value (file name or
COMPUTED_VALUE, DEFAULT_VALUE, COMMAND_LINE_VALUE).
dump
Display sections without buildout:directory and default values in
JSON format.
"""
def
_help
():
...
...
@@ -2198,7 +2220,7 @@ def main(args=None):
command
=
args
.
pop
(
0
)
if
command
not
in
(
'install'
,
'bootstrap'
,
'runsetup'
,
'setup'
,
'init'
,
'annotate'
,
'annotate'
,
'dump'
,
):
_error
(
'invalid command:'
,
command
)
else
:
...
...
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