From b87a6c3f3ba90b4b70b967ad08f7bf630118b661 Mon Sep 17 00:00:00 2001 From: vsr Date: Mon, 12 Aug 2013 09:34:06 +0000 Subject: [PATCH] Merge from V7_2_BR 09/08/2013 --- src/GEOM_PY/geomtools.py | 7 ++++++- src/GEOM_PY/sketcher.py | 16 ++++++++++------ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/GEOM_PY/geomtools.py b/src/GEOM_PY/geomtools.py index 4f9a01044..67fb7bdd5 100644 --- a/src/GEOM_PY/geomtools.py +++ b/src/GEOM_PY/geomtools.py @@ -32,8 +32,13 @@ logger = Logger("salome.geom.geomtools", color = termcolor.RED) from salome.kernel.studyedit import getActiveStudyId, getStudyEditor from salome.kernel.services import IDToObject, IDToSObject +from salome.kernel.deprecation import is_called_by_sphinx + try: - from salome.gui import helper as guihelper + if not is_called_by_sphinx(): + from salome.gui import helper as guihelper + pass + pass except: pass diff --git a/src/GEOM_PY/sketcher.py b/src/GEOM_PY/sketcher.py index 7a20387ec..cc6404bd8 100644 --- a/src/GEOM_PY/sketcher.py +++ b/src/GEOM_PY/sketcher.py @@ -47,14 +47,18 @@ Additionnal examples can be found as unit tests in the source code. geompyEnable = True try: - import salome - salome.salome_init() - import GEOM - from salome.geom import geomBuilder - geompy = geomBuilder.New(salome.myStudy) + from salome.kernel.deprecation import is_called_by_sphinx + if not is_called_by_sphinx(): + import salome + salome.salome_init() + import GEOM + from salome.geom import geomBuilder + geompy = geomBuilder.New(salome.myStudy) + pass + pass except: geompyEnable = False - + pass class Sketcher: -- 2.39.2