Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
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
Package registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Romin Tomasetti
gmsh
Commits
0230766d
Commit
0230766d
authored
5 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
report full name (including namespace) in docstring, to make the module easier to search
parent
7124f04d
No related branches found
No related tags found
No related merge requests found
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
api/GenApi.py
+14
-10
14 additions, 10 deletions
api/GenApi.py
api/gmsh.py
+498
-0
498 additions, 0 deletions
api/gmsh.py
with
512 additions
and
10 deletions
api/GenApi.py
+
14
−
10
View file @
0230766d
...
@@ -1273,19 +1273,21 @@ class API:
...
@@ -1273,19 +1273,21 @@ class API:
def
write_python
(
self
):
def
write_python
(
self
):
def
parg
(
a
):
def
parg
(
a
):
return
a
.
name
+
((
"
=
"
+
a
.
python_value
)
if
a
.
python_value
else
""
)
return
a
.
name
+
((
"
=
"
+
a
.
python_value
)
if
a
.
python_value
else
""
)
def
write_function
(
f
,
fun
,
module
path
,
indent
):
def
write_function
(
f
,
fun
,
c_mpath
,
py_m
path
,
indent
):
(
rtype
,
name
,
args
,
doc
,
special
)
=
fun
(
rtype
,
name
,
args
,
doc
,
special
)
=
fun
if
"
onlycc++
"
in
special
:
return
if
"
onlycc++
"
in
special
:
return
iargs
=
list
(
a
for
a
in
args
if
not
a
.
out
)
iargs
=
list
(
a
for
a
in
args
if
not
a
.
out
)
oargs
=
list
(
a
for
a
in
args
if
a
.
out
)
oargs
=
list
(
a
for
a
in
args
if
a
.
out
)
f
.
write
(
"
\n
"
)
f
.
write
(
"
\n
"
)
if
module
path
!=
ns
:
if
c_m
path
!=
ns
:
f
.
write
(
indent
+
"
@staticmethod
\n
"
)
f
.
write
(
indent
+
"
@staticmethod
\n
"
)
f
.
write
(
indent
+
"
def
"
+
name
+
"
(
"
f
.
write
(
indent
+
"
def
"
+
name
+
"
(
"
+
"
,
"
.
join
((
parg
(
a
)
for
a
in
iargs
))
+
"
,
"
.
join
((
parg
(
a
)
for
a
in
iargs
))
+
"
):
\n
"
)
+
"
):
\n
"
)
indent
+=
"
"
indent
+=
"
"
f
.
write
(
indent
+
'"""
\n
'
)
f
.
write
(
indent
+
'"""
\n
'
)
f
.
write
(
indent
+
py_mpath
+
name
+
"
(
"
+
"
,
"
.
join
(
parg
(
a
)
for
a
in
iargs
)
+
"
)
\n\n
"
)
f
.
write
(
indent
+
(
"
\n
"
+
indent
).
join
(
textwrap
.
wrap
(
doc
,
75
))
+
"
\n
"
)
f
.
write
(
indent
+
(
"
\n
"
+
indent
).
join
(
textwrap
.
wrap
(
doc
,
75
))
+
"
\n
"
)
if
rtype
or
oargs
:
if
rtype
or
oargs
:
f
.
write
(
"
\n
"
+
indent
+
"
Return
"
+
"
,
"
.
join
(
f
.
write
(
"
\n
"
+
indent
+
"
Return
"
+
"
,
"
.
join
(
...
@@ -1299,7 +1301,7 @@ class API:
...
@@ -1299,7 +1301,7 @@ class API:
f
.
write
(
indent
+
"
ierr = c_int()
\n
"
)
f
.
write
(
indent
+
"
ierr = c_int()
\n
"
)
f
.
write
(
indent
+
"
api__result__ =
"
if
((
rtype
is
oint
)
or
f
.
write
(
indent
+
"
api__result__ =
"
if
((
rtype
is
oint
)
or
(
rtype
is
odouble
))
else
(
indent
))
(
rtype
is
odouble
))
else
(
indent
))
c_name
=
module
path
+
name
[
0
].
upper
()
+
name
[
1
:]
c_name
=
c_m
path
+
name
[
0
].
upper
()
+
name
[
1
:]
f
.
write
(
"
lib.
"
+
c_name
+
"
(
\n
"
+
indent
+
f
.
write
(
"
lib.
"
+
c_name
+
"
(
\n
"
+
indent
+
(
"
,
\n
"
+
indent
+
"
"
).
join
(
(
"
,
\n
"
+
indent
+
"
"
).
join
(
tuple
((
a
.
python_arg
for
a
in
args
))
+
(
"
byref(ierr)
"
,
))
+
tuple
((
a
.
python_arg
for
a
in
args
))
+
(
"
byref(ierr)
"
,
))
+
...
@@ -1316,13 +1318,15 @@ class API:
...
@@ -1316,13 +1318,15 @@ class API:
else
:
else
:
f
.
write
(
indent
+
"
return (
\n
"
+
indent
+
"
"
+
f
.
write
(
indent
+
"
return (
\n
"
+
indent
+
"
"
+
(
"
,
\n
"
+
indent
+
"
"
).
join
(
r
)
+
"
)
\n
"
)
(
"
,
\n
"
+
indent
+
"
"
).
join
(
r
)
+
"
)
\n
"
)
def
write_module
(
f
,
m
,
modulepath
,
indent
):
def
write_module
(
f
,
m
,
c_mpath
,
py_mpath
,
indent
):
if
modulepath
:
if
c_mpath
:
modulepath
+=
m
.
name
[
0
].
upper
()
+
m
.
name
[
1
:]
c_mpath
+=
m
.
name
[
0
].
upper
()
+
m
.
name
[
1
:]
py_mpath
+=
m
.
name
+
"
.
"
else
:
else
:
modulepath
=
m
.
name
c_mpath
=
m
.
name
py_mpath
=
m
.
name
+
"
.
"
for
fun
in
m
.
fs
:
for
fun
in
m
.
fs
:
write_function
(
f
,
fun
,
module
path
,
indent
)
write_function
(
f
,
fun
,
c_mpath
,
py_m
path
,
indent
)
for
module
in
m
.
submodules
:
for
module
in
m
.
submodules
:
f
.
write
(
"
\n\n
"
+
indent
+
"
class
"
+
module
.
name
+
"
:
\n
"
)
f
.
write
(
"
\n\n
"
+
indent
+
"
class
"
+
module
.
name
+
"
:
\n
"
)
indentm
=
indent
+
"
"
indentm
=
indent
+
"
"
...
@@ -1330,13 +1334,13 @@ class API:
...
@@ -1330,13 +1334,13 @@ class API:
f
.
write
(
indentm
+
(
"
\n
"
+
indentm
).
join
f
.
write
(
indentm
+
(
"
\n
"
+
indentm
).
join
(
textwrap
.
wrap
(
capi
(
module
.
doc
),
75
))
+
"
\n
"
)
(
textwrap
.
wrap
(
capi
(
module
.
doc
),
75
))
+
"
\n
"
)
f
.
write
(
indentm
+
'"""
\n
'
)
f
.
write
(
indentm
+
'"""
\n
'
)
write_module
(
f
,
module
,
module
path
,
indentm
)
write_module
(
f
,
module
,
c_mpath
,
py_m
path
,
indentm
)
with
open
(
ns
+
"
.py
"
,
"
w
"
)
as
f
:
with
open
(
ns
+
"
.py
"
,
"
w
"
)
as
f
:
f
.
write
(
python_header
.
format
(
self
.
copyright
,
self
.
issues
,
self
.
code
,
f
.
write
(
python_header
.
format
(
self
.
copyright
,
self
.
issues
,
self
.
code
,
self
.
version_major
,
self
.
version_minor
,
self
.
version_major
,
self
.
version_minor
,
ns
.
upper
(),
ns
))
ns
.
upper
(),
ns
))
for
module
in
self
.
modules
:
for
module
in
self
.
modules
:
write_module
(
f
,
module
,
""
,
""
)
write_module
(
f
,
module
,
""
,
""
,
""
)
def
write_julia
(
self
):
def
write_julia
(
self
):
def
parg
(
a
):
def
parg
(
a
):
...
...
This diff is collapsed.
Click to expand it.
api/gmsh.py
+
498
−
0
View file @
0230766d
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