#include "DataFlowBase_StreamGraph.hxx"
//#include "DataFlowBase_LoopNode.hxx"
+// Screen single quotes
+static string protectQuotes (const string theText)
+{
+ string aRes (theText);
+ for (unsigned int pos = 0; pos < aRes.size(); pos+=2) {
+ pos = aRes.find("'", pos);
+ if (pos < 0 || pos > aRes.size()) break;
+ aRes.replace(pos, 1, "\\\'");
+ }
+ return aRes;
+}
+
static void InitFields( //SUPERV::KindOfNode &_Kind ,
SUPERV::SDate &_FirstCreation ,
SUPERV::SDate &_LastModification ,
if ( PythonFunctions.size() ) {
aPyFunc = *PythonFunctions[0] ;
for ( i = 0 ; i < (int ) aPyFunc.length() ; i++ ) {
- f << " " << "Py" << Name() << ".append( '" << aPyFunc[i] << "' )" << endl ;
+ f << " " << "Py" << Name() << ".append( '" << protectQuotes(aPyFunc[i].in()) << "' )" << endl;
}
}
if ( IsInLineNode() ) {
SUPERV::ListOfStrings aPyMore = *PythonFunctions[1] ;
SUPERV::ListOfStrings aPyNext = *PythonFunctions[2] ;
f << " " << "PyMore" << Name() << " = []" << endl ;
+
for ( i = 0 ; i < (int ) aPyMore.length() ; i++ ) {
- f << " " << "PyMore" << Name() << ".append( '" << aPyMore[i] << "' )" << endl ;
+ f << " " << "PyMore" << Name() << ".append( '"
+ << protectQuotes(aPyMore[i].in()) << "' )" << endl;
}
f << " " << "PyNext" << Name() << " = []" << endl ;
for ( i = 0 ; i < (int ) aPyNext.length() ; i++ ) {
- f << " " << "PyNext" << Name() << ".append( '" << aPyNext[i] << "' )" << endl ;
+ f << " " << "PyNext" << Name() << ".append( '"
+ << protectQuotes(aPyNext[i].in()) << "' )" << endl ;
}
f << " " << Name() << "," << EndName << " = " << aGraphName << ".LNode( '"
<< FuncNames[0].c_str() << "' , Py" << Name() << " , '"
SUPERV::ListOfStrings aPyFunc = *aCoupledNode->PythonFunction() ;
f << " " << "Py" << aCoupledNode->Name() << " = []" << endl ;
for ( i = 0 ; i < (int ) aPyFunc.length() ; i++ ) {
- f << " " << "Py" << aCoupledNode->Name() << ".append( '" << aPyFunc[i] << "' )"
- << endl ;
+ f << " " << "Py" << aCoupledNode->Name() << ".append( '"
+ << protectQuotes(aPyFunc[i].in()) << "' )" << endl;
}
f << " " << EndName << ".SetPyFunction( '" << aCoupledNode->PyFuncName() << "' , Py" << aCoupledNode->Name() << " )" << endl ;
for ( i = 0 ; i < GetNodeInPortsSize() ; i++ ) {
SUPERV::ListOfStrings aPyFunc = *aCoupledNode->PythonFunction() ;
f << " " << "Py" << aCoupledNode->Name() << " = []" << endl ;
for ( i = 0 ; i < (int ) aPyFunc.length() ; i++ ) {
- f << " " << "Py" << aCoupledNode->Name() << ".append( '" << aPyFunc[i] << "' )"
- << endl ;
+ f << " " << "Py" << aCoupledNode->Name() << ".append( '"
+ << protectQuotes(aPyFunc[i].in()) << "' )" << endl;
}
f << " " << EndName << ".SetPyFunction( '" << aCoupledNode->PyFuncName() << "' , Py" << aCoupledNode->Name() << " )" << endl ;
for ( i = 0 ; i < aCoupledNode->GetNodeInPortsSize() ; i++ ) {