30 lines
686 B
Plaintext
30 lines
686 B
Plaintext
|
#!/bin/bash
|
||
|
# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8
|
||
|
|
||
|
scriptdir="$(dirname "$0")"
|
||
|
source "./python_interpreters"
|
||
|
eval "$("$scriptdir/spp" -P)"
|
||
|
|
||
|
pythonver=python
|
||
|
args=()
|
||
|
if [ "$1" == "-v" ]; then
|
||
|
args=("${args[@]}" -v)
|
||
|
shift
|
||
|
elif [[ "$1" =~ -[0-9]+ ]]; then
|
||
|
pythonver="python${1#-}"
|
||
|
shift
|
||
|
fi
|
||
|
pythonver="${!pythonver}"
|
||
|
if [ -z "$pythonver" ]; then
|
||
|
echo "Impossible de trouver la version de python"
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
# initialiser la liste par défaut des modules si l'utilisateur ne donne pas de
|
||
|
# module à tester
|
||
|
[ -n "$*" ] || set ulib.base.config
|
||
|
for module in "$@"; do
|
||
|
echo ">>> $1"
|
||
|
exec "$pythonver" -m "$1" "${args[@]}"
|
||
|
done
|