]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
dump notebook to python
authorasl <asl@opencascade.com>
Sat, 21 Nov 2009 12:10:42 +0000 (12:10 +0000)
committerasl <asl@opencascade.com>
Sat, 21 Nov 2009 12:10:42 +0000 (12:10 +0000)
src/SALOMEDS/SALOMEDS_Driver_i.cxx
src/SALOMEDS/SALOMEDS_Driver_i.hxx

index f41cfc7a6cbafefc18cc76fbde49f003bd6efc3e..0aec6fc2dc59b0653726b1f29bbd368a162f6553 100644 (file)
@@ -225,7 +225,17 @@ SALOMEDSImpl_TMPFile* SALOMEDS_Driver_i::DumpPython(SALOMEDSImpl_Study* theStudy
 
   SALOMEDS::unlock();
   CORBA::Boolean aValidScript, aPublished = isPublished;
-  Engines::TMPFile_var aStream = aComponent->DumpPython(st.in(), aPublished, aValidScript);
+  Engines::TMPFile_var aStream;
+  if( CORBA::is_nil( aComponent ) )
+  {
+    SALOME_NotebookDriver* aNbDriver = dynamic_cast<SALOME_NotebookDriver*>
+      ( st_servant->_default_POA()->reference_to_servant( _driver ) );
+    if( aNbDriver )
+      aStream = aNbDriver->DumpPython( st._retn(), aValidScript );
+  }
+  else
+    aStream = aComponent->DumpPython(st.in(), aPublished, aValidScript);
+
   SALOMEDSImpl_TMPFile* aTMPFile = new Engines_TMPFile_i(aStream._retn());
   theStreamLength = aTMPFile->Size();
   isValidScript = aValidScript;
@@ -242,9 +252,6 @@ SALOMEDS_DriverFactory_i::SALOMEDS_DriverFactory_i(CORBA::ORB_ptr theORB)
 {
   _orb = CORBA::ORB::_duplicate(theORB);
   _name_service = new SALOME_NamingService(_orb);
-
-  SALOME_NotebookDriver* aDriver = new SALOME_NotebookDriver();
-  myNotebookDriver = aDriver->_this();
 }
 
 SALOMEDS_DriverFactory_i::~SALOMEDS_DriverFactory_i()
index 09f69c398ae176eb1fb53ca3b41b4f2ec1d52ff7..8ead21ccb35e7c55f17c2b957642cb111f1bf856 100644 (file)
@@ -133,9 +133,6 @@ public:
   virtual SALOMEDSImpl_Driver* GetDriverByType(const std::string& theComponentType);
 
   virtual SALOMEDSImpl_Driver* GetDriverByIOR(const std::string& theIOR);
-
-private:
-  SALOMEDS::Driver_var myNotebookDriver;
 };
 
 #endif