Python3 porting: adoptation SMESH dump python functionality.

This commit is contained in:
rnv 2017-05-31 18:15:36 +03:00
parent 78be86e48b
commit 21c9336a4d
2 changed files with 3 additions and 3 deletions

View File

@ -185,7 +185,7 @@ namespace {
_AString comment; _AString comment;
_pyID obj = cmd->GetObject(); _pyID obj = cmd->GetObject();
if ( obj.Search( "print " ) == 1 ) if ( obj.Search( "print(" ) == 1 )
return; // print statement return; // print statement
if ( !obj.IsEmpty() && obj.Value( obj.Length() ) == ')' ) if ( !obj.IsEmpty() && obj.Value( obj.Length() ) == ')' )
@ -688,7 +688,7 @@ Handle(_pyCommand) _pyGen::AddCommand( const TCollection_AsciiString& theCommand
_AString newCmd = indent + tab + ( aCommand->GetString().ToCString() + indent.Length() ); _AString newCmd = indent + tab + ( aCommand->GetString().ToCString() + indent.Length() );
_AString pasCmd = indent + tab + "pass"; // to keep valid if newCmd is erased _AString pasCmd = indent + tab + "pass"; // to keep valid if newCmd is erased
_AString excStr = indent + "except:"; _AString excStr = indent + "except:";
_AString msgStr = indent + "\tprint '"; msgStr += method + "() failed. Invalid file name?'"; _AString msgStr = indent + "\tprint('"; msgStr += method + "() failed. Invalid file name?')";
myCommands.insert( --myCommands.end(), new _pyCommand( tryStr, myNbCommands )); myCommands.insert( --myCommands.end(), new _pyCommand( tryStr, myNbCommands ));
aCommand->Clear(); aCommand->Clear();

View File

@ -58,7 +58,7 @@ using SMESH::TVar;
static void addErrorCode(const char* thePyCommand) static void addErrorCode(const char* thePyCommand)
{ {
TPythonDump() << "if (isDone != 1):"; TPythonDump() << "if (isDone != 1):";
TPythonDump() << "\tprint '" << thePyCommand << " :', pattern.GetErrorCode()"; TPythonDump() << "\tprint('" << thePyCommand << " :', pattern.GetErrorCode())";
} }
//============================================================================= //=============================================================================