X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=wizard%2Fbertos_utils.py;h=204c4fe4ea1e602f9f61ecbaf5756451dee36b88;hb=402c25d02455aa20dfd97dbe5199e714bec6ff9b;hp=f0d5494469e33955d203ba5d937a1c87bbfbe201;hpb=d5cf56393162822e6e1be0c5b1b9a125b8f7931d;p=bertos.git diff --git a/wizard/bertos_utils.py b/wizard/bertos_utils.py index f0d54944..204c4fe4 100644 --- a/wizard/bertos_utils.py +++ b/wizard/bertos_utils.py @@ -340,12 +340,17 @@ def replaceSeparators(path): def getSystemPath(): path = os.environ["PATH"] - if os.name == "nt": - path = path.split(";") - else: - path = path.split(":") + path = path.split(os.pathsep) return path +def findInPath(file, path=None): + if path is None: + path = os.environ.get('PATH', '') + if type(path) is type(''): + path = path.split(os.pathsep) + return filter(os.path.exists, map(lambda dir, file=file: os.path.join(dir, file), path)) + + def findToolchains(path_list): toolchains = [] for element in path_list: