There are a few more missing imports to get this to work. On the other hand, it may not be valuable enough to bother fixing.
This creates a new file called old_text_script.py with that huge class. Does this mean that I wrote this a second time when I wrote TextScript ?