Hi Andrew,

Looks good! Just a small nit left.

On Wed, Sep 24, 2025 at 12:47:24PM +0000, Andrew Bailey wrote:
> diff --git a/dts/framework/remote_session/testpmd_shell.py 
> b/dts/framework/remote_session/testpmd_shell.py
> index ecbdd66edd..db7e33222a 100644
> --- a/dts/framework/remote_session/testpmd_shell.py
> +++ b/dts/framework/remote_session/testpmd_shell.py
> @@ -1278,7 +1279,99 @@ class TestPmdVerbosePacket(TextParser):
>      )
>  
>  
> -class RxOffloadCapability(Flag):
> +class OffloadCapability(Flag):
> +    """Flags generated from RxOffloadCapabilites and TxOffloadCapabilities 
> classes."""
<snip>
> +    @classmethod
> +    def make_parser(
> +        cls, per_port: Literal["port", "queue"], /, find_multiple: bool = 
> False
> +    ) -> ParserFn:
> +        """Make a parser function.
> +
> +        Args:
> +            per_port: If :data:`True`, will return capabilities per port. If 
> :data:`False`,
> +                will return capabilities per queue.

just a small nit: this doc doesn't match what it is anymore. Similarly
the argument name is not entirely valid either.

> +            find_multiple: If :data:`True`, will use 
> :func:`TextParser.find_all` to find all
> +                matches for the regex query and return a list of instances 
> based on those matches.
> +                If :data:`False`, will return a single instance of the flag 
> based off a single
> +                match.
> +
> +        Returns:
> +            ParserFn: A dictionary for the `dataclasses.field` metadata 
> argument containing a
> +                parser function that makes an instance of this flag from 
> text.
> +        """
> +        granularity = per_port.capitalize()
> +        regex = rf"{granularity}[\s\[\]\d]+:(.*)$"
> +        if find_multiple:
> +            return TextParser.wrap(TextParser.find_all(regex, re.MULTILINE), 
> cls.from_list)
> +        return TextParser.wrap(TextParser.find(regex, re.MULTILINE), 
> cls.from_string)
<snip>

Reply via email to