Skip to content

proxy

handle_field(extras)

Pass the proxy property in the field as is.

Parameters:

Name Type Description Default
extras AnyMap

A dictionary representation of the field.

required

Returns:

Type Description
FuncArgs

Function arguments for the parser add_argument method.

Source code in m/cli/engine/parsers/proxy.py
def handle_field(extras: AnyMap) -> FuncArgs:
    """Pass the `proxy` property in the field as is.

    Args:
        extras: A dictionary representation of the field.

    Returns:
        Function arguments for the parser `add_argument` method.
    """
    # proxy field is expected to be a FuncArgs instance.
    return cast(FuncArgs, extras['proxy'])

should_handle(extras)

Handle the proxy field.

Parameters:

Name Type Description Default
extras AnyMap

A dictionary with information for a cli argument.

required

Returns:

Type Description
bool

True if it should handle the field as a proxy to the parser.

Source code in m/cli/engine/parsers/proxy.py
def should_handle(extras: AnyMap) -> bool:
    """Handle the proxy field.

    Args:
        extras: A dictionary with information for a cli argument.

    Returns:
        True if it should handle the field as a proxy to the parser.
    """
    return extras.get('proxy', None) is not None