def set_upload_targets(actions): """Translate meta targets into actual targets, set them accordingly and return.""" upload_targets = get_upload_targets() slack = get_bool_key('Output', 'slack') email = get_bool_key('Output', 'mail') # A little bit long but very explicit about what should happen if actions[0] == "normal": if slack: upload_targets['slack'] = True if email: for mail in range(int(get_key('Output', 'num_mail'))): upload_targets['Mail' + str(mail)] = True elif actions[0] == "all_mail": if email: for mail in range(int(get_key('Output', 'num_mail'))): upload_targets['Mail' + str(mail)] = True else: for action in actions: if action in upload_targets: upload_targets[action] = True return upload_targets