File: wrapper

package info (click to toggle)
pychecker 0.8.17-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,856 kB
  • ctags: 1,896
  • sloc: python: 9,301; sh: 131; makefile: 44
file content (32 lines) | stat: -rw-r--r-- 1,134 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/sh

# We need to execute checker.py rather than simply importing it.  However,
# since pychecker is not a private package, we don't know exactly where it will
# be located.  So, we run a little Python script first to find the correct
# location, and then execute it from there.
#
# Expect CHECKER_PATH to be something like:
#
#    /var/lib/python-support/pythonX.Y/pychecker/checker.py
#
# Its actual location will depend on how update-python-modules is implemented.
#
# This script also supports the use of $PYTHONVER as a way to select which
# version of Python will be used to execute pychecker. This will only work for
# versions of Python supported by python-support, but it's better than nothing.

PYTHON="/usr/bin/python${PYTHONVER}"
CHECKER_PATH=`${PYTHON} -c "from imp import find_module; print find_module('pychecker/checker')[1]"`

if [ ! -n "${CHECKER_PATH}" ]; then
   echo "Unable to find checker.py on Python's module path."
   exit 1 
fi

if [ ! -f "${CHECKER_PATH}" ]; then
   echo "Found checker.py as [${CHECKER_PATH}], but it does not seem to exist."
   exit 1 
fi

exec "${PYTHON}" "${CHECKER_PATH}" "$@"