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: John Snow
Subject: Re: [PATCH v3 05/47] qapi/doc.py: Change code templates from function to string
Date: Tue, 29 Sep 2020 14:25:37 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0

On 9/28/20 11:51 PM, Cleber Rosa wrote:
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.


Was just trying to differentiate it from docstrings to see if it helped. It didn't, but it also didn't hurt, so I left it.

Luckily, this patch won't matter after Peter Maydell's series goes in, so whatever!




reply via email to

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