From aee5025ba5c4b03976997c50564dc85edfa8a162 Mon Sep 17 00:00:00 2001 From: Kiril Kovachev Date: Fri, 1 Sep 2023 19:18:28 +0100 Subject: [PATCH] Add mechanism to update which entries have already been processed --- bulgarian-subject-object/bg-subject-object.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bulgarian-subject-object/bg-subject-object.py b/bulgarian-subject-object/bg-subject-object.py index 6bf338a..46c4955 100644 --- a/bulgarian-subject-object/bg-subject-object.py +++ b/bulgarian-subject-object/bg-subject-object.py @@ -15,6 +15,7 @@ def main() -> None: with open("words-to-edit.txt") as f: words_to_fix = f.read().splitlines() + i = 0 for page in kovachevbot.iterate_safe((kovachevbot.wikt_page(word) for word in words_to_fix)): page: pywikibot.Page title = page.title() @@ -30,6 +31,10 @@ def main() -> None: page.text = str(parsed) page.save("Convert sbjv/objv into sbj/obj in Bulgarian inflections") + i += 1 + + with open("words-to-edit.txt", mode="w") as f: + f.write("\n".join(words_to_fix[i:])) if __name__ == "__main__": main() \ No newline at end of file