예제 #1
0
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
예제 #2
0
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
예제 #3
0
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))
예제 #4
0
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))
예제 #5
0
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())