From 7f248b3f788061c9d96c40335838750089b35c74 Mon Sep 17 00:00:00 2001 From: vsr Date: Wed, 14 Oct 2020 19:06:18 +0300 Subject: [PATCH] Fix for some platforms where libs are installed to lib64 folder --- src/PVServerService/ENGINE/PVSERVER_impl.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) 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. -- 2.39.2