X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=wizard%2Fbertos_utils.py;h=204c4fe4ea1e602f9f61ecbaf5756451dee36b88;hb=00b4afda1825471f9f536a638282f8efb610f739;hp=f0d5494469e33955d203ba5d937a1c87bbfbe201;hpb=b138078dcb2e14942de7489e84647bfd28aefd86;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: