+//=============================================================================
+/*!
+ Set an option value
+*/
+//=============================================================================
+
+void SMESH_Gen_i::SetOption(const char* name, const char* value)
+{
+ if ( name && value &&
+ strcmp(name, "historical_python_dump") == 0 &&
+ strlen( value ) > 0 )
+ {
+ myIsHistoricalPythonDump = ( value[0] == '1' || toupper(value[0]) == 'T' ); // 1 || true
+
+ // update preferences in case if SetOption() is invoked from python console
+ CORBA::Object_var obj = SMESH_Gen_i::GetNS()->Resolve( "/Kernel/Session" );
+ SALOME::Session_var session = SALOME::Session::_narrow( obj );
+ if ( !CORBA::is_nil( session ) ) {
+ string msg("preferences:SMESH:historical_python_dump:");
+ msg += myIsHistoricalPythonDump ? "true" : "false";
+ session->emitMessageOneWay(msg.c_str());
+ }
+ }
+}
+
+//=============================================================================
+/*!
+ Return an option value
+*/
+//=============================================================================
+
+char* SMESH_Gen_i::GetOption(const char* name)
+{
+ if ( name && strcmp(name, "historical_python_dump") == 0 )
+ {
+ return CORBA::string_dup( myIsHistoricalPythonDump ? "true" : "false" );
+ }
+ return CORBA::string_dup( "" );
+}
+