From 559e788e9d2c8f0666049751d6ed917d7f09908d Mon Sep 17 00:00:00 2001 From: asl Date: Tue, 24 Nov 2009 10:12:26 +0000 Subject: [PATCH] new methods Parameter() and Dump() --- src/KERNEL_PY/salome_notebook.py | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/src/KERNEL_PY/salome_notebook.py b/src/KERNEL_PY/salome_notebook.py index da5abd5cf..e4d37643f 100644 --- a/src/KERNEL_PY/salome_notebook.py +++ b/src/KERNEL_PY/salome_notebook.py @@ -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 ) -- 2.39.2