1
0
mirror of https://github.com/gryf/e-uae-wrapper.git synced 2026-02-07 17:45:45 +01:00

Ported file archiver from fs-uae-wrapper

This commit is contained in:
2018-02-15 18:14:53 +01:00
parent 781cd404a7
commit 8827f45bdd
2 changed files with 216 additions and 0 deletions

22
e_uae_wrapper/path.py Normal file
View File

@@ -0,0 +1,22 @@
"""
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