From 83ddbcef4c85e399636900a5d38e3ec0620e0afd Mon Sep 17 00:00:00 2001 From: Dennis Klein Date: Fri, 2 Sep 2022 20:26:21 +0200 Subject: [PATCH] build(metaUpdater): Keep original ordering when adding new entries --- meta_update.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta_update.py b/meta_update.py index f38dea4b..c7e49c48 100755 --- a/meta_update.py +++ b/meta_update.py @@ -39,7 +39,7 @@ class Manipulator(object): def _handle_person_list_file(self, filename, field_name, **kwargs): fp = open(filename, 'r', encoding='utf8') person_list = self.data.setdefault(field_name, []) - for line in fp: + for i, line in enumerate(fp, start=0): line = line.strip() m = self.findregex.match(line) if m is None: @@ -48,7 +48,7 @@ class Manipulator(object): entry = self.update_person_entry(found_entry, m.groupdict(), **kwargs) if found_entry is None: - person_list.append(entry) + person_list.insert(i, entry) class CodeMetaManipulator(Manipulator):