trepan/clifns.py
def whence_file(py_script, dirnames=None):
    """Do a shell-like path lookup for py_script and return the results.
    If we can't find anything return py_script"""
    if py_script.find(os.sep) != -1:
        # Don't search since this name has path separator components
        return py_script
    if dirnames is None:
        dirnames = os.environ['PATH'].split(os.pathsep)
    for dirname in dirnames:
        py_script_try = osp.join(dirname, py_script)
        if osp.exists(py_script_try):
            return py_script_try
    # Failure
    return py_script
def whence_file(py_script, dirnames=None):
    if py_script.find(os.sep) != -1:
        # Don't search since this name has path separator components
        return py_script
    if dirnames is None:
        dirnames = os.environ['PATH'].split(os.pathsep)
    for dirname in dirnames:
        py_script_try = osp.join(dirname, py_script)
        if osp.exists(py_script_try):
            return py_script_try
    # Failure
    return py_script
def whence_file ( py_script , dirnames = None ) : if py_script . find ( os . sep ) != - 1 : # Don't search since this name has path separator components return py_script if dirnames is None : dirnames = os . environ [ 'PATH' ] . split ( os . pathsep ) for dirname in dirnames : py_script_try = osp . join ( dirname , py_script ) if osp . exists ( py_script_try ) : return py_script_try # Failure return py_script
Do a shell-like path lookup for py_script and return the results.
    If we can't find anything return py_script
Do a shell - like path lookup for py_script and return the results . If we can t find anything return py_script