Commit 5b30c6f8 authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

Merge branch 'master' into devel

parents 02c49adb 194cea8f
Pipeline #10197 passed with stage
in 10 minutes and 38 seconds
unitTesting/test_python-syntax_error.py tests/test_python-syntax_error.py
Subproject commit c333a88decb3e4c0a86947bc6c7f072dc5c5df20 Subproject commit fb4c22c319ec5320f9a85527eb1a4130954846f5
<?xml version="1.0"?> <?xml version="1.0"?>
<package format="3"> <package format="3">
<name>dynamic-graph-python</name> <name>dynamic-graph-python</name>
<version>3.5.2</version> <version>3.5.3</version>
<description> <description>
Dynamic graph library Python bindings Dynamic graph library Python bindings
</description> </description>
......
...@@ -16,7 +16,6 @@ FOREACH(source ${PYTHON_SOURCES}) ...@@ -16,7 +16,6 @@ FOREACH(source ${PYTHON_SOURCES})
ENDFOREACH(source) ENDFOREACH(source)
# --- ADD the wrap on the dg modules # --- ADD the wrap on the dg modules
LINK_DIRECTORIES(${DYNAMIC_GRAPH_PLUGINDIR})
DYNAMIC_GRAPH_PYTHON_MODULE("tracer" dynamic-graph::tracer tracer-wrap) DYNAMIC_GRAPH_PYTHON_MODULE("tracer" dynamic-graph::tracer tracer-wrap)
DYNAMIC_GRAPH_PYTHON_MODULE("tracer_real_time" dynamic-graph::tracer-real-time DYNAMIC_GRAPH_PYTHON_MODULE("tracer_real_time" dynamic-graph::tracer-real-time
tracer_real_time-wrap) tracer_real_time-wrap)
...@@ -22,8 +22,8 @@ namespace dynamicgraph { ...@@ -22,8 +22,8 @@ namespace dynamicgraph {
namespace python { namespace python {
#if PY_MAJOR_VERSION == 2 #if PY_MAJOR_VERSION == 2
extern PyObject* dgpyError; extern PyObject* dgpyError;
# endif #endif
namespace debug { namespace debug {
...@@ -35,7 +35,7 @@ PyObject* addLoggerFileOutputStream( ...@@ -35,7 +35,7 @@ PyObject* addLoggerFileOutputStream(
#else #else
PyObject*, PyObject* args PyObject*, PyObject* args
#endif #endif
) { ) {
char* filename; char* filename;
if (!PyArg_ParseTuple(args, "s", &filename)) return NULL; if (!PyArg_ParseTuple(args, "s", &filename)) return NULL;
std::string sfilename(filename); std::string sfilename(filename);
...@@ -58,7 +58,7 @@ PyObject* closeLoggerFileOutputStream( ...@@ -58,7 +58,7 @@ PyObject* closeLoggerFileOutputStream(
#else #else
PyObject*, PyObject* PyObject*, PyObject*
#endif #endif
) { ) {
try { try {
for (std::map<std::string, ofstreamShrPtr>::iterator it = mapOfFiles_.begin(); it != mapOfFiles_.end(); ++it) { for (std::map<std::string, ofstreamShrPtr>::iterator it = mapOfFiles_.begin(); it != mapOfFiles_.end(); ++it) {
it->second->close(); it->second->close();
...@@ -74,7 +74,7 @@ PyObject* addLoggerCoutOutputStream( ...@@ -74,7 +74,7 @@ PyObject* addLoggerCoutOutputStream(
#else #else
PyObject*, PyObject* PyObject*, PyObject*
#endif #endif
) { ) {
try { try {
dgADD_OSTREAM_TO_RTLOG(std::cout); dgADD_OSTREAM_TO_RTLOG(std::cout);
} }
...@@ -88,7 +88,7 @@ PyObject* realTimeLoggerDestroy( ...@@ -88,7 +88,7 @@ PyObject* realTimeLoggerDestroy(
#else #else
PyObject*, PyObject* PyObject*, PyObject*
#endif #endif
) { ) {
try { try {
RealTimeLogger::destroy(); RealTimeLogger::destroy();
} }
...@@ -102,7 +102,7 @@ PyObject* realTimeLoggerSpinOnce( ...@@ -102,7 +102,7 @@ PyObject* realTimeLoggerSpinOnce(
#else #else
PyObject*, PyObject* PyObject*, PyObject*
#endif #endif
) { ) {
try { try {
RealTimeLogger::instance().spinOnce(); RealTimeLogger::instance().spinOnce();
} }
...@@ -116,7 +116,7 @@ PyObject* realTimeLoggerInstance( ...@@ -116,7 +116,7 @@ PyObject* realTimeLoggerInstance(
#else #else
PyObject*, PyObject* PyObject*, PyObject*
#endif #endif
) { ) {
try { try {
RealTimeLogger::instance(); RealTimeLogger::instance();
} }
......
...@@ -15,8 +15,8 @@ namespace dynamicgraph { ...@@ -15,8 +15,8 @@ namespace dynamicgraph {
namespace python { namespace python {
#if PY_MAJOR_VERSION == 2 #if PY_MAJOR_VERSION == 2
PyObject* dgpyError; PyObject* dgpyError;
# endif #endif
/** /**
\brief plug a signal into another one. \brief plug a signal into another one.
...@@ -27,7 +27,7 @@ PyObject* plug( ...@@ -27,7 +27,7 @@ PyObject* plug(
#else #else
PyObject*, PyObject* args PyObject*, PyObject* args
#endif #endif
) { ) {
PyObject* objOut = NULL; PyObject* objOut = NULL;
PyObject* objIn = NULL; PyObject* objIn = NULL;
void* pObjOut; void* pObjOut;
...@@ -51,20 +51,20 @@ PyObject* plug( ...@@ -51,20 +51,20 @@ PyObject* plug(
pObjIn = PyCapsule_GetPointer(objIn, "dynamic_graph.Signal"); pObjIn = PyCapsule_GetPointer(objIn, "dynamic_graph.Signal");
SignalBase<int>* signalIn = (SignalBase<int>*)pObjIn; SignalBase<int>* signalIn = (SignalBase<int>*)pObjIn;
if (signalIn == NULL) { if (signalIn == NULL) {
std::ostringstream oss; std::ostringstream oss;
oss << "dynamic_graph.plug(a, b): Argument 'b' must be of type 'dynamic_graph.Signal', but got " oss << "dynamic_graph.plug(a, b): Argument 'b' must be of type 'dynamic_graph.Signal', but got "
<< PyCapsule_GetName(objIn); << PyCapsule_GetName(objIn);
PyErr_SetString(PyExc_TypeError, oss.str().c_str()); PyErr_SetString(PyExc_TypeError, oss.str().c_str());
return NULL; return NULL;
} }
pObjOut = PyCapsule_GetPointer(objOut, "dynamic_graph.Signal"); pObjOut = PyCapsule_GetPointer(objOut, "dynamic_graph.Signal");
SignalBase<int>* signalOut = (SignalBase<int>*)pObjOut; SignalBase<int>* signalOut = (SignalBase<int>*)pObjOut;
if (signalOut == NULL) { if (signalOut == NULL) {
std::ostringstream oss; std::ostringstream oss;
oss << "dynamic_graph.plug(a, b): Argument 'a' must be of type 'dynamic_graph.Signal', but got " oss << "dynamic_graph.plug(a, b): Argument 'a' must be of type 'dynamic_graph.Signal', but got "
<< PyCapsule_GetName(objOut); << PyCapsule_GetName(objOut);
PyErr_SetString(PyExc_TypeError, oss.str().c_str()); PyErr_SetString(PyExc_TypeError, oss.str().c_str());
return NULL; return NULL;
} }
std::ostringstream os; std::ostringstream os;
...@@ -81,7 +81,7 @@ PyObject* enableTrace( ...@@ -81,7 +81,7 @@ PyObject* enableTrace(
#else #else
PyObject*, PyObject* args PyObject*, PyObject* args
#endif #endif
) { ) {
PyObject* boolean; PyObject* boolean;
char* filename = NULL; char* filename = NULL;
......
...@@ -33,8 +33,8 @@ namespace python { ...@@ -33,8 +33,8 @@ namespace python {
using namespace convert; using namespace convert;
#if PY_MAJOR_VERSION == 2 #if PY_MAJOR_VERSION == 2
extern PyObject* dgpyError; extern PyObject* dgpyError;
# endif #endif
namespace entity { namespace entity {
...@@ -47,7 +47,7 @@ PyObject* create( ...@@ -47,7 +47,7 @@ PyObject* create(
#else #else
PyObject*, PyObject* args PyObject*, PyObject* args
#endif #endif
) { ) {
char* className = NULL; char* className = NULL;
char* instanceName = NULL; char* instanceName = NULL;
...@@ -85,7 +85,7 @@ PyObject* getName( ...@@ -85,7 +85,7 @@ PyObject* getName(
#else #else
PyObject*, PyObject* args PyObject*, PyObject* args
#endif #endif
) { ) {
PyObject* object = NULL; PyObject* object = NULL;
void* pointer = NULL; void* pointer = NULL;
std::string name; std::string name;
...@@ -115,7 +115,7 @@ PyObject* getClassName( ...@@ -115,7 +115,7 @@ PyObject* getClassName(
#else #else
PyObject*, PyObject* args PyObject*, PyObject* args
#endif #endif
) { ) {
PyObject* object = NULL; PyObject* object = NULL;
void* pointer = NULL; void* pointer = NULL;
std::string name; std::string name;
...@@ -145,7 +145,7 @@ PyObject* hasSignal( ...@@ -145,7 +145,7 @@ PyObject* hasSignal(
#else #else
PyObject*, PyObject* args PyObject*, PyObject* args
#endif #endif
) { ) {
char* name = NULL; char* name = NULL;
PyObject* object = NULL; PyObject* object = NULL;
void* pointer = NULL; void* pointer = NULL;
...@@ -181,7 +181,7 @@ PyObject* getSignal( ...@@ -181,7 +181,7 @@ PyObject* getSignal(
#else #else
PyObject*, PyObject* args PyObject*, PyObject* args
#endif #endif
) { ) {
char* name = NULL; char* name = NULL;
PyObject* object = NULL; PyObject* object = NULL;
void* pointer = NULL; void* pointer = NULL;
...@@ -213,7 +213,7 @@ PyObject* listSignals( ...@@ -213,7 +213,7 @@ PyObject* listSignals(
#else #else
PyObject*, PyObject* args PyObject*, PyObject* args
#endif #endif
) { ) {
void* pointer = NULL; void* pointer = NULL;
PyObject* object = NULL; PyObject* object = NULL;
...@@ -246,9 +246,9 @@ PyObject* executeCommand( ...@@ -246,9 +246,9 @@ PyObject* executeCommand(
#if PY_MAJOR_VERSION >= 3 #if PY_MAJOR_VERSION >= 3
PyObject* m, PyObject* args PyObject* m, PyObject* args
#else #else
PyObject* , PyObject* args PyObject*, PyObject* args
#endif #endif
) { ) {
PyObject* object = NULL; PyObject* object = NULL;
PyObject* argTuple = NULL; PyObject* argTuple = NULL;
char* commandName = NULL; char* commandName = NULL;
...@@ -344,7 +344,7 @@ PyObject* getCommandDocstring( ...@@ -344,7 +344,7 @@ PyObject* getCommandDocstring(
#else #else
PyObject*, PyObject* args PyObject*, PyObject* args
#endif #endif
) { ) {
PyObject* object = NULL; PyObject* object = NULL;
char* commandName; char* commandName;
if (!PyArg_ParseTuple(args, "Os", &object, &commandName)) { if (!PyArg_ParseTuple(args, "Os", &object, &commandName)) {
...@@ -380,7 +380,7 @@ PyObject* getDocString( ...@@ -380,7 +380,7 @@ PyObject* getDocString(
#else #else
PyObject*, PyObject* args PyObject*, PyObject* args
#endif #endif
) { ) {
PyObject* object = NULL; PyObject* object = NULL;
if (!PyArg_ParseTuple(args, "O", &object)) { if (!PyArg_ParseTuple(args, "O", &object)) {
return NULL; return NULL;
...@@ -411,7 +411,7 @@ PyObject* display( ...@@ -411,7 +411,7 @@ PyObject* display(
#else #else
PyObject*, PyObject* args PyObject*, PyObject* args
#endif #endif
) { ) {
/* Retrieve the entity instance. */ /* Retrieve the entity instance. */
PyObject* object = NULL; PyObject* object = NULL;
if (!PyArg_ParseTuple(args, "O", &object) || (!PyCapsule_CheckExact(object))) { if (!PyArg_ParseTuple(args, "O", &object) || (!PyCapsule_CheckExact(object))) {
...@@ -438,7 +438,7 @@ PyObject* setLoggerVerbosityLevel( ...@@ -438,7 +438,7 @@ PyObject* setLoggerVerbosityLevel(
#else #else
PyObject*, PyObject* args PyObject*, PyObject* args
#endif #endif
) { ) {
PyObject* object = NULL; PyObject* object = NULL;
PyObject* objectVerbosityLevel = NULL; PyObject* objectVerbosityLevel = NULL;
if (!PyArg_ParseTuple(args, "OO", &object, &objectVerbosityLevel)) return NULL; if (!PyArg_ParseTuple(args, "OO", &object, &objectVerbosityLevel)) return NULL;
...@@ -500,7 +500,7 @@ PyObject* getLoggerVerbosityLevel( ...@@ -500,7 +500,7 @@ PyObject* getLoggerVerbosityLevel(
#else #else
PyObject*, PyObject* args PyObject*, PyObject* args
#endif #endif
) { ) {
PyObject* object = NULL; PyObject* object = NULL;
if (!PyArg_ParseTuple(args, "O", &object)) return NULL; if (!PyArg_ParseTuple(args, "O", &object)) return NULL;
...@@ -532,7 +532,7 @@ PyObject* getStreamPrintPeriod( ...@@ -532,7 +532,7 @@ PyObject* getStreamPrintPeriod(
#else #else
PyObject*, PyObject* args PyObject*, PyObject* args
#endif #endif
) { ) {
PyObject* object = NULL; PyObject* object = NULL;
if (!PyArg_ParseTuple(args, "O", &object)) return NULL; if (!PyArg_ParseTuple(args, "O", &object)) return NULL;
...@@ -563,7 +563,7 @@ PyObject* setStreamPrintPeriod( ...@@ -563,7 +563,7 @@ PyObject* setStreamPrintPeriod(
#else #else
PyObject*, PyObject* args PyObject*, PyObject* args
#endif #endif
) { ) {
PyObject* object = NULL; PyObject* object = NULL;
double streamPrintPeriod = 0; double streamPrintPeriod = 0;
if (!PyArg_ParseTuple(args, "Od", &object, &streamPrintPeriod)) return NULL; if (!PyArg_ParseTuple(args, "Od", &object, &streamPrintPeriod)) return NULL;
...@@ -603,7 +603,7 @@ PyObject* getTimeSample( ...@@ -603,7 +603,7 @@ PyObject* getTimeSample(
#else #else
PyObject*, PyObject* args PyObject*, PyObject* args
#endif #endif
) { ) {
PyObject* object = NULL; PyObject* object = NULL;
if (!PyArg_ParseTuple(args, "O", &object)) return NULL; if (!PyArg_ParseTuple(args, "O", &object)) return NULL;
...@@ -634,7 +634,7 @@ PyObject* setTimeSample( ...@@ -634,7 +634,7 @@ PyObject* setTimeSample(
#else #else
PyObject*, PyObject* args PyObject*, PyObject* args
#endif #endif
) { ) {
PyObject* object = NULL; PyObject* object = NULL;
double timeSample; double timeSample;
if (!PyArg_ParseTuple(args, "Od", &object, &timeSample)) return NULL; if (!PyArg_ParseTuple(args, "Od", &object, &timeSample)) return NULL;
......
...@@ -11,8 +11,8 @@ namespace dynamicgraph { ...@@ -11,8 +11,8 @@ namespace dynamicgraph {
namespace python { namespace python {
#if PY_MAJOR_VERSION == 2 #if PY_MAJOR_VERSION == 2
extern PyObject* dgpyError; extern PyObject* dgpyError;
# endif #endif
namespace pool { namespace pool {
...@@ -22,7 +22,7 @@ PyObject* writeGraph( ...@@ -22,7 +22,7 @@ PyObject* writeGraph(
#else #else
PyObject*, PyObject* args PyObject*, PyObject* args
#endif #endif
) { ) {
char* filename; char* filename;
if (!PyArg_ParseTuple(args, "s", &filename)) return NULL; if (!PyArg_ParseTuple(args, "s", &filename)) return NULL;
try { try {
...@@ -41,7 +41,7 @@ PyObject* getEntityList( ...@@ -41,7 +41,7 @@ PyObject* getEntityList(
#else #else
PyObject*, PyObject* args PyObject*, PyObject* args
#endif #endif
) { ) {
if (!PyArg_ParseTuple(args, "")) return NULL; if (!PyArg_ParseTuple(args, "")) return NULL;
std::vector<std::string> entityNames; std::vector<std::string> entityNames;
......
...@@ -22,8 +22,8 @@ namespace dynamicgraph { ...@@ -22,8 +22,8 @@ namespace dynamicgraph {
namespace python { namespace python {
#if PY_MAJOR_VERSION == 2 #if PY_MAJOR_VERSION == 2
extern PyObject* dgpyError; extern PyObject* dgpyError;
# endif #endif
using namespace convert; using namespace convert;
...@@ -96,7 +96,7 @@ PyObject* createSignalWrapper( ...@@ -96,7 +96,7 @@ PyObject* createSignalWrapper(
#else #else
PyObject*, PyObject* args PyObject*, PyObject* args
#endif #endif
) { ) {
PythonSignalContainer* psc = getPythonSignalContainer(); PythonSignalContainer* psc = getPythonSignalContainer();
if (psc == NULL) return NULL; if (psc == NULL) return NULL;
...@@ -159,7 +159,7 @@ PyObject* setTime( ...@@ -159,7 +159,7 @@ PyObject* setTime(
#else #else
PyObject*, PyObject* args PyObject*, PyObject* args
#endif #endif
) { ) {
void* pointer = NULL; void* pointer = NULL;
PyObject* object = NULL; PyObject* object = NULL;
int time; int time;
...@@ -182,7 +182,7 @@ PyObject* display( ...@@ -182,7 +182,7 @@ PyObject* display(
#else #else
PyObject*, PyObject* args PyObject*, PyObject* args
#endif #endif
) { ) {
void* pointer = NULL; void* pointer = NULL;
PyObject* object = NULL; PyObject* object = NULL;
if (!PyArg_ParseTuple(args, "O", &object)) return NULL; if (!PyArg_ParseTuple(args, "O", &object)) return NULL;
...@@ -206,7 +206,7 @@ PyObject* displayDependencies( ...@@ -206,7 +206,7 @@ PyObject* displayDependencies(
#else #else
PyObject*, PyObject* args PyObject*, PyObject* args
#endif #endif
) { ) {
void* pointer = NULL; void* pointer = NULL;
PyObject* object = NULL; PyObject* object = NULL;
int time; int time;
...@@ -230,7 +230,7 @@ PyObject* getValue( ...@@ -230,7 +230,7 @@ PyObject* getValue(
#else #else
PyObject*, PyObject* args PyObject*, PyObject* args
#endif #endif
) { ) {
void* pointer = NULL; void* pointer = NULL;
PyObject* object = NULL; PyObject* object = NULL;
if (!PyArg_ParseTuple(args, "O", &object)) return NULL; if (!PyArg_ParseTuple(args, "O", &object)) return NULL;
...@@ -330,7 +330,7 @@ PyObject* getName( ...@@ -330,7 +330,7 @@ PyObject* getName(
#else #else
PyObject*, PyObject* args PyObject*, PyObject* args
#endif #endif
) { ) {
void* pointer = NULL; void* pointer = NULL;
PyObject* object = NULL; PyObject* object = NULL;
if (!PyArg_ParseTuple(args, "O", &object)) return NULL; if (!PyArg_ParseTuple(args, "O", &object)) return NULL;
...@@ -354,7 +354,7 @@ PyObject* getClassName( ...@@ -354,7 +354,7 @@ PyObject* getClassName(
#else #else
PyObject*, PyObject* args PyObject*, PyObject* args
#endif #endif
) { ) {
void* pointer = NULL; void* pointer = NULL;
PyObject* object = NULL; PyObject* object = NULL;
if (!PyArg_ParseTuple(args, "O", &object)) return NULL; if (!PyArg_ParseTuple(args, "O", &object)) return NULL;
...@@ -378,7 +378,7 @@ PyObject* setValue( ...@@ -378,7 +378,7 @@ PyObject* setValue(
#else #else
PyObject*, PyObject* args PyObject*, PyObject* args
#endif #endif
) { ) {
void* pointer = NULL; void* pointer = NULL;
PyObject* object = NULL; PyObject* object = NULL;
char* valueString = NULL; char* valueString = NULL;
...@@ -405,7 +405,7 @@ PyObject* recompute( ...@@ -405,7 +405,7 @@ PyObject* recompute(
#else #else
PyObject*, PyObject* args PyObject*, PyObject* args
#endif #endif
) { ) {
void* pointer = NULL; void* pointer = NULL;
PyObject* object = NULL; PyObject* object = NULL;
unsigned int time; unsigned int time;
...@@ -427,7 +427,7 @@ PyObject* unplug( ...@@ -427,7 +427,7 @@ PyObject* unplug(
#else #else
PyObject*, PyObject* args PyObject*, PyObject* args
#endif #endif