On Mon, Jul 20, 2009 at 12:07 PM, Michael Goldish<mgold...@redhat.com> wrote:
> Allow kvm_config to parse weird lines that seem to contain several operators,
> such as:
> time_filter_re = "(?<=TIME: ...)"
>
> The '?<=' is recognized as the operator instead of the '='.
> To fix this, select the operator closest to the beginning of the line.

Applied.

> Signed-off-by: Michael Goldish <mgold...@redhat.com>
> ---
>  client/tests/kvm/kvm_config.py |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/client/tests/kvm/kvm_config.py b/client/tests/kvm/kvm_config.py
> index 95eefcb..99ccb2a 100755
> --- a/client/tests/kvm/kvm_config.py
> +++ b/client/tests/kvm/kvm_config.py
> @@ -294,10 +294,12 @@ class config:
>             # Look for a known operator in the line
>             operators = ["?+=", "?<=", "?=", "+=", "<=", "="]
>             op_found = None
> +            op_pos = len(line)
>             for op in operators:
> -                if op in line:
> +                pos = line.find(op)
> +                if pos >= 0 and pos < op_pos:
>                     op_found = op
> -                    break
> +                    op_pos = pos
>
>             # Found an operator?
>             if op_found:
> --
> 1.5.4.1
>
> _______________________________________________
> Autotest mailing list
> autot...@test.kernel.org
> http://test.kernel.org/cgi-bin/mailman/listinfo/autotest
>



-- 
Lucas Meneghel
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to