X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FKERNEL_PY%2Fsalome_notebook.py;h=92857da24fe50af1bdf6240e32032d57d24825e0;hb=103f3eba0aca975b1a73e15ec6859ef3e78bc684;hp=727d01df7a780b19bf68efa8e9204ea5b1f823cd;hpb=dac5e4d5c8f771e0cedb7caa5292bc54be5ca89a;p=modules%2Fkernel.git diff --git a/src/KERNEL_PY/salome_notebook.py b/src/KERNEL_PY/salome_notebook.py index 727d01df7..92857da24 100644 --- a/src/KERNEL_PY/salome_notebook.py +++ b/src/KERNEL_PY/salome_notebook.py @@ -69,24 +69,27 @@ class PseudoStudyForNoteBook(object): class NoteBook: - def __init__(self, Study): - self.myStudy = Study + def __init__(self, theIsEnablePublish = True): + if theIsEnablePublish: + self.myStudy = salome.myStudy + else: + self.myStudy = PseudoStudyForNoteBook() def set(self, variableName, variable): """ Create (or modify) variable with name "variableName" and value equal "theValue". """ - if type(variable) == float: + if isinstance(variable, float): self.myStudy.SetReal(variableName, variable) - elif type(variable) == int: + elif isinstance(variable, int): self.myStudy.SetInteger(variableName, variable) - elif type(variable) == bool: + elif isinstance(variable, bool): self.myStudy.SetBoolean(variableName, variable) - elif type(variable) == str: + elif isinstance(variable, str): self.myStudy.SetString(variableName, variable) def get(self, variableName): @@ -171,9 +174,8 @@ class NoteBook: pass def checkThisNoteBook(**kwargs): - study = PseudoStudyForNoteBook(**kwargs) - note_book = NoteBook(study) + note_book = NoteBook( False ) note_book.check() return -notebook = NoteBook(salome.myStudy) +notebook = NoteBook()