I haven't had a chance to look at those errors yet. I just updated all my PCs to Windows 8--when I upgrade, I launch nukes at hard drives and start over
. I'll create a pull request for you to look over when I do that (hopefully later tonight). I think there's some class relationship between IndexError and KeyError, so we really ought to be able to get away with just catching one of them. A debug print is a good idea as well.
I did however manage to finish looking over your first commit. It was a doozy to read because of all of the whitespace changes, but they were necessary, so that's fine. I expect to be able to finish the next two more quickly. I noticed a few problems that I think we'll want to address moving forward. I think the most major (to me) is the code-breaking up and license block changes introduced by attempting to make the code fit in 79 columns. I know I've said it before, but Uru's code really lends itself to long lines. I usually set my guide markers to 100 columns and try not to go too far past that. In my experience, pep8 checkers tend to explode on things that really don't matter or are so old they don't take into account new features, such as sets.
A few other things:
- I would prefer the license block not be changed by anyone except Cyan
- I would prefer to see code on one line, rather than broken up over many.
- I have a stylistic preference for no parens in single condition if/elif statements.
- In a few places, you're testing isinstance(foo, type(bar)), this should really be isinstance(foo, bar). The two offenders I remember are bar == None and bar == "".
- You've changed docstrings (the multiline strings at the beginning of function bodies) into comments. We should leave those as docstrings
- There are a few places where the code was testing if some variable is equal to a bunch of strings individually. It would be better and faster to test membership in a frozenset (a frozenset is just a set not assigned to any name).
- Instead of converting print statements to the print_function, I would prefer to use PtDebugPrint. One day, we might decide to implement that function engine side so the in game python log can be colorized
- You went through the effort of fixing commented out code. That's really awesome, but we are using version control. You may delete all the commented out cruft you come across.
I know it's a pain that I'm asking you to revisit a lot of what you've done. I really do appreciate that you're taking the time to make this mess a lot less messy
EDIT: and done reading the entire PR!