From 982aea88e0d74020c62c2054a45eeafa56c8ca30 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 8 Apr 2022 09:41:28 +1000 Subject: Cleanup: separate format-units for Python argument parsing With the increased use of multi-character format units and keyword-only arguments these are increasingly difficult to make sense of. Split the string onto multiple lines, one per argument. While verbose it's easier to understand and add new arguments. --- source/blender/python/intern/bpy_library_write.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'source/blender/python/intern/bpy_library_write.c') diff --git a/source/blender/python/intern/bpy_library_write.c b/source/blender/python/intern/bpy_library_write.c index a3f2f27a452..79a3680b78d 100644 --- a/source/blender/python/intern/bpy_library_write.c +++ b/source/blender/python/intern/bpy_library_write.c @@ -78,13 +78,22 @@ static PyObject *bpy_lib_write(BPy_PropertyRNA *self, PyObject *args, PyObject * static const char *_keywords[] = { "filepath", "datablocks", - /* optional */ "path_remap", "fake_user", "compress", NULL, }; - static _PyArg_Parser _parser = {"sO!|$O&O&O&:write", _keywords, 0}; + static _PyArg_Parser _parser = { + "s" /* `filepath` */ + "O!" /* `datablocks` */ + "|$" /* Optional keyword only arguments. */ + "O&" /* `path_remap` */ + "O&" /* `fake_user` */ + "O&" /* `compress` */ + ":write", + _keywords, + 0, + }; if (!_PyArg_ParseTupleAndKeywordsFast(args, kw, &_parser, -- cgit v1.2.3