#
# Author: Anthony Geay, anthony.geay@edf.fr, EDF R&D
-set(EFICAS_DIR "${EFICAS_ROOT_DIR}")
-set(PYTHON_SITE "${CMAKE_INSTALL_PREFIX}/${ADAO_SCRIPT_PYTHON}")
-SALOME_CONFIGURE_FILE(qtEficas_adao_study.py.in qtEficas_adao_study.py)
-
-install(FILES AdaoYacsSchemaCreator.py ${CMAKE_CURRENT_BINARY_DIR}/qtEficas_adao_study.py DESTINATION ${ADAO_BIN})
+install(
+ FILES AdaoYacsSchemaCreator.py
+ DESTINATION ${ADAO_BIN}
+)
+install(
+ FILES gui_Adao_QT_Eficas.py
+ PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ
+ DESTINATION ${ADAO_BIN}
+)
INSTALL( CODE "MACRO(GENERATE_EFICAS_CATA_FOR_ADAO PY_EXE_CATA ADAO_CATA_GEN_FILE OUTPUT_DIR CATA_ADD_PYTHONPATH)
set(ENV{PYTHONPATH} \${CATA_ADD_PYTHONPATH}:\$ENV{PYTHONPATH})
include $(top_srcdir)/adm_local/make_common_starter.am
-bin_SCRIPTS = AdaoYacsSchemaCreator.py qtEficas_adao_study.py # AdaoCatalogGenerator.py module_version.py
+bin_SCRIPTS = AdaoYacsSchemaCreator.py gui_Adao_QT_Eficas.py # AdaoCatalogGenerator.py module_version.py
-EXTRA_DIST = AdaoYacsSchemaCreator.py qtEficas_adao_study.py.in # AdaoCatalogGenerator.py module_version.py
+EXTRA_DIST = AdaoYacsSchemaCreator.py gui_Adao_QT_Eficas.py # AdaoCatalogGenerator.py module_version.py
ADAODIR = $(DESTDIR)$(salomepythondir)/adao
install-data-hook:
@export PYTHONPATH="$(DESTDIR)${salomepythondir}:${PYTHONPATH}" && python${PYTHON_VERSION} $(top_srcdir)/bin/AdaoCatalogGenerator.py $(ADAODIR)/daEficas ADAO_Cata_V0.py
+ @chmod 755 $(top_srcdir)/bin/gui_Adao_QT_Eficas.py
uninstall-hook:
@rm $(ADAODIR)/daEficas/ADAO_Cata_V0.py
--- /dev/null
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+#
+# Copyright (C) 2008-2019 EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+# Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D
+
+"""
+ Launching the standalone EFICAS/ADAO interface
+"""
+
+import os, sys
+
+# ==============================================================================
+# Chemin pour l'installation (ordre important)
+if "EFICAS_ROOT" in os.environ:
+ EFICAS_ROOT = os.environ["EFICAS_ROOT"]
+ __path_ok = True
+else:
+ print("\nKeyError:\n"+\
+ " the required environment variable EFICAS_ROOT is unknown.\n"+\
+ " You have either to be in SALOME environment, or to set this\n"+\
+ " variable in your environment to the right path \"<...>\" to find\n"+\
+ " an installed EFICAS application. For example:\n"+\
+ " EFICAS_ROOT=\"<...>\" %s"%__file__
+ )
+ __path_ok = False
+try:
+ import adao
+ __path_ok = True
+except ImportError:
+ print("\nImportError:\n"+\
+ " the required ADAO library can not be found to be imported.\n"+\
+ " You have either to be in ADAO environment, or to be in SALOME\n"+\
+ " environment, or to set manually in your Python 3 environment the\n"+\
+ " right path \"<...>\" to find an installed ADAO application. For\n"+\
+ " example:\n"+\
+ " PYTHONPATH=\"<...>:${PYTHONPATH}\" %s"%__file__
+ )
+ __path_ok = False
+try:
+ import PyQt5
+ __path_ok = True
+except ImportError:
+ print("\nImportError:\n"+\
+ " the required PyQt5 library can not be found to be imported.\n"+\
+ " You have either to have a raisonable up-to-date Python 3\n"+\
+ " installation (less than 5 years), or to be in SALOME environment."
+ )
+ __path_ok = False
+if not __path_ok:
+ print("\nWarning:\n"+\
+ " It seems you have some troubles with your installation. It may\n"+\
+ " exists other errors than are not explained as above, like some\n"+\
+ " incomplete or obsolete Python 3 and module installation.\n"+\
+ " \n"+\
+ " Please correct the above error(s) before launching the\n"+\
+ " standalone EFICAS/ADAO interface \"%s\"\n"%__file__
+ )
+ sys.exit(2)
+else:
+ print("Launching the standalone EFICAS/ADAO interface...")
+sys.path.insert(0,EFICAS_ROOT)
+sys.path.insert(0,os.path.join(adao.adao_py_dir,"daEficas"))
+
+# ==============================================================================
+# Préférences et module EFICAS
+from daEficas import prefs
+from InterfaceQT4 import eficas_go
+
+eficas_go.lanceEficas(code=prefs.code)
+# ==============================================================================
+++ /dev/null
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-# Copyright (C) 2008-2019 EDF R&D
-#
-# This file is part of SALOME ADAO module
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-# Author: André Ribes, andre.ribes@edf.fr, EDF R&D
-
-"""
- Ce module sert a lancer EFICAS pour Adao
-"""
-
-import sys
-# Configuration de l'installation
-INSTALLDIR = "@EFICAS_DIR@"
-sys.path.insert(0,INSTALLDIR)
-ADAO_INSTALL_DIR = "@PYTHON_SITE@/adao/daEficas"
-sys.path.insert(0,ADAO_INSTALL_DIR)
-
-# Configuration
-import prefs
-import prefs_ADAO
-
-# Modules Eficas
-from InterfaceQT4 import eficas_go
-eficas_go.lance_eficas(code=prefs.code)