#!/bin/bash
#
# Postflight script: 
# Compile and optimize all python files of gnue
#

PYTHON=python
# python2.4+ has no site.here anymore
SITE=`$PYTHON -c "import site, os.path; print os.path.dirname(site.__file__)"`
COMPILE="$SITE/compileall.py"
SITELIB="$SITE/site-packages/gnue/forms"

if which $PYTHON >/dev/null 2>&1 && [ -e "$COMPILE" ];
then
  for i in $SITELIB ; do
    $PYTHON -O $COMPILE -q -f $i
    $PYTHON $COMPILE -q -f $i
  done
fi
