Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pybind11
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
pybind11
Commits
a33212df
Commit
a33212df
authored
May 15, 2019
by
Dan
Committed by
Wenzel Jakob
Jun 11, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wrap the main functionality of mkdoc in a function.
parent
b46bb64d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
4 deletions
+17
-4
tools/mkdoc.py
+17
-4
No files found.
tools/mkdoc.py
View file @
a33212df
...
@@ -59,6 +59,11 @@ job_semaphore = Semaphore(job_count)
...
@@ -59,6 +59,11 @@ job_semaphore = Semaphore(job_count)
output
=
[]
output
=
[]
class
NoFilenamesError
(
ValueError
):
pass
def
d
(
s
):
def
d
(
s
):
return
s
if
isinstance
(
s
,
str
)
else
s
.
decode
(
'utf8'
)
return
s
if
isinstance
(
s
,
str
)
else
s
.
decode
(
'utf8'
)
...
@@ -224,7 +229,8 @@ class ExtractionThread(Thread):
...
@@ -224,7 +229,8 @@ class ExtractionThread(Thread):
finally
:
finally
:
job_semaphore
.
release
()
job_semaphore
.
release
()
if
__name__
==
'__main__'
:
def
mkdoc
(
args
):
parameters
=
[]
parameters
=
[]
filenames
=
[]
filenames
=
[]
if
"-x"
not
in
args
:
if
"-x"
not
in
args
:
...
@@ -260,15 +266,14 @@ if __name__ == '__main__':
...
@@ -260,15 +266,14 @@ if __name__ == '__main__':
if
clang_include_dir
:
if
clang_include_dir
:
parameters
.
extend
([
'-isystem'
,
clang_include_dir
])
parameters
.
extend
([
'-isystem'
,
clang_include_dir
])
for
item
in
sys
.
argv
[
1
:]
:
for
item
in
args
:
if
item
.
startswith
(
'-'
):
if
item
.
startswith
(
'-'
):
parameters
.
append
(
item
)
parameters
.
append
(
item
)
else
:
else
:
filenames
.
append
(
item
)
filenames
.
append
(
item
)
if
len
(
filenames
)
==
0
:
if
len
(
filenames
)
==
0
:
print
(
'Syntax:
%
s [.. a list of header files ..]'
%
sys
.
argv
[
0
])
raise
NoFilenamesError
(
"args parameter did not contain any filenames"
)
exit
(
-
1
)
print
(
'''/*
print
(
'''/*
This file contains docstrings for the Python bindings.
This file contains docstrings for the Python bindings.
...
@@ -321,3 +326,11 @@ if __name__ == '__main__':
...
@@ -321,3 +326,11 @@ if __name__ == '__main__':
#pragma GCC diagnostic pop
#pragma GCC diagnostic pop
#endif
#endif
'''
)
'''
)
if
__name__
==
'__main__'
:
try
:
mkdoc
(
sys
.
argv
[
1
:])
except
NoFilenamesError
:
print
(
'Syntax:
%
s [.. a list of header files ..]'
%
sys
.
argv
[
0
])
exit
(
-
1
)
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