#! /bin/sh

# Launch the Python-Tkinter Pathena client

# Home directory for Pathena files is changed in this script
# by invoking script 'build/relocate'.

export PATHENA=~/.pathena

if [ -e $PATHENA/config/definitions ];
    then DEFS=config ;
    else DEFS=bin ;
fi
source $PATHENA/$DEFS/definitions

export PYTHONPATH=$PATHENA/lib:$PATHENA/types

echo "
The Pathena client has been started.
Its window should appear in a few seconds.
"

spawn_stderr=$PATHENA/log/spawn_stderr

# The client logs its own stderr but here we collect errors that
# issue from processes spawned by the client.

echo -e "\n================================\n
Starting Pathena client session on $(date).\n" >> $spawn_stderr

$PYTHONBIN -u $PATHENA/pytk_client/pathena.py 2>> $spawn_stderr &
