#!/bin/bash


# # VACuum Control Application for ALBA
# # 
# # Usage:
# #    vaccagui [CONFIG] ; tries to open config file with absolute path or relative to the vacca module.
# # 
# # With no argument the file default.py or TANGO_HOST.py will be launched as config
# # 
# # The VACCA_PATH environment variable should be used to set the path to vacca modules
# # To use vacca widgets in other GUI's, both vacca and vaccagui modules must be in PYTHONPATH
# # 
# # NOTE: It's better to not modify this file to allow setup.py to work properly, 
# # to write your custom launcher better copy it to vaccagui.sh and continue editing there.
# # 
# # ----
# # 
# # The configuration variables:
# # 
# # * VACCA_PATH: folder of vacca module, to find data files relative to it.
# # 
# # * VACCA_CONFIG: the configuration file to be  loaded. If not defined then the default.py file will be used. When VACCA.VaccaConfigs is defined with multiple configs; then the first one will be used as default.
# # 
# # * VACCA_DIR: local folder with custom images and synoptics to be loaded by the configuration files. If not defined, the folder of the VACCA_CONFIG will be used.
# # 
# # 
# # 
# # S.Rubio-Manrique, srubio@cells.es, 2006-2015

#Source your own environment variables from here:
#source alba_blissrc

if [ ! "$VACCA_PATH" ] ; then
    #Getting current script folder
    export VACCA_PATH=$(python -c "import imp;print(imp.find_module('vacca')[1])")
fi

echo "Launching $VACCA_PATH/main.py [$*]"

LAUNCHER=$VACCA_PATH/main.py
python $LAUNCHER $* 
#3>&1 2>&1 1>/dev/null

