code: def compute_state(self):
          
          data = {}
          data['directory'] = self._dir.path
          data['files'] = list(self._dir.files())
          data['subdirs'] = list(self._dir.subdirs())
          data['index'] = self.index()
          return data
docs: Generate the index.