From: caremoli Date: Fri, 26 Sep 2008 14:49:42 +0000 (+0000) Subject: CCAR: add autodocumentation to swig modules (%feature("autodoc","1")) X-Git-Tag: RELIQUAT_4x_25102008~30 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=587a043f49755e0744fd2c7b7d16a1aa9bc94cb6;p=modules%2Fkernel.git CCAR: add autodocumentation to swig modules (%feature("autodoc","1")) et remove problems with overloaded methods (typecheck typemap with precedence) --- diff --git a/src/Batch_SWIG/libBatch_Swig.i b/src/Batch_SWIG/libBatch_Swig.i index f5b5e791a..255d107dc 100644 --- a/src/Batch_SWIG/libBatch_Swig.i +++ b/src/Batch_SWIG/libBatch_Swig.i @@ -41,6 +41,9 @@ /* Le nom du module Python tel qu'il est importe */ %module libBatch_Swig +/* generate docstrings with types */ +%feature("autodoc", "1"); + /* Inclusion des conversions de type */ %include libBatch_Swig_typemap.i diff --git a/src/Batch_SWIG/libBatch_Swig_typemap.i b/src/Batch_SWIG/libBatch_Swig_typemap.i index 06bdfce39..9fb772fee 100644 --- a/src/Batch_SWIG/libBatch_Swig_typemap.i +++ b/src/Batch_SWIG/libBatch_Swig_typemap.i @@ -53,6 +53,10 @@ } } +%typemap(typecheck,precedence=SWIG_TYPECHECK_POINTER) Batch::Parametre +{ + $1 = PyDict_Check($input)? 1 : 0; +} # // construction d'un dictionnaire Python a partir d'un objet Parametre C++ %typemap(out) Batch::Parametre @@ -136,6 +140,10 @@ } } +%typemap(typecheck,precedence=SWIG_TYPECHECK_POINTER) Batch::Environnement +{ + $1 = PyDict_Check($input)? 1 : 0; +} # // construction d'un dictionnaire Python a partir d'un objet Environnement C++ %typemap(out) Batch::Environnement diff --git a/src/Communication_SWIG/libSALOME_Comm.i b/src/Communication_SWIG/libSALOME_Comm.i index f27bc4f3c..ea53d3017 100644 --- a/src/Communication_SWIG/libSALOME_Comm.i +++ b/src/Communication_SWIG/libSALOME_Comm.i @@ -19,6 +19,8 @@ // %module libSALOME_Comm +%feature("autodoc", "1"); + %{ #include "ReceiverFactory.hxx" #include "MatrixClient.hxx" diff --git a/src/LifeCycleCORBA_SWIG/libSALOME_LifeCycleCORBA.i b/src/LifeCycleCORBA_SWIG/libSALOME_LifeCycleCORBA.i index feaca2631..b6b03ca38 100644 --- a/src/LifeCycleCORBA_SWIG/libSALOME_LifeCycleCORBA.i +++ b/src/LifeCycleCORBA_SWIG/libSALOME_LifeCycleCORBA.i @@ -23,6 +23,8 @@ %module libSALOME_LifeCycleCORBA +%feature("autodoc", "1"); + %include @@ -116,10 +118,13 @@ struct omniORBpyAPI { $result = PyString_FromString($1.c_str()); } -%typemap(typecheck) const Engines::MachineParameters &, - Engines::MachineParameters const & +%typemap(typecheck,precedence=SWIG_TYPECHECK_POINTER) Engines::MachineParameters const & +{ + $1 = PyDict_Check($input)? 1 : 0; +} +%typemap(typecheck,precedence=SWIG_TYPECHECK_POINTER) const Engines::MachineParameters & { - $1 = PyDict_Check($input); + $1 = PyDict_Check($input)? 1 : 0; } %typemap(typecheck) std::string, diff --git a/src/NOTIFICATION_SWIG/NOTIFICATION.i b/src/NOTIFICATION_SWIG/NOTIFICATION.i index ccd684c2f..01ad8b667 100644 --- a/src/NOTIFICATION_SWIG/NOTIFICATION.i +++ b/src/NOTIFICATION_SWIG/NOTIFICATION.i @@ -27,6 +27,7 @@ %module libNOTIFICATION +%feature("autodoc", "1"); %{ //#define __declspec(a)