Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
hpp-fcl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Guilhem Saurel
hpp-fcl
Commits
951dc32f
Commit
951dc32f
authored
5 years ago
by
Joseph Mirabel
Browse files
Options
Downloads
Patches
Plain Diff
[Python][Doc] Fix compatibility with Python 2.
parent
4e482fb0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
doc/python/doxygen_xml_parser.py
+13
-9
13 additions, 9 deletions
doc/python/doxygen_xml_parser.py
doc/python/xml_docstring.py
+1
-1
1 addition, 1 deletion
doc/python/xml_docstring.py
with
14 additions
and
10 deletions
doc/python/doxygen_xml_parser.py
+
13
−
9
View file @
951dc32f
...
...
@@ -101,9 +101,13 @@ def _templateParamToDict (param):
if
c
.
text
is
not
None
:
typetext
+=
c
.
text
if
c
.
tail
is
not
None
:
typetext
+=
c
.
tail
if
typetext
.
startswith
(
"
typename
"
)
or
typetext
.
startswith
(
"
class
"
):
s
=
typetext
.
split
(
maxsplit
=
1
)
assert
len
(
s
)
==
2
return
{
"
type
"
:
s
[
0
].
strip
(),
"
name
"
:
s
[
1
].
strip
()
}
if
sys
.
version_info
.
major
==
2
:
s
=
typetext
.
split
()
return
{
"
type
"
:
s
[
0
].
strip
(),
"
name
"
:
typetext
[
len
(
s
[
0
]):].
strip
()
}
else
:
s
=
typetext
.
split
(
maxsplit
=
1
)
assert
len
(
s
)
==
2
return
{
"
type
"
:
s
[
0
].
strip
(),
"
name
"
:
s
[
1
].
strip
()
}
else
:
return
{
"
type
"
:
type
.
text
,
"
name
"
:
""
}
else
:
...
...
@@ -164,7 +168,7 @@ class Reference(object):
# Only for function as of now.
class
MemberDef
(
Reference
):
def
__init__
(
self
,
index
,
memberdefxml
,
parent
):
super
().
__init__
(
index
=
index
,
super
(
MemberDef
,
self
).
__init__
(
index
=
index
,
id
=
memberdefxml
.
attrib
[
"
id
"
],
name
=
memberdefxml
.
find
(
"
definition
"
).
text
)
self
.
parent
=
parent
...
...
@@ -238,13 +242,13 @@ class CompoundBase(Reference):
self
.
filename
=
path
.
join
(
index
.
directory
,
compound
.
attrib
[
"
refid
"
]
+
"
.xml
"
)
self
.
tree
=
etree
.
parse
(
self
.
filename
)
self
.
definition
=
self
.
tree
.
getroot
().
find
(
"
compounddef
"
)
super
().
__init__
(
index
,
super
(
CompoundBase
,
self
).
__init__
(
index
,
id
=
self
.
definition
.
attrib
[
'
id
'
],
name
=
self
.
definition
.
find
(
"
compoundname
"
).
text
)
class
NamespaceCompound
(
CompoundBase
):
def
__init__
(
self
,
*
args
):
super
().
__init__
(
*
args
)
super
(
NamespaceCompound
,
self
).
__init__
(
*
args
)
self
.
typedefs
=
[]
self
.
enums
=
[]
self
.
static_funcs
=
[]
...
...
@@ -293,7 +297,7 @@ class NamespaceCompound (CompoundBase):
class
ClassCompound
(
CompoundBase
):
def
__init__
(
self
,
*
args
):
super
().
__init__
(
*
args
)
super
(
ClassCompound
,
self
).
__init__
(
*
args
)
self
.
member_funcs
=
list
()
self
.
static_funcs
=
list
()
self
.
special_funcs
=
list
()
...
...
@@ -376,8 +380,8 @@ class ClassCompound (CompoundBase):
output
.
out
(
template_class_doc
.
format
(
tplargs
=
self
.
_templateDecl
(),
classname
=
self
.
_className
(),
docstring
=
docstring
,
attributes
=
attribute_docstrings
,
docstring
=
docstring
.
encode
(
'
utf-8
'
)
,
attributes
=
attribute_docstrings
.
encode
(
'
utf-8
'
)
,
))
def
write
(
self
,
output
):
...
...
This diff is collapsed.
Click to expand it.
doc/python/xml_docstring.py
+
1
−
1
View file @
951dc32f
...
...
@@ -31,7 +31,7 @@ class XmlDocString (object):
return
ret
def
_write
(
self
,
str
):
nlines
=
str
.
split
(
sep
=
"
\n
"
)
nlines
=
str
.
split
(
"
\n
"
)
if
len
(
self
.
lines
)
==
0
:
self
.
lines
+=
nlines
else
:
...
...
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