Class InputField

Synopsis

class InputField(InterfaceField)

Description

Used to define required config-attribute from command line input

Inheritance

Ancestors: InterfaceField

Methods

__init__
finish_wrapping_phase

Source

Lines 122-134 in anyfig/fields.py.

class InputField(InterfaceField):
  ''' Used to define required config-attribute from command line input '''
  def __init__(self, type_pattern):
    super().__init__(type_pattern=type_pattern)

  def finish_wrapping_phase(self, name, config_class):
    # Verifies that attribute is overridden and finishes setup
    err_msg = f"Missing required input argument --{name}. See --help for more info"
    assert hasattr(self, 'value'), err_msg

    self.wrapping_phase = False
    return self.value





Add Discussion as Guest

Log in