1
0
mirror of https://github.com/gryf/fs-uae-wrapper.git synced 2025-12-18 20:10:26 +01:00
Files
fs-uae-wrapper/fs_uae_wrapper/path.py

23 lines
518 B
Python

"""
Misc utilities
"""
import os
def which(executables):
"""
Check if there selected archiver is available in the system and place it
to the archiver attribute
"""
if not isinstance(executables, list):
executables = [executables]
for fname in executables:
for path in os.environ["PATH"].split(os.pathsep):
path = os.path.join(path.strip('"'), fname)
if os.path.isfile(path) and os.access(path, os.X_OK):
return fname
return None