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_app_timers.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'source/blender/python/intern/bpy_app_timers.c') diff --git a/source/blender/python/intern/bpy_app_timers.c b/source/blender/python/intern/bpy_app_timers.c index 1ef3fabacf5..5a42ecfdbc8 100644 --- a/source/blender/python/intern/bpy_app_timers.c +++ b/source/blender/python/intern/bpy_app_timers.c @@ -93,7 +93,15 @@ static PyObject *bpy_app_timers_register(PyObject *UNUSED(self), PyObject *args, int persistent = false; static const char *_keywords[] = {"function", "first_interval", "persistent", NULL}; - static _PyArg_Parser _parser = {"O|$dp:register", _keywords, 0}; + static _PyArg_Parser _parser = { + "O" /* `function` */ + "|$" /* Optional keyword only arguments. */ + "d" /* `first_interval` */ + "p" /* `persistent` */ + ":register", + _keywords, + 0, + }; if (!_PyArg_ParseTupleAndKeywordsFast( args, kw, &_parser, &function, &first_interval, &persistent)) { return NULL; -- cgit v1.2.3