/usr/lib/python/astrometry/util/addpath.py is in astrometry.net 0.46-0ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | import sys
import os
def addpath():
try:
import astrometry
from astrometry.util.shell import shell_escape
from astrometry.util.filetype import filetype_short
except ImportError:
me = __file__
path = os.path.realpath(me)
utildir = os.path.dirname(path)
assert(os.path.basename(utildir) == 'util')
andir = os.path.dirname(utildir)
if os.path.basename(andir) == 'astrometry':
rootdir = os.path.dirname(andir)
sys.path.insert(1, andir)
else:
# assume there's a symlink astrometry -> .
rootdir = andir
#sys.path += [rootdir]
sys.path.insert(1, rootdir)
|