#!/bin/bash
#
#    Project: The EDNA Kernel
#             http://www.edna-site.org
#
#    File: "$Id:$"
#
#    Copyright (C) 2008-2009 European Synchrotron Radiation Facility
#                            Grenoble, France
#
#    Principal authors: Marie-Francoise Incardona (incardon@esrf.fr)
#                       Olof Svensson (svensson@esrf.fr) 
#
#    This program 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 3 of the License, or
#    (at your option) any later version.
#
#    This program 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 General Public License
#    and the GNU Lesser General Public License  along with this program.  
#    If not, see <http://www.gnu.org/licenses/>.
#


if [ -z "${EDNA_HOME}" ] || [ -z "${EDNA_SITE}" ]; then
  echo ""
  echo "Cannot start the EDNA plugin launcher:"
  echo "Make sure that \$EDNA_HOME and \$EDNA_SITE are set up before running edna-plugin-launcher"
  echo "Example:"
  echo "\$ export EDNA_HOME=/<path>/<to>/edna"
  echo "\$ export EDNA_SITE=<SUFFIX> (should be the configuration file suffix XSConfiguration_<SUFFIX>.xml)"
  echo "Please read the INSTALL.txt file under the \"\$EDNA_HOME/kernel\" directory for more details"
  echo ""
  exit 1
fi

# Set up the PYTHONPATH
export PYTHONPATH=${EDNA_HOME}/libraries/20090518-PyAALib-JyAALib-111/modules:${EDNA_HOME}/kernel/src

# Execute the EDApplication
python ${EDNA_HOME}/kernel/src/EDApplicationMain.py --verbose $*
 