From 895189dd1967e79197ba3106fb29d89f24a3bebb Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 27 Jul 2025 19:36:13 +1000 Subject: [PATCH] PyDocs: always quote enum values in docs While this was an intentional change in [0], it seemed like an error to removing quoting (based on #141853). Restore the quotes while keeping the string literals. [0]: 0fb80f698ab759fc25410a389354f8c592d879d9 --- doc/python_api/sphinx_doc_gen.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/python_api/sphinx_doc_gen.py b/doc/python_api/sphinx_doc_gen.py index a691b879a55..f29d87255ef 100644 --- a/doc/python_api/sphinx_doc_gen.py +++ b/doc/python_api/sphinx_doc_gen.py @@ -1331,7 +1331,7 @@ def pycontext2sphinx(basepath): type_descr = prop.get_type_description( class_fmt=":class:`bpy.types.{:s}`", mathutils_fmt=":class:`mathutils.{:s}`", - literal_fmt="``{:s}``", + literal_fmt="``{!r}``", # String with quotes. collection_id=_BPY_PROP_COLLECTION_ID, enum_descr_override=enum_descr_override, ) @@ -1502,7 +1502,7 @@ def pyrna2sphinx(basepath): kwargs["class_fmt"] = ":class:`{:s}`" kwargs["mathutils_fmt"] = ":class:`mathutils.{:s}`" - kwargs["literal_fmt"] = "``{:s}``" + kwargs["literal_fmt"] = "``{!r}``" # String with quotes. kwargs["collection_id"] = _BPY_PROP_COLLECTION_ID @@ -1623,7 +1623,7 @@ def pyrna2sphinx(basepath): type_descr = prop.get_type_description( class_fmt=":class:`{:s}`", mathutils_fmt=":class:`mathutils.{:s}`", - literal_fmt="``{:s}``", + literal_fmt="``{!r}``", # String with quotes. collection_id=_BPY_PROP_COLLECTION_ID, enum_descr_override=enum_descr_override, ) @@ -1706,7 +1706,7 @@ def pyrna2sphinx(basepath): type_descr = prop.get_type_description( as_ret=True, class_fmt=":class:`{:s}`", mathutils_fmt=":class:`mathutils.{:s}`", - literal_fmt="``{:s}``", + literal_fmt="``{!r}``", # String with quotes. collection_id=_BPY_PROP_COLLECTION_ID, enum_descr_override=enum_descr_override, )