/usr/lib/python3/dist-packages/cairo/__init__.py is in python3-cairo 1.16.2-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 | from ._cairo import * # noqa: F401,F403
def get_include():
"""Returns a path to the directory containing the C header files"""
import os
def is_ok(path):
return os.path.exists(path) and os.path.isdir(path)
package_path = os.path.dirname(os.path.realpath(__file__))
install_path = os.path.join(package_path, "include")
# in case we are installed
if is_ok(install_path):
return install_path
# in case we are running from source
if is_ok(package_path):
return package_path
# in case we are in an .egg
import pkg_resources
return pkg_resources.resource_filename(__name__, "include")
|