def set_group(agent_id, group_id, quiet=False): ans = 'n' if not quiet: ans = get_stdin("Do you want to set the group '{0}' to the agent '{1}'? [y/N]: ".format(group_id, agent_id)) else: ans = 'y' if ans.lower() == 'y': msg = Agent.set_group(agent_id, group_id) else: msg = "Cancelled." print(msg)
def set_group(agent_id, group_id, quiet=False, replace=False): ans = 'n' agent_id = "{}".format(int(agent_id)).zfill(3) if not quiet: ans = get_stdin( "Do you want to add the group '{0}' to the agent '{1}'? [y/N]: ". format(group_id, agent_id)) else: ans = 'y' if ans.lower() == 'y': msg = Agent.set_group(agent_id=agent_id, group_id=group_id, replace=replace) else: msg = "Cancelled." print(msg)