def fill_cache(self, pty): """ Fill cache for current directory. """ console = Console(pty) with console.progress_bar('Reading directory...', clear_on_finish=True): cwd = self.getcwd() for s in self.listdir_stat(): self._stat_cache[(cwd, s.filename)] = s