code: def populate_table(self, scenario_directory):
          
          parsed_files = []
          unparsed_files = []
          self.table.clearContents()
  
          # Block signal to allow update checking only when the table is ready
          self.table.blockSignals(True)
          # NOTE(gigih): need this line to remove existing rows
          self.table.setRowCount(0)
  
          if not os.path.exists(scenario_directory):
              # LOGGER.info('Scenario directory does not exist: %s' % path)
              return
  
          # only support .py and .txt files
          for current_path in os.listdir(scenario_directory):
              extension = os.path.splitext(current_path)[1]
              absolute_path = os.path.join(scenario_directory, current_path)
  
              if extension == '.py':
                  append_row(self.table, current_path, absolute_path)
              elif extension == '.txt':
                  # insert scenarios from file into table widget
                  try:
                      scenarios = read_scenarios(absolute_path)
                      validate_scenario(scenarios, scenario_directory)
                      for key, value in list(scenarios.items()):
                          append_row(self.table, key, value)
                      parsed_files.append(current_path)
                  except Error:
                      unparsed_files.append(current_path)
  
          # unblock signal
          self.table.blockSignals(False)
docs: Populate table with files from scenario_directory directory.
  
          :param scenario_directory: Path where .txt & .py reside.
          :type scenario_directory: QString