diff --git a/pyproject.toml b/pyproject.toml index 99533c2..980dfd7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -91,4 +91,4 @@ Changelog = "https://github.com/openalea/visualea/releases" "visualea" = "openalea.visualea_wralea" [project.entry-points."gui_scripts"] -"visualea" = "openalea.visualea.visualea_script:start_gui" +"visualea" = "openalea.visualea.visualeagui:main" diff --git a/src/openalea/visualea/visualea_script.py b/src/openalea/visualea/visualea_script.py deleted file mode 100755 index 27b4775..0000000 --- a/src/openalea/visualea/visualea_script.py +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/python - -# -*- python -*- -# -# OpenAlea.Visualea: OpenAlea graphical user interface -# -# Copyright 2006-2009 INRIA - CIRAD - INRA -# -# File author(s): Samuel Dufour-Kowalski -# Christophe Pradal -# -# Distributed under the CeCILL v2 License. -# See accompanying file LICENSE.txt or copy at -# http://www.cecill.info/licences/Licence_CeCILL_V2-en.html -# -# OpenAlea WebSite : http://openalea.gforge.inria.fr -# -################################################################################ -from __future__ import print_function - -"""Wrapper to start Visualea with correct environment variables""" - -__license__ = "CeCILL v2" -__revision__ = " $Id$" - -import os, sys -from builtins import str - -def check_system_setuptools(): - """ - Check system configuration and return environment variables dictionary - This function need OpenAlea.Deploy - """ - from openalea.visualea.system_util import check_system - # from openalea.deploy import check_system - envv = dict(os.environ) - res = check_system() - envv.update(res) - - return envv - - - -def start_gui(): - """todo""" - try: - envdict = check_system_setuptools() - - except Exception as e: - envdict = os.environ - print(e) - - if sys.platform.lower().startswith('win'): - os.execle(sys.executable, sys.executable, "-c", - '"import sys; from openalea.visualea import visualeagui;sys.argv+='+str(sys.argv)+';visualeagui.main(sys.argv)"', - envdict) - else: - os.execle(sys.executable, sys.executable, "-c", - 'import sys; from openalea.visualea import visualeagui;sys.argv+='+str(sys.argv)+';visualeagui.main(sys.argv)', - envdict) - - - -if( __name__ == "__main__"): - start_gui() - diff --git a/src/openalea/visualea/visualeagui.py b/src/openalea/visualea/visualeagui.py index c12ea85..3ff1b11 100644 --- a/src/openalea/visualea/visualeagui.py +++ b/src/openalea/visualea/visualeagui.py @@ -94,8 +94,9 @@ def check_qt_version(): sys.exit(-1) -def main(args): +def main(): # Restore default signal handler for CTRL+C + args = sys.argv import signal signal.signal(signal.SIGINT, signal.SIG_DFL)