def exec_cmd(self, str_cmd):
    cmd = self._get_command(str_cmd)
    if (cmd is not None):
        if (cmd.conn_required and (not (self._magic_blue and self._magic_blue.is_connected()))):
            logger.error('You must be connected to run this command')
        elif self._check_args(str_cmd, cmd):
            cmd.func(str_cmd.split()[1:])
    else:
        logger.error('"{}" is not a valid command.Type "help" to see what you can do'.format(str_cmd.split()[0]))
def exec_cmd(self, str_cmd):
    cmd = self._get_command(str_cmd)
    if (cmd is not None):
        if (cmd.conn_required and (not (self._magic_blue and self._magic_blue.is_connected()))):
            logger.error('You must be connected to run this command')
        elif self._check_args(str_cmd, cmd):
            cmd.func(str_cmd.split()[1:])
    else:
        logger.error('"{}" is not a valid command.Type "help" to see what you can do'.format(str_cmd.split()[0]))