From: vsr Date: Wed, 14 Oct 2020 16:06:18 +0000 (+0300) Subject: Fix for some platforms where libs are installed to lib64 folder X-Git-Tag: V9_6_0b1^0 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7f248b3f788061c9d96c40335838750089b35c74;p=modules%2Fgui.git Fix for some platforms where libs are installed to lib64 folder --- diff --git a/src/PVServerService/ENGINE/PVSERVER_impl.py b/src/PVServerService/ENGINE/PVSERVER_impl.py index 77be24200..252afdc29 100644 --- a/src/PVServerService/ENGINE/PVSERVER_impl.py +++ b/src/PVServerService/ENGINE/PVSERVER_impl.py @@ -51,19 +51,21 @@ class PVSERVER_impl(object): # deduce dynamically PARAVIEW_ROOT_DIR from the paraview module location self.PARAVIEW_ROOT_DIR = None if sys.platform == "win32": - ZE_KEY_TO_FIND_PV_ROOT_DIR="Lib" + ZE_KEY_TO_FIND_PV_ROOT_DIR=["Lib"] upCount =2 else: - ZE_KEY_TO_FIND_PV_ROOT_DIR="lib" + ZE_KEY_TO_FIND_PV_ROOT_DIR=["lib", "lib64"] upCount =1 tmp = os.path.sep.join(tmp.split('/')) li=tmp.split(os.path.sep) ; li.reverse() - if ZE_KEY_TO_FIND_PV_ROOT_DIR not in li: - raise SALOME_Exception(ExceptionStruct(INTERNAL_ERROR, - "PVSERVER_Impl.__init__ : error during dynamic deduction of PARAVIEW_ROOT_DIR : Loc of paraview module is \"%s\" ! \"%s\" is supposed to be the key to deduce it !"%(tmp,ZE_KEY_TO_FIND_PV_ROOT_DIR), - "PVSERVER.py", 0)) - li=li[li.index(ZE_KEY_TO_FIND_PV_ROOT_DIR)+upCount:] ; li.reverse() - self.PARAVIEW_ROOT_DIR = os.path.sep.join(li) + for key_to_find in ZE_KEY_TO_FIND_PV_ROOT_DIR: + if key_to_find in li: + li=li[li.index(key_to_find)+upCount:] ; li.reverse() + self.PARAVIEW_ROOT_DIR = os.path.sep.join(li) + return + raise SALOME_Exception(ExceptionStruct(INTERNAL_ERROR, + "PVSERVER_Impl.__init__ : error during dynamic deduction of PARAVIEW_ROOT_DIR : Loc of paraview module is \"%s\" ! \"%s\" is supposed to be the key to deduce it !"%(tmp," or ".join(ZE_KEY_TO_FIND_PV_ROOT_DIR)), + "PVSERVER.py", 0)) """ Private. Identify a free port to launch the PVServer.