From: Ovidiu Mircescu Date: Thu, 3 Oct 2019 12:11:04 +0000 (+0200) Subject: Find the resources catalog in mode without salome session. X-Git-Tag: V9_4_0rc1~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2794f597324373dda3d1c30d1a4661787dfd69ba;p=tools%2Fydefx.git Find the resources catalog in mode without salome session. --- diff --git a/src/pydefx/pyscript.py b/src/pydefx/pyscript.py index a302913..4053c90 100644 --- a/src/pydefx/pyscript.py +++ b/src/pydefx/pyscript.py @@ -89,7 +89,7 @@ class PyScript: error_string = "" if len(self.errors) > 0: error_string = "global errors:\n" - error_string += '\n'.join(errors) + error_string += '\n'.join(self.errors) else: properties = self.getFunctionProperties(fname) if properties is None: diff --git a/src/pydefx/salome_proxy.py b/src/pydefx/salome_proxy.py index bb1155b..9067760 100644 --- a/src/pydefx/salome_proxy.py +++ b/src/pydefx/salome_proxy.py @@ -42,6 +42,11 @@ def getResourcesManager(): _resourceManager = salome.lcc.getResourcesManager() else: catalog_path = os.environ.get("USER_CATALOG_RESOURCES_FILE", "") + if not os.path.isfile(catalog_path): + salome_path = os.environ.get("ROOT_SALOME_INSTALL", "") + catalog_path = os.path.join(salome_path, "CatalogResources.xml") + if not os.path.isfile(catalog_path): + catalog_path = "" _resourceManager = pylauncher.ResourcesManager_cpp(catalog_path) return _resourceManager