]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
new methods Parameter() and Dump()
authorasl <asl@opencascade.com>
Tue, 24 Nov 2009 10:12:26 +0000 (10:12 +0000)
committerasl <asl@opencascade.com>
Tue, 24 Nov 2009 10:12:26 +0000 (10:12 +0000)
src/KERNEL_PY/salome_notebook.py

index da5abd5cfeb4d7ba6f3535093da6a919af69caaf..e4d37643f4d2fbc4fcfad4ce310b2c64543af6ec 100644 (file)
@@ -32,7 +32,7 @@ Module salome_notebook gives access to Salome Notebook.
 import salome
 import SALOME
 
-class NoteBook:
+class Notebook:
     
     def __init__( self, Study ):
         self.myNotebook = Study.GetNotebook()
@@ -58,19 +58,19 @@ class NoteBook:
                 
         elif type( variable ) == str:
             if aParam == None:
-                self.myStudy.AddExpression( variableName, variable )
+                self.myNotebook.AddNamedExpression( variableName, variable )
             else:
                 aParam.SetExpression( variable )
             
         elif type( variable ) == int:
             if aParam == None:
-                self.myStudy.AddInteger( variableName, variable )
+                self.myNotebook.AddInteger( variableName, variable )
             else:
                 aParam.SetInteger( variable )
             
         elif type( variable ) == bool:
             if aParam == None:
-                self.myStudy.AddBoolean( variableName, variable )
+                self.myNotebook.AddBoolean( variableName, variable )
             else:
                 aParam.SetBoolean( variable )
             
@@ -104,4 +104,17 @@ class NoteBook:
         aParam = self.myNotebook.GetParameter( variableName )
         return aParam != None
 
-notebook = NoteBook(salome.myStudy)
+    def dump( self ):
+        return self.myNotebook.Dump()
+
+    def rename( self, oldname, newname ):
+        self.myNotebook.Rename( oldname, newname )
+
+    def remove( self, name ):
+        self.myNotebook.Remove( name )
+
+
+notebook = Notebook(salome.myStudy)
+
+def Parameter( varName ):
+    return notebook.getNotebook().GetParameter( varName )