Function resolve_fields

Synopsis

def resolve_fields(config, cli_name='')

Description

Removes wrapping for InterfaceFields

Source

Lines 41-54 in anyfig/fields.py.

def resolve_fields(config, cli_name=''):
  ''' Removes wrapping for InterfaceFields '''
  for key, val in vars(config).items():
    if isinstance(val, InterfaceField):
      cli_name = '.'.join([cli_name, key]).lstrip('.')
      config_class = type(config).__name__
      value = val.finish_wrapping_phase(cli_name, config_class)
      setattr(config, key, value)

    # Resolve nested configs
    if is_config_class(val):
      resolve_fields(val, cli_name=key)







Add Discussion as Guest

Log in