Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mkexp
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Package registry
Operate
Terraform modules
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
esmenv
mkexp
Commits
6f72c68a
Commit
6f72c68a
authored
11 years ago
by
Karl-Hermann Wieners
Browse files
Options
Downloads
Patches
Plain Diff
Merged changes from trunk
* r3545: Changed to parse namelist section comments for example key assignments.
parent
7f3b2b16
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mkexp
+7
-3
7 additions, 3 deletions
mkexp
with
7 additions
and
3 deletions
mkexp
+
7
−
3
View file @
6f72c68a
...
@@ -146,11 +146,11 @@ def format_namelist(section):
...
@@ -146,11 +146,11 @@ def format_namelist(section):
lines
=
StringIO
.
StringIO
()
lines
=
StringIO
.
StringIO
()
for
group
,
contents
in
section
.
iteritems
():
for
group
,
contents
in
section
.
iteritems
():
if
isinstance
(
contents
,
dict
):
if
isinstance
(
contents
,
dict
):
group
=
group
.
lower
()
group
_id
=
group
.
lower
()
if
not
any
(
map
(
lambda
x
:
re
.
match
(
x
,
group
),
black_list
)):
if
not
any
(
map
(
lambda
x
:
re
.
match
(
x
,
group
_id
),
black_list
)):
# Create list of removed keys
# Create list of removed keys
remove_keys
=
cut_remove_list
(
contents
,
'
.remove
'
)
remove_keys
=
cut_remove_list
(
contents
,
'
.remove
'
)
group_name
=
re
.
sub
(
r
'
.*$
'
,
''
,
group
)
group_name
=
re
.
sub
(
r
'
.*$
'
,
''
,
group
_id
)
lines
.
write
(
'
&
'
+
group_name
+
'
\n
'
)
lines
.
write
(
'
&
'
+
group_name
+
'
\n
'
)
for
key
,
value
in
contents
.
iteritems
():
for
key
,
value
in
contents
.
iteritems
():
if
key
not
in
remove_keys
:
if
key
not
in
remove_keys
:
...
@@ -166,6 +166,10 @@ def format_namelist(section):
...
@@ -166,6 +166,10 @@ def format_namelist(section):
line
=
re
.
sub
(
r
'
^#
'
,
'
!
'
,
line
)
line
=
re
.
sub
(
r
'
^#
'
,
'
!
'
,
line
)
lines
.
write
(
'
'
*
base_indent
+
key
+
'
=
'
+
lines
.
write
(
'
'
*
base_indent
+
key
+
'
=
'
+
format_value
(
value
,
indent
)
+
line
+
'
\n
'
)
format_value
(
value
,
indent
)
+
line
+
'
\n
'
)
for
line
in
section
.
comments
.
get
(
group
,
[]):
if
line
and
re
.
match
(
r
'
#\s*\w+\s*=
'
,
line
):
lines
.
write
(
'
'
*
base_indent
+
re
.
sub
(
r
'
^#
'
,
'
!
'
,
line
)
+
'
\n
'
)
lines
.
write
(
'
/
\n
'
)
lines
.
write
(
'
/
\n
'
)
return
lines
.
getvalue
()
return
lines
.
getvalue
()
...
...
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