示例#1
0
文件: compute.py 项目: tek/chiasma-py
 def to_io(fa: 'TmuxIO[A]', tmux: Tmux) -> Do:
     result = yield IO.delay(fa.run, tmux)
     yield IO.from_either(result.to_either)
示例#2
0
def virtualenv_interpreter(venv: str, executable: str) -> Do:
    path_s = yield IO.from_either(env.get('PATH'))
    path = Lists.split(path_s, ':')
    clean_path = path.filter_not(lambda a: a.startswith(venv))
    candidate = yield IO.delay(shutil.which, executable, path=clean_path.mk_string(':'))
    return Path(candidate)