def _doit(self, command): # rename to mention "command"? name, args = parse_command(command) if not name: return # note: we don't use dispatch_event for model commands -- for one thing, # it discards their return value (after using it for its own purposes). retval = getattr(self.model, name)(*args) ### REFACTOR, should be self.model.do_command or so assert retval # wrong in general, good for now ### return retval