Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
openmm
Commits
c8443904
Commit
c8443904
authored
Nov 04, 2015
by
Robert McGibbon
Browse files
Fix some code review issues
parent
7696ce12
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
11 deletions
+10
-11
wrappers/python/filterPythonFiles.py
wrappers/python/filterPythonFiles.py
+9
-9
wrappers/python/src/swig_doxygen/swigInputBuilder.py
wrappers/python/src/swig_doxygen/swigInputBuilder.py
+1
-2
No files found.
wrappers/python/filterPythonFiles.py
View file @
c8443904
...
@@ -38,15 +38,15 @@ while True:
...
@@ -38,15 +38,15 @@ while True:
stripped
=
line
.
lstrip
()
stripped
=
line
.
lstrip
()
if
stripped
.
startswith
(
'"""'
)
or
stripped
.
startswith
(
"'''"
):
if
stripped
.
startswith
(
'"""'
)
or
stripped
.
startswith
(
"'''"
):
line
=
stripped
[
3
:]
line
=
stripped
[
3
:]
readingParameters
=
False
if
line
.
find
(
'"""'
)
!=
-
1
or
line
.
find
(
"'''"
)
!=
-
1
:
docstringlines
.
append
(
line
.
rstrip
()[:
-
3
])
else
:
while
line
.
find
(
'"""'
)
==
-
1
and
line
.
find
(
"'''"
)
==
-
1
:
docstringlines
.
append
(
line
)
line
=
input
.
readline
()
docstring
=
NumpyDocString
(
cleandoc
(
''
.
join
(
docstringlines
)))
while
line
.
find
(
'"""'
)
==
-
1
and
line
.
find
(
"'''"
)
==
-
1
:
docstringlines
.
append
(
line
)
line
=
input
.
readline
().
rstrip
()
if
line
.
endswith
(
'"""'
)
or
line
.
endswith
(
"'''"
):
docstringlines
.
append
(
line
[:
-
3
])
docstring
=
NumpyDocString
(
cleandoc
(
'
\n
'
.
join
(
docstringlines
)))
# Print out the docstring in Doxygen syntax, followed by the declaration.
# Print out the docstring in Doxygen syntax, followed by the declaration.
for
line
in
docstring
[
'Summary'
]:
for
line
in
docstring
[
'Summary'
]:
...
@@ -57,7 +57,7 @@ while True:
...
@@ -57,7 +57,7 @@ while True:
print
(
'{prefix}## {line}'
.
format
(
prefix
=
prefix
,
line
=
line
.
strip
()))
print
(
'{prefix}## {line}'
.
format
(
prefix
=
prefix
,
line
=
line
.
strip
()))
print
(
'{prefix}##'
.
format
(
prefix
=
prefix
))
print
(
'{prefix}##'
.
format
(
prefix
=
prefix
))
for
name
,
type
,
descr
in
docstring
[
'Parameters'
]:
for
name
,
type
,
descr
in
docstring
[
'Parameters'
]:
print
(
'{prefix}## @param {name} ({type}) {descr}'
.
format
(
prefix
=
prefix
,
type
=
type
,
name
=
name
,
descr
=
''
.
join
(
descr
)))
print
(
'{prefix}## @param {name} ({type}) {descr}'
.
format
(
prefix
=
prefix
,
type
=
type
,
name
=
name
,
descr
=
'
'
.
join
(
descr
)))
for
name
,
type
,
descr
in
docstring
[
'Returns'
]:
for
name
,
type
,
descr
in
docstring
[
'Returns'
]:
if
type
==
''
:
if
type
==
''
:
type
=
name
type
=
name
...
...
wrappers/python/src/swig_doxygen/swigInputBuilder.py
View file @
c8443904
...
@@ -49,8 +49,7 @@ def striphtmltags(s):
...
@@ -49,8 +49,7 @@ def striphtmltags(s):
s
=
s
.
replace
(
'<i>'
,
'_'
).
replace
(
'</i>'
,
'_'
)
s
=
s
.
replace
(
'<i>'
,
'_'
).
replace
(
'</i>'
,
'_'
)
s
=
s
.
replace
(
'<b>'
,
'*'
).
replace
(
'</b>'
,
'*'
)
s
=
s
.
replace
(
'<b>'
,
'*'
).
replace
(
'</b>'
,
'*'
)
s
=
re
.
sub
(
'\s*(<ul>.*</ul>\s*)'
,
replace_ul_tags
,
s
,
flags
=
re
.
MULTILINE
|
re
.
DOTALL
)
s
=
re
.
sub
(
'\s*(<ul>.*?</ul>\s*)'
,
replace_ul_tags
,
s
,
flags
=
re
.
MULTILINE
|
re
.
DOTALL
)
return
s
return
s
def
trimToSingleSpace
(
text
):
def
trimToSingleSpace
(
text
):
...
...
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