def complete_local_path(path): def get_suffix(p): if os.path.isdir(p): return '/' return '' path = expand_local_path(path) paths = [p + get_suffix(p) for p in glob.glob(path + '*')] return paths
def complete_local_path(path: str) -> List[str]: def get_suffix(p: str) -> str: if os.path.isdir(p): return '/' return '' path = expand_local_path(path) paths = [p + get_suffix(p) for p in glob.glob(path + '*')] return paths
def do_chdir(command): """ Usage: :chdir LOCAL_PATH Change the current directory of polysh (not the remote shells). """ try: os.chdir(expand_local_path(command.strip())) except OSError, e: console_output('%s\n' % str(e))
def do_chdir(command): """ Usage: :chdir LOCAL_PATH Change the current directory of polysh (not the remote shells). """ try: os.chdir(expand_local_path(command.strip())) except OSError, e: console_output('%s\n' % str(e))
def do_chdir(command: str) -> None: try: os.chdir(expand_local_path(command.strip())) except OSError as e: console_output('{}\n'.format(str(e)).encode())