-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7c6ae39
commit 49f40c4
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import os | ||
|
||
library_names = ("cairo-2.dll", "cairo.dll", "libcairo-2.dll") | ||
filenames = ("libcairo.so.2", "libcairo.2.dylib", "libcairo-2.dll") | ||
found_path = "" | ||
|
||
for name in library_names: | ||
for path in os.environ['PATH'].split(os.pathsep): | ||
resolved_path = os.path.join(path, name) | ||
print(resolved_path) | ||
if os.path.exists(resolved_path): | ||
filenames = (resolved_path, ) + filenames | ||
found_path = resolved_path | ||
break | ||
if found_path: | ||
break | ||
else: | ||
found_path = "not found" | ||
|
||
print(f"The path is {found_path}") | ||
print("List of files that FFI will try to load:") | ||
for filename in filenames: | ||
print("-", filename) |