diff --git a/scripts/process_function_template.py b/scripts/process_function_template.py index c845d38f624..8f8c1e1408a 100644 --- a/scripts/process_function_template.py +++ b/scripts/process_function_template.py @@ -4,6 +4,7 @@ import sys import os import json import glob +from copy import deepcopy sys.path.append( os.path.join( @@ -75,6 +76,9 @@ for f in sorted(glob.glob('resources/function_help/json/*')): for v in json_params['variants']: if 'arguments' not in v: raise BaseException("%s: arguments expected for operator" % f) + a_list = list(deepcopy(v['arguments'])) + if not 1 <= len(a_list) <= 2: + raise BaseException("%s: 1 or 2 arguments expected for operator found %i" % (f, len(a_list))) cpp.write("\n\n functionHelpTexts().insert( QStringLiteral( {0} ),\n Help( QStringLiteral( {0} ), tr( \"{1}\" ), tr( \"{2}\" ),\n QList()".format( name, json_params['type'], json_params['description'])