(self, pathmask)
return (
            [t.ljust(8) + (b'.' if e or not t else b' ') + e.ljust(3) + b'<DIR>' for t, e in dirs] +
            [t.ljust(8) + (b'.' if e or not t else b' ') + e.ljust(3) + b'     ' for t, e in fils]
        )
Get directory listing.
Get directory listing.
Get directory listing .
def listdir(self, pathmask):
        """Get directory listing."""
        native_path, _, dos_mask = self._split_pathmask(pathmask)
        fils = []
        if dos_mask in (b'.', b'..'):
            # following GW, we just show a single dot if asked for either . or ..
            dirs = [(b'', b'')]
        else:
            dirs, fils = self._get_dirs_files(native_path)
            # remove hidden files
            dirs = [d for d in dirs if not is_hidden(os.path.join(native_path, d))]
            fils = [f for f in fils if not is_hidden(os.path.join(native_path, f))]
            # filter according to mask
            dirs = self._filter_names(native_path, dirs + [u'.', u'..'], dos_mask)
            fils = self._filter_names(native_path, fils, dos_mask)
        # format contents
        return (
            [t.ljust(8) + (b'.' if e or not t else b' ') + e.ljust(3) + b'<DIR>' for t, e in dirs] +
            [t.ljust(8) + (b'.' if e or not t else b' ') + e.ljust(3) + b'     ' for t, e in fils]
        )
def listdir ( self , pathmask ) : native_path , _ , dos_mask = self . _split_pathmask ( pathmask ) fils = [ ] if dos_mask in ( b'.' , b'..' ) : # following GW, we just show a single dot if asked for either . or .. dirs = [ ( b'' , b'' ) ] else : dirs , fils = self . _get_dirs_files ( native_path ) # remove hidden files dirs = [ d for d in dirs if not is_hidden ( os . path . join ( native_path , d ) ) ] fils = [ f for f in fils if not is_hidden ( os . path . join ( native_path , f ) ) ] # filter according to mask dirs = self . _filter_names ( native_path , dirs + [ u'.' , u'..' ] , dos_mask ) fils = self . _filter_names ( native_path , fils , dos_mask ) # format contents return ( [ t . ljust ( 8 ) + ( b'.' if e or not t else b' ' ) + e . ljust ( 3 ) + b'<DIR>' for t , e in dirs ] + [ t . ljust ( 8 ) + ( b'.' if e or not t else b' ' ) + e . ljust ( 3 ) + b'     ' for t , e in fils ] )