tools/variations/split_variations_cmd.py
def ParseVariationsCmdFromString(input_string):
  """Parses commandline switches string into internal representation.

  Commandline switches string comes from chrome://version/?show-variations-cmd.
  Currently we parse the following four command line switches:
    --force-fieldtrials
    --force-fieldtrial-params
    --enable-features
    --disable-features
  """
  switch_data = ParseCommandLineSwitchesString(input_string)
  results = {}
  for switch_name, switch_value in switch_data.items():
    built_switch_value = None
    if switch_name == _FORCE_FIELD_TRIALS_SWITCH_NAME:
      results[switch_name] = _ParseForceFieldTrials(switch_value)
      built_switch_value = _BuildForceFieldTrialsSwitchValue(
          results[switch_name])
    elif switch_name == _DISABLE_FEATURES_SWITCH_NAME:
      results[switch_name] = _ParseFeatureListString(
          switch_value, is_disable=True)
      built_switch_value = _BuildFeaturesSwitchValue(results[switch_name])
    elif switch_name == _ENABLE_FEATURES_SWITCH_NAME:
      results[switch_name] = _ParseFeatureListString(
          switch_value, is_disable=False)
      built_switch_value = _BuildFeaturesSwitchValue(results[switch_name])
    elif switch_name == _FORCE_FIELD_TRIAL_PARAMS_SWITCH_NAME:
      results[switch_name] = _ParseForceFieldTrialParams(switch_value)
      built_switch_value = _BuildForceFieldTrialParamsSwitchValue(
          results[switch_name])
    else:
      raise ValueError('Unexpected: --%s=%s', switch_name, switch_value)
    assert switch_value == built_switch_value
  if (_FORCE_FIELD_TRIALS_SWITCH_NAME in results and
      _FORCE_FIELD_TRIAL_PARAMS_SWITCH_NAME in results):
    _ValidateForceFieldTrialsAndParams(
        results[_FORCE_FIELD_TRIALS_SWITCH_NAME],
        results[_FORCE_FIELD_TRIAL_PARAMS_SWITCH_NAME])
  return results
Parses commandline switches string into internal representation.

  Commandline switches string comes from chrome://version/?show-variations-cmd.
  Currently we parse the following four command line switches:
    --force-fieldtrials
    --force-fieldtrial-params
    --enable-features
    --disable-features
  
Parses commandline switches string into internal representation.
Commandline switches string comes from chrome://version/?show-variations-cmd.
Parses commandline switches string into internal representation . Commandline switches string comes from chrome : // version / ?show - variations - cmd .
def ParseVariationsCmdFromString(input_string):
  switch_data = ParseCommandLineSwitchesString(input_string)
  results = {}
  for switch_name, switch_value in switch_data.items():
    built_switch_value = None
    if switch_name == _FORCE_FIELD_TRIALS_SWITCH_NAME:
      results[switch_name] = _ParseForceFieldTrials(switch_value)
      built_switch_value = _BuildForceFieldTrialsSwitchValue(
          results[switch_name])
    elif switch_name == _DISABLE_FEATURES_SWITCH_NAME:
      results[switch_name] = _ParseFeatureListString(
          switch_value, is_disable=True)
      built_switch_value = _BuildFeaturesSwitchValue(results[switch_name])
    elif switch_name == _ENABLE_FEATURES_SWITCH_NAME:
      results[switch_name] = _ParseFeatureListString(
          switch_value, is_disable=False)
      built_switch_value = _BuildFeaturesSwitchValue(results[switch_name])
    elif switch_name == _FORCE_FIELD_TRIAL_PARAMS_SWITCH_NAME:
      results[switch_name] = _ParseForceFieldTrialParams(switch_value)
      built_switch_value = _BuildForceFieldTrialParamsSwitchValue(
          results[switch_name])
    else:
      raise ValueError('Unexpected: --%s=%s', switch_name, switch_value)
    assert switch_value == built_switch_value
  if (_FORCE_FIELD_TRIALS_SWITCH_NAME in results and
      _FORCE_FIELD_TRIAL_PARAMS_SWITCH_NAME in results):
    _ValidateForceFieldTrialsAndParams(
        results[_FORCE_FIELD_TRIALS_SWITCH_NAME],
        results[_FORCE_FIELD_TRIAL_PARAMS_SWITCH_NAME])
  return results
def ParseVariationsCmdFromString ( input_string ) : switch_data = ParseCommandLineSwitchesString ( input_string ) results = { } for switch_name , switch_value in switch_data . items ( ) : built_switch_value = None if switch_name == _FORCE_FIELD_TRIALS_SWITCH_NAME : results [ switch_name ] = _ParseForceFieldTrials ( switch_value ) built_switch_value = _BuildForceFieldTrialsSwitchValue ( results [ switch_name ] ) elif switch_name == _DISABLE_FEATURES_SWITCH_NAME : results [ switch_name ] = _ParseFeatureListString ( switch_value , is_disable = True ) built_switch_value = _BuildFeaturesSwitchValue ( results [ switch_name ] ) elif switch_name == _ENABLE_FEATURES_SWITCH_NAME : results [ switch_name ] = _ParseFeatureListString ( switch_value , is_disable = False ) built_switch_value = _BuildFeaturesSwitchValue ( results [ switch_name ] ) elif switch_name == _FORCE_FIELD_TRIAL_PARAMS_SWITCH_NAME : results [ switch_name ] = _ParseForceFieldTrialParams ( switch_value ) built_switch_value = _BuildForceFieldTrialParamsSwitchValue ( results [ switch_name ] ) else : raise ValueError ( 'Unexpected: --%s=%s' , switch_name , switch_value ) assert switch_value == built_switch_value if ( _FORCE_FIELD_TRIALS_SWITCH_NAME in results and _FORCE_FIELD_TRIAL_PARAMS_SWITCH_NAME in results ) : _ValidateForceFieldTrialsAndParams ( results [ _FORCE_FIELD_TRIALS_SWITCH_NAME ] , results [ _FORCE_FIELD_TRIAL_PARAMS_SWITCH_NAME ] ) return results
Parses commandline switches string into internal representation.
Parses commandline switches string into internal representation .
"""Parses commandline switches string into internal representation.

  Commandline switches string comes from chrome://version/?show-variations-cmd.
  Currently we parse the following four command line switches:
    --force-fieldtrials
    --force-fieldtrial-params
    --enable-features
    --disable-features
  """
input_string