/usr/share/pyshared/mayavi/tests/common.py is in mayavi2 4.1.0-1.
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 23 24 25 | """
Common code for mayavi tests.
"""
# Author: Prabhu Ramachandran <prabhu@aero.iitb.ac.in>
# Copyright (c) 2008, Enthought, Inc.
# License: BSD Style.
import os.path
from traits.api import HasTraits, Any, Event, Callable
def fixpath(filename):
"""Given a relative file path it sets the path relative to this
directory. This allows us to run the tests from other directories
as well.
"""
return os.path.join(os.path.dirname(__file__), filename)
def get_example_data(fname):
"""Given a relative path to data inside the examples directory,
obtains the full path to the file.
"""
p = os.path.join('data', fname)
return os.path.abspath(fixpath(p))
|