tools/metrics/actions/action_utils.py
def _CreateActionFromSuffix(actions_dict, action, suffix):
  """Creates a new action with action and suffix and adds it to actions_dict.

  Args:
    actions_dict: dict of existing action name to Action object.
    action: an Action object to combine with suffix.
    suffix: a suffix object to combine with action.

  Returns:
    None.

  Raises:
    InvalidAffecteddActionNameError: if the action name does not contain a dot
  """
  if suffix.ordering == 'suffix':
    new_action_name = action.name + suffix.separator + suffix.name
  else:
    (before, dot, after) = action.name.partition('.')
    if not after:
      raise InvalidAffecteddActionNameError(
          "Action name '%s' must contain a '.'." % action.name)
    new_action_name = before + dot + suffix.name + suffix.separator + after

  new_action_description = action.description + ' ' + suffix.description

  actions_dict[new_action_name] = Action(
      new_action_name,
      new_action_description,
      list(action.owners),
      action.not_user_triggered,
      action.obsolete,
      from_suffix=True)
Creates a new action with action and suffix and adds it to actions_dict.

  Args:
    actions_dict: dict of existing action name to Action object.
    action: an Action object to combine with suffix.
    suffix: a suffix object to combine with action.

  Returns:
    None.

  Raises:
    InvalidAffecteddActionNameError: if the action name does not contain a dot
  
Creates a new action with action and suffix and adds it to actions_dict.
Creates a new action with action and suffix and adds it to actions_dict .
def _CreateActionFromSuffix(actions_dict, action, suffix):
  if suffix.ordering == 'suffix':
    new_action_name = action.name + suffix.separator + suffix.name
  else:
    (before, dot, after) = action.name.partition('.')
    if not after:
      raise InvalidAffecteddActionNameError(
          "Action name '%s' must contain a '.'." % action.name)
    new_action_name = before + dot + suffix.name + suffix.separator + after
  new_action_description = action.description + ' ' + suffix.description
  actions_dict[new_action_name] = Action(
      new_action_name,
      new_action_description,
      list(action.owners),
      action.not_user_triggered,
      action.obsolete,
      from_suffix=True)
def _CreateActionFromSuffix ( actions_dict , action , suffix ) : if suffix . ordering == 'suffix' : new_action_name = action . name + suffix . separator + suffix . name else : ( before , dot , after ) = action . name . partition ( '.' ) if not after : raise InvalidAffecteddActionNameError ( "Action name '%s' must contain a '.'." % action . name ) new_action_name = before + dot + suffix . name + suffix . separator + after new_action_description = action . description + ' ' + suffix . description actions_dict [ new_action_name ] = Action ( new_action_name , new_action_description , list ( action . owners ) , action . not_user_triggered , action . obsolete , from_suffix = True )
Creates a new action with action and suffix and adds it to actions_dict.
Creates a new action with action and suffix and adds it to actions_dict .
"""Creates a new action with action and suffix and adds it to actions_dict.

  Args:
    actions_dict: dict of existing action name to Action object.
    action: an Action object to combine with suffix.
    suffix: a suffix object to combine with action.

  Returns:
    None.

  Raises:
    InvalidAffecteddActionNameError: if the action name does not contain a dot
  """
None
if the action name does not contain a dot
if the action name does not contain a dot
InvalidAffecteddActionNameError
actions_dict
dict of existing action name to Action object.
dict of existing action name to Action object .
action
an Action object to combine with suffix.
an Action object to combine with suffix .
suffix
a suffix object to combine with action.
a suffix object to combine with action .