

def __add_to_history(self, project_name, history_type, filename, group, index):
    self.debug(('Adding %s file to project "%s" with group %s and index %s: %s' % (history_type, project_name, group, index, filename)))
    self.__ensure_project(project_name)
    self.__remove(project_name, filename)
    entry = {
        'filename': filename,
        'group': group,
        'index': index,
        'timestamp': int(time.time()),
    }
    self.history[project_name][history_type].insert(0, entry)
    max_num_entries = (self.GLOBAL_MAX_ENTRIES if (project_name == 'global') else self.PROJECT_MAX_ENTRIES)
    self.history[project_name][history_type] = self.history[project_name][history_type][0:max_num_entries]

dataset/ETHPy150Open FichteFoll/FileHistory/file_history.py FileHistory.__add_to_history/original