#NEWLINE# def get_folder_matches( text , delim_pos , dxproj , folderpath ) : #NEWLINE# #INDENT# '\n    :param text: String to be tab-completed; still in escaped form\n    :type text: string\n    :param delim_pos: index of last unescaped "/" in text\n    :type delim_pos: int\n    :param dxproj: DXProject handler to use\n    :type dxproj: DXProject\n    :param folderpath: Unescaped path in which to search for folder matches\n    :type folderpath: string\n    :returns: List of matches\n    :rtype: list of strings\n\n    Members of the returned list are guaranteed to start with *text*\n    and be in escaped form for consumption by the command-line.\n    ' #NEWLINE# try : #NEWLINE# #INDENT# folder_names = map ( ( lambda folder_name : folder_name [ ( folder_name . rfind ( '/' ) + 1 ) : ] ) , dxproj . list_folder ( folder = folderpath , only = 'folders' ) [ 'folders' ] ) #NEWLINE# if ( ( text != '' ) and ( delim_pos != ( len ( text ) - 1 ) ) ) : #NEWLINE# #INDENT# folder_names += [ '.' , '..' ] #NEWLINE# #UNINDENT# prefix = text [ : ( delim_pos + 1 ) ] #NEWLINE# return [ ( ( prefix + f ) + '/' ) for f in folder_names if ( ( prefix + f ) + '/' ) . startswith ( text ) ] #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# return [ ]