#!/bin/sh
# translate -*-sh-*-

if [ $# -lt 1 ]
then
  PYTHONDIR=.
else
  PYTHONDIR="$1"
  shift
fi
if [ ! -d "$PYTHONDIR" ]
then
  echo "translate: $PYTHONDIR: not a directory" >&2
  exit 1
fi
if [ $# -lt 1 ]
then BINDIR=.
else BINDIR="$1"
fi
if [ ! -d "$BINDIR" ]
then
  echo "translate: $BINDIR: not a directory" >&2
  exit 1
fi
echo "py2tex $PYTHONDIR/py2tex.py"
py2tex -o py2tex.pt $PYTHONDIR/py2tex.py
echo "py2tex example.py"
py2tex -o example.pt example.py
echo "py2tex definitions.py"
py2tex -o definitions.pt definitions.py
echo "py2tex py2tex"
py2tex -n -o script.pt $BINDIR/py2tex
