So I’m running some code in my addon which has a seriously long wait time. I want to have a progress bar come up that shows that the operation is running and progress is happening so I used the following code:
def generate_meanings() -> None:
ids = mw.col.find_notes("tag:i+1")
mw.progress.start(label="Updating Notes", max=len(ids), immediate=True).show()
for i, _id in enumerate(ids):
note = mw.col.getNote(_id)
if i % 500 == 0:
mw.progress.update(value=i)
if not note["Meaning"] and note["Focus"] and ("," not in note["Focus"]):
search_word = note["Focus"]
meaning_list = return_search(search_word)
for meaning in meaning_list:
note["Meaning"] += meaning + "<br>"
note.flush()
mw.progress.finish()
showInfo("All Meanings Added")
the progress bar opens but then it just goes not responding and the window itself doesn’t update. I’m super new to programming anki addons so no sure how to fix this