| 1 |
from ._cairo import * |
| 2 |
|
| 3 |
|
| 4 |
def get_include(): |
| 5 |
"""Returns a path to the directory containing the C header files""" |
| 6 |
|
| 7 |
import os |
| 8 |
|
| 9 |
def is_ok(path): |
| 10 |
return os.path.exists(path) and os.path.isdir(path) |
| 11 |
|
| 12 |
package_path = os.path.dirname(os.path.realpath(__file__)) |
| 13 |
install_path = os.path.join(package_path, "include") |
| 14 |
|
| 15 |
|
| 16 |
if is_ok(install_path): |
| 17 |
return install_path |
| 18 |
|
| 19 |
|
| 20 |
if is_ok(package_path): |
| 21 |
return package_path |
| 22 |
|
| 23 |
|
| 24 |
import pkg_resources |
| 25 |
return pkg_resources.resource_filename(__name__, "include") |