[packaging/pip] Make binary utility tools functional

This commit is contained in:
tobi-wan-kenobi 2020-05-10 12:52:20 +02:00
parent 92577e7d26
commit c560c07890
5 changed files with 19 additions and 10 deletions

View file

@ -8,5 +8,16 @@ def discover():
)
sys.path.append(libdir)
def utility(name):
current_path = os.path.dirname(os.path.abspath(__file__))
for path in [
os.path.join(current_path, "..", "bin"),
os.path.join(current_path, "..", "..", "..", "..", "share", "bumblebee-status", "utility"),
"/usr/share/bumblebee-status/bin/",
]:
if os.path.exists(os.path.abspath(os.path.join(path, name))):
return os.path.abspath(os.path.join(path, name))
raise Exception("{} not found".format(name))
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4