Undo the last action.

def undo(self):
        ''' Undo the last action. '''
        if self.canundo():
            undoable = self._undos.pop()
            with self._pausereceiver():
                try:
                    undoable.undo()
                except:
                    self.clear()
                    raise
                else:
                    self._redos.append(undoable)
            self.undocallback()