Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
dynamic-graph-python
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
Stack Of Tasks
dynamic-graph-python
Commits
98d9c163
Commit
98d9c163
authored
13 years ago
by
Florent Lamiraux
Committed by
Florent Lamiraux florent@laas.fr
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add python binding for writing graph.
parent
3ff69b7c
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/CMakeLists.txt
+1
-0
1 addition, 0 deletions
src/CMakeLists.txt
src/dynamic-graph-py.cc
+9
-2
9 additions, 2 deletions
src/dynamic-graph-py.cc
src/pool-py.cc
+39
-0
39 additions, 0 deletions
src/pool-py.cc
with
49 additions
and
2 deletions
src/CMakeLists.txt
+
1
−
0
View file @
98d9c163
...
...
@@ -77,6 +77,7 @@ ADD_LIBRARY(${PYTHON_MODULE}
signal-base-py.cc
entity-py.cc
factory-py.cc
pool-py.cc
signal-caster-py.cc
)
...
...
This diff is collapsed.
Click to expand it.
src/dynamic-graph-py.cc
+
9
−
2
View file @
98d9c163
...
...
@@ -51,10 +51,13 @@ namespace dynamicgraph {
}
namespace
factory
{
PyObject
*
getEntityClassList
(
PyObject
*
self
,
PyObject
*
args
);
extern
PyObject
*
getEntityClassList
(
PyObject
*
self
,
PyObject
*
args
);
}
namespace
signalCaster
{
PyObject
*
getSignalTypeList
(
PyObject
*
self
,
PyObject
*
args
);
extern
PyObject
*
getSignalTypeList
(
PyObject
*
self
,
PyObject
*
args
);
}
namespace
pool
{
extern
PyObject
*
writeGraph
(
PyObject
*
self
,
PyObject
*
args
);
}
PyObject
*
dgpyError
;
...
...
@@ -198,6 +201,10 @@ static PyMethodDef dynamicGraphMethods[] = {
dynamicgraph
::
python
::
signalCaster
::
getSignalTypeList
,
METH_VARARGS
,
"return the list of signal type names"
},
{
"writeGraph"
,
dynamicgraph
::
python
::
pool
::
writeGraph
,
METH_VARARGS
,
"Write the graph of entities in a filename."
},
{
NULL
,
NULL
,
0
,
NULL
}
/* Sentinel */
};
...
...
This diff is collapsed.
Click to expand it.
src/pool-py.cc
0 → 100644
+
39
−
0
View file @
98d9c163
// Copyright 2011, 2012, Florent Lamiraux, LAAS-CNRS.
//
// This file is part of dynamic-graph-python.
// dynamic-graph-python is free software: you can redistribute it
// and/or modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation, either
// version 3 of the License, or (at your option) any later version.
//
// dynamic-graph-python is distributed in the hope that it will be
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Lesser Public License for more details. You should
// have received a copy of the GNU Lesser General Public License along
// with dynamic-graph. If not, see <http://www.gnu.org/licenses/>.
#include
<Python.h>
#include
<dynamic-graph/pool.h>
namespace
dynamicgraph
{
namespace
python
{
extern
PyObject
*
dgpyError
;
namespace
pool
{
PyObject
*
writeGraph
(
PyObject
*
/*self*/
,
PyObject
*
args
)
{
char
*
filename
;
if
(
!
PyArg_ParseTuple
(
args
,
"s"
,
&
filename
))
return
NULL
;
try
{
PoolStorage
::
getInstance
()
->
writeGraph
(
filename
);
}
catch
(
const
std
::
exception
&
exc
)
{
PyErr_SetString
(
dgpyError
,
exc
.
what
());
return
NULL
;
}
return
Py_BuildValue
(
""
);
}
}
// python
}
// dynamicgraph
}
// namespace pool
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