Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mininet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
Olaf Bergmann
mininet
Commits
8a130dea
Commit
8a130dea
authored
14 years ago
by
Bob Lantz
Browse files
Options
Downloads
Patches
Plain Diff
Support for generating documentation with doxygen/doxypy (such as it is.)
parent
1d67218d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Makefile
+2
-1
2 additions, 1 deletion
Makefile
doxygen.cfg
+1417
-0
1417 additions, 0 deletions
doxygen.cfg
util/doxify.py
+89
-0
89 additions, 0 deletions
util/doxify.py
with
1508 additions
and
1 deletion
Makefile
+
2
−
1
View file @
8a130dea
...
...
@@ -23,5 +23,6 @@ install: mnexec
cp
mnexec bin/
python setup.py
install
doc
:
doxygen doxygen.cfg
This diff is collapsed.
Click to expand it.
doxygen.cfg
0 → 100644
+
1417
−
0
View file @
8a130dea
This diff is collapsed.
Click to expand it.
util/doxify.py
0 → 100755
+
89
−
0
View file @
8a130dea
#!/usr/bin/python
"""
Convert simple documentation to epydoc/pydoctor-compatible markup
"""
from
sys
import
stdin
,
stdout
,
argv
import
os
from
tempfile
import
mkstemp
from
subprocess
import
call
import
re
spaces
=
re
.
compile
(
r
'
\s+
'
)
singleLineExp
=
re
.
compile
(
r
'
\s+
"
([^
"
]+)
"'
)
commentStartExp
=
re
.
compile
(
r
'
\s+
"""'
)
commentEndExp
=
re
.
compile
(
r
'"""
$
'
)
returnExp
=
re
.
compile
(
r
'
\s+(returns:.*)
'
)
lastindent
=
''
comment
=
False
def
fixParam
(
line
):
"
Change foo: bar to @foo bar
"
result
=
re
.
sub
(
r
'
(\w+):
'
,
r
'
@param \1
'
,
line
)
result
=
re
.
sub
(
r
'
@
'
,
r
'
@
'
,
result
)
return
result
def
fixReturns
(
line
):
"
Change returns: foo to @return foo
"
return
re
.
sub
(
'
returns:
'
,
r
'
@returns
'
,
line
)
def
fixLine
(
line
):
global
comment
match
=
spaces
.
match
(
line
)
if
not
match
:
return
line
else
:
indent
=
match
.
group
(
0
)
if
singleLineExp
.
match
(
line
):
return
re
.
sub
(
'"'
,
'"""'
,
line
)
if
commentStartExp
.
match
(
line
):
comment
=
True
if
comment
:
line
=
fixReturns
(
line
)
line
=
fixParam
(
line
)
if
commentEndExp
.
search
(
line
):
comment
=
False
return
line
def
test
():
"
Test transformations
"
assert
fixLine
(
'
"
foo
"'
)
==
'
"""
foo
"""'
assert
fixParam
(
'
foo: bar
'
)
==
'
@param foo bar
'
assert
commentStartExp
.
match
(
'
"""
foo
"""'
)
def
funTest
():
testFun
=
(
'
def foo():
\n
'
'
"
Single line comment
"
\n
'
'
"""
This is a test
"""
\n
'
'
bar: int
\n
'
'
baz: string
\n
'
'
returns: junk
"""
\n
'
'
if True:
\n
'
'
print
"
OK
"
\n
'
).
splitlines
(
True
)
fixLines
(
testFun
)
def
fixLines
(
lines
,
fid
):
for
line
in
lines
:
os
.
write
(
fid
,
fixLine
(
line
)
)
if
__name__
==
'
__main__
'
:
if
False
:
funTest
()
infile
=
open
(
argv
[
1
]
)
outfid
,
outname
=
mkstemp
()
fixLines
(
infile
.
readlines
(),
outfid
)
infile
.
close
()
os
.
close
(
outfid
)
call
(
[
'
doxypy.py
'
,
outname
]
)
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