It might be the index approach that does not work in Python, in this line:
text_styles[style]
Maybe there is a GetTextStyle() method as replacement?
It might be the index approach that does not work in Python, in this line:
text_styles[style]
Maybe there is a GetTextStyle() method as replacement?