def selectTool(self, toolNumber):
        ''' pass a number outside the bounds to pick the selection tool'''
        if toolNumber >= len(self.tools) or toolNumber < 0:
            toolNumber = 0

        t = self.tools[toolNumber]
        if not t.toolEnabled():
            return
        if self.parent.currentTool == t:
            self.parent.currentTool.toolReselected()
            return
        else:
            self.parent.selectionTool.hidePanel()
            if self.parent.currentTool is not None:
                self.parent.currentTool.cancel()
                self.parent.currentTool.toolDeselected()
            self.parent.currentTool = t
            self.parent.currentTool.toolSelected()
            return
 pass a number outside the bounds to pick the selection tool
leveleditor.py