2020-05-09 21:22:00 +02:00
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
|
|
|
|
|
|
|
|
def discover():
|
2020-05-09 21:24:28 +02:00
|
|
|
libdir = os.path.abspath(
|
|
|
|
os.path.join(os.path.dirname(__file__), "..", "bumblebee_status")
|
|
|
|
)
|
2020-05-09 21:22:00 +02:00
|
|
|
sys.path.append(libdir)
|
|
|
|
|
2020-05-10 13:25:13 +02:00
|
|
|
|
2020-05-10 12:52:20 +02:00
|
|
|
def utility(name):
|
|
|
|
current_path = os.path.dirname(os.path.abspath(__file__))
|
|
|
|
|
|
|
|
for path in [
|
|
|
|
os.path.join(current_path, "..", "bin"),
|
2020-05-10 13:25:13 +02:00
|
|
|
os.path.join(
|
|
|
|
current_path, "..", "..", "..", "..", "share", "bumblebee-status", "utility"
|
|
|
|
),
|
2020-05-10 12:52:20 +02:00
|
|
|
"/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))
|
2020-05-09 21:24:28 +02:00
|
|
|
|
2020-05-10 13:25:13 +02:00
|
|
|
|
2020-05-09 21:22:00 +02:00
|
|
|
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
|