def update_cmd(self, format, cmd): item = self.ui.commandTree.currentItem() old_format = item.parent().text(0) old_cmd = item.text(0) if format == old_format and cmd != old_cmd: monitor.remove_command(str(format), str(old_cmd)) monitor.add_command(str(format), str(cmd)) elif format != old_format and cmd == old_cmd: monitor.remove_command(str(old_format), str(cmd)) monitor.add_command(str(format), str(cmd)) elif format != old_format and cmd != old_cmd: monitor.remove_command(str(old_format), str(old_cmd)) monitor.add_command(str(format), str(cmd)) self.__init_commands() print monitor.commands
def add_cmd(self, format, cmd): monitor.add_command(format, cmd) self.__init_commands()