qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 05/47] qapi/doc.py: Change code templates from function to


From: Cleber Rosa
Subject: Re: [PATCH v3 05/47] qapi/doc.py: Change code templates from function to string
Date: Mon, 28 Sep 2020 23:51:13 -0400

On Thu, Sep 24, 2020 at 08:28:18PM -0400, John Snow wrote:
> For whatever reason, when these are stored as functions instead of
> strings, it confuses sphinx-autodoc into believing them to be
> docstrings, and it chokes on the syntax.
>

Interesting...

> Keeping them as dumb strings instead avoids the problem.
>

I actually think it's a more honest approach, and easier to read.

> Signed-off-by: John Snow <jsnow@redhat.com>
> ---
>  scripts/qapi/doc.py | 40 ++++++++++++++++++++--------------------
>  1 file changed, 20 insertions(+), 20 deletions(-)
> 
> diff --git a/scripts/qapi/doc.py b/scripts/qapi/doc.py
> index c41e9d29f5..d12eda9e1e 100644
> --- a/scripts/qapi/doc.py
> +++ b/scripts/qapi/doc.py
> @@ -8,26 +8,26 @@
>  from qapi.gen import QAPIGenDoc, QAPISchemaVisitor
>  
>  
> -MSG_FMT = """
> +_MSG = '''
>  @deftypefn {type} {{}} {name}
>  
>  {body}{members}{features}{sections}
>  @end deftypefn
>  
> -""".format
> +'''
>

I know it doesn't make syntactic difference, but is there a reson for
also changing the quote style?

- Cleber.

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]