Tuesday, August 15, 2006

Stupid indenting

I was trying to get a CEGUI program running, and Python kept telling me that it could't find my quitApp function. Hours and too many experiments later, I figured out that I was indenting my function wrong.
Instead of

def quitApp(args):
self.keepRendering = False
system = cegui.System.getSingleton()
system.injectKeyDown(evt.key)
system.injectChar(evt.keyChar)
evt.consume()
I wrote:

 def quitApp(args):
self.keepRendering = False
system = cegui.System.getSingleton()
system.injectKeyDown(evt.key)
system.injectChar(evt.keyChar)
evt.consume()


That has to be one of the dumbest errors of all time (yes, believe it or not, there is a difference in Python).

No comments: