From 13be0527517184f1452d7a902dda0afc463a1eba Mon Sep 17 00:00:00 2001 From: rnc Date: Wed, 22 May 2013 13:10:29 +0000 Subject: [PATCH] Integration of a patch from Renaud Barate which fixes some issues at install step due to sphinx importing some python packages when building th documentation. --- src/GEOM_PY/geomtools.py | 6 ++---- src/GEOM_PY/sketcher.py | 7 ++----- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/GEOM_PY/geomtools.py b/src/GEOM_PY/geomtools.py index 4f9a01044..0f04c80f1 100644 --- a/src/GEOM_PY/geomtools.py +++ b/src/GEOM_PY/geomtools.py @@ -22,7 +22,6 @@ This module provides tools to facilitate the use of geom engine and geom objects in Salome. """ - import salome GEOM = None # GEOM module is loaded only when needed @@ -32,10 +31,9 @@ logger = Logger("salome.geom.geomtools", color = termcolor.RED) from salome.kernel.studyedit import getActiveStudyId, getStudyEditor from salome.kernel.services import IDToObject, IDToSObject -try: +from salome.kernel.deprecation import is_called_by_sphinx +if not is_called_by_sphinx(): from salome.gui import helper as guihelper -except: - pass _geompys = {} diff --git a/src/GEOM_PY/sketcher.py b/src/GEOM_PY/sketcher.py index 7a20387ec..c85c4ea09 100644 --- a/src/GEOM_PY/sketcher.py +++ b/src/GEOM_PY/sketcher.py @@ -44,17 +44,14 @@ Example:: Additionnal examples can be found as unit tests in the source code. """ - +from salome.kernel.deprecation import is_called_by_sphinx geompyEnable = True -try: +if not is_called_by_sphinx(): import salome salome.salome_init() import GEOM from salome.geom import geomBuilder geompy = geomBuilder.New(salome.myStudy) -except: - geompyEnable = False - class Sketcher: -- 2.39.2