Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Özgür Ozan Sen
ogs
Commits
b21c6d79
Commit
b21c6d79
authored
8 years ago
by
Christoph Lehmann
Browse files
Options
Downloads
Patches
Plain Diff
[scr] fixed format() for python 2.6 compatibilty
parent
27dbb255
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
scripts/doc/check-project-params.py
+6
-6
6 additions, 6 deletions
scripts/doc/check-project-params.py
scripts/doc/linked-xml-file.py
+4
-4
4 additions, 4 deletions
scripts/doc/linked-xml-file.py
with
10 additions
and
10 deletions
scripts/doc/check-project-params.py
+
6
−
6
View file @
b21c6d79
...
@@ -15,12 +15,12 @@ def debug(msg):
...
@@ -15,12 +15,12 @@ def debug(msg):
sys
.
stderr
.
write
(
msg
+
"
\n
"
)
sys
.
stderr
.
write
(
msg
+
"
\n
"
)
if
len
(
sys
.
argv
)
!=
3
:
if
len
(
sys
.
argv
)
!=
3
:
print_
(
"
USAGE: {} DOCAUXDIR SRCDIR
"
.
format
(
sys
.
argv
[
0
]))
print_
(
"
USAGE: {
0
} DOCAUXDIR SRCDIR
"
.
format
(
sys
.
argv
[
0
]))
sys
.
exit
(
1
)
sys
.
exit
(
1
)
docauxdir
=
sys
.
argv
[
1
]
docauxdir
=
sys
.
argv
[
1
]
if
not
os
.
path
.
isdir
(
docauxdir
):
if
not
os
.
path
.
isdir
(
docauxdir
):
print_
(
"
error: `{}
'
is not a directory
"
.
format
(
docauxdir
))
print_
(
"
error: `{
0
}
'
is not a directory
"
.
format
(
docauxdir
))
sys
.
exit
(
1
)
sys
.
exit
(
1
)
doxdir
=
os
.
path
.
join
(
docauxdir
,
"
dox
"
,
"
ProjectFile
"
)
doxdir
=
os
.
path
.
join
(
docauxdir
,
"
dox
"
,
"
ProjectFile
"
)
...
@@ -67,7 +67,7 @@ with open(os.path.join(docauxdir, "documented-parameters-cache.txt")) as fh:
...
@@ -67,7 +67,7 @@ with open(os.path.join(docauxdir, "documented-parameters-cache.txt")) as fh:
debug
(
"
SPECIAL:
"
+
"
"
.
join
(
inline
[
1
:]))
# TODO implement proper handling
debug
(
"
SPECIAL:
"
+
"
"
.
join
(
inline
[
1
:]))
# TODO implement proper handling
# unneeded.append(inline[1:])
# unneeded.append(inline[1:])
else
:
else
:
debug
(
"
ERROR: unrecognized status {}
"
.
format
(
status
))
debug
(
"
ERROR: unrecognized status {
0
}
"
.
format
(
status
))
wrong_status
=
True
wrong_status
=
True
...
@@ -89,7 +89,7 @@ for (dirpath, _, filenames) in os.walk(srcdocdir):
...
@@ -89,7 +89,7 @@ for (dirpath, _, filenames) in os.walk(srcdocdir):
tagpath
=
os
.
path
.
join
(
reldirpath
,
f
[
2
:
-
len
(
"
.md
"
)])
tagpath
=
os
.
path
.
join
(
reldirpath
,
f
[
2
:
-
len
(
"
.md
"
)])
tag_or_attr
=
"
attr
"
tag_or_attr
=
"
attr
"
else
:
else
:
debug
(
"
ERROR: Found md file with unrecognized name: {}
"
debug
(
"
ERROR: Found md file with unrecognized name: {
0
}
"
.
format
(
filepath
))
.
format
(
filepath
))
continue
continue
...
@@ -186,7 +186,7 @@ with open(os.path.join(docauxdir, "untested-parameters-cache.json")) as fh:
...
@@ -186,7 +186,7 @@ with open(os.path.join(docauxdir, "untested-parameters-cache.json")) as fh:
print_
(
"
# Tags that do not occur in any CTest project file
"
)
print_
(
"
# Tags that do not occur in any CTest project file
"
)
for
utag
in
sorted
(
utags
):
for
utag
in
sorted
(
utags
):
pagename
=
"
ogs_file_param__
"
+
utag
.
replace
(
"
.
"
,
"
__
"
)
pagename
=
"
ogs_file_param__
"
+
utag
.
replace
(
"
.
"
,
"
__
"
)
print_
(
r
'
- \ref {}
"
{}
"'
.
format
(
pagename
,
utag
))
print_
(
r
'
- \ref {
0
}
"
{
1
}
"'
.
format
(
pagename
,
utag
))
uattrs
=
[
ua
for
ua
in
untested_tags_attrs
[
"
attributes
"
]
\
uattrs
=
[
ua
for
ua
in
untested_tags_attrs
[
"
attributes
"
]
\
if
ua
!=
"
gml
"
and
not
ua
.
startswith
(
"
gml.
"
)
]
if
ua
!=
"
gml
"
and
not
ua
.
startswith
(
"
gml.
"
)
]
...
@@ -196,7 +196,7 @@ with open(os.path.join(docauxdir, "untested-parameters-cache.json")) as fh:
...
@@ -196,7 +196,7 @@ with open(os.path.join(docauxdir, "untested-parameters-cache.json")) as fh:
print_
(
"
# Attributes that do not occur in any CTest project file
"
)
print_
(
"
# Attributes that do not occur in any CTest project file
"
)
for
uattr
in
sorted
(
uattrs
):
for
uattr
in
sorted
(
uattrs
):
pagename
=
"
ogs_file_attr__
"
+
uattr
.
replace
(
"
.
"
,
"
__
"
)
pagename
=
"
ogs_file_attr__
"
+
uattr
.
replace
(
"
.
"
,
"
__
"
)
print_
(
r
'
- \ref {}
"
{}
"'
.
format
(
pagename
,
uattr
))
print_
(
r
'
- \ref {
0
}
"
{
1
}
"'
.
format
(
pagename
,
uattr
))
# exit with error status if something was not documented/tested
# exit with error status if something was not documented/tested
if
qa_status_succeeded
:
if
qa_status_succeeded
:
...
...
This diff is collapsed.
Click to expand it.
scripts/doc/linked-xml-file.py
+
4
−
4
View file @
b21c6d79
...
@@ -45,9 +45,9 @@ indent = " "*2
...
@@ -45,9 +45,9 @@ indent = " "*2
def
format_if_documented
(
is_doc
,
fmt
,
fullpagename
,
tag_attr
,
*
args
):
def
format_if_documented
(
is_doc
,
fmt
,
fullpagename
,
tag_attr
,
*
args
):
if
is_doc
:
if
is_doc
:
tag_attr_formatted
=
r
'
\ref {}
"
{}
"'
.
format
(
fullpagename
,
tag_attr
)
tag_attr_formatted
=
r
'
\ref {
0
}
"
{
1
}
"'
.
format
(
fullpagename
,
tag_attr
)
else
:
else
:
tag_attr_formatted
=
r
'
<span style=
"
color: red;
"
title=
"
undocumented: {}
"
>{}</span>
'
.
format
(
fullpagename
,
tag_attr
)
tag_attr_formatted
=
r
'
<span style=
"
color: red;
"
title=
"
undocumented: {
0
}
"
>{
1
}</span>
'
.
format
(
fullpagename
,
tag_attr
)
return
fmt
.
format
(
tag_attr_formatted
,
tag_attr
,
*
args
)
return
fmt
.
format
(
tag_attr_formatted
,
tag_attr
,
*
args
)
...
@@ -232,12 +232,12 @@ for (dirpath, dirnames, filenames) in os.walk(datadir, topdown=False):
...
@@ -232,12 +232,12 @@ for (dirpath, dirnames, filenames) in os.walk(datadir, topdown=False):
pagetitle
=
"
OGS CTests—Project Files
"
pagetitle
=
"
OGS CTests—Project Files
"
with
open
(
os
.
path
.
join
(
outdirpath
,
"
index.dox
"
),
"
w
"
)
as
fh
:
with
open
(
os
.
path
.
join
(
outdirpath
,
"
index.dox
"
),
"
w
"
)
as
fh
:
fh
.
write
(
"""
/*! \page {} {}
fh
.
write
(
"""
/*! \page {
0
} {
1
}
"""
.
format
(
pagename
,
pagetitle
))
"""
.
format
(
pagename
,
pagetitle
))
for
sp
in
sorted
(
subpages
):
for
sp
in
sorted
(
subpages
):
fh
.
write
(
"
-
\\
subpage {}
\n
"
.
format
(
sp
))
fh
.
write
(
"
-
\\
subpage {
0
}
\n
"
.
format
(
sp
))
fh
.
write
(
"""
fh
.
write
(
"""
...
...
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