From: Michael Adam Date: Thu, 23 Jul 2015 16:00:41 +0000 (+0200) Subject: generate_param: more uniform formatting of various type dicts X-Git-Tag: talloc-2.1.4~496 X-Git-Url: http://git.samba.org/samba.git/?p=garming%2Fsamba-autobuild%2F.git;a=commitdiff_plain;h=ca861f2b7302c9c96b42843de68ae8f9bf77466e generate_param: more uniform formatting of various type dicts This allows for easier extension later on (patch context-wise). Signed-off-by: Michael Adam Reviewed-by: Jeremy Allison --- diff --git a/script/generate_param.py b/script/generate_param.py index 351ea6bbb40..494e23972a2 100644 --- a/script/generate_param.py +++ b/script/generate_param.py @@ -89,9 +89,15 @@ def iterate_all(path): # map doc attributes to a section of the generated function context_dict = {"G": "_GLOBAL", "S": "_LOCAL"} -param_type_dict = {"boolean": "_BOOL", "list": "_LIST", "string": "_STRING", - "integer": "_INTEGER", "enum": "_INTEGER", "char" : "_CHAR", - "boolean-auto": "_INTEGER"} +param_type_dict = { + "boolean" : "_BOOL", + "list" : "_LIST", + "string" : "_STRING", + "integer" : "_INTEGER", + "enum" : "_INTEGER", + "char" : "_CHAR", + "boolean-auto" : "_INTEGER", + } def generate_functions(path_in, path_out): f = open(path_out, 'w') @@ -123,8 +129,15 @@ def generate_functions(path_in, path_out): finally: f.close() -mapping = {'boolean': 'bool ', 'string': 'char *', 'integer': 'int ', 'char': 'char ', - 'list': 'const char **', 'enum': 'int ', 'boolean-auto': 'int '} +mapping = { + 'boolean' : 'bool ', + 'string' : 'char *', + 'integer' : 'int ', + 'char' : 'char ', + 'list' : 'const char **', + 'enum' : 'int ', + 'boolean-auto' : 'int ', + } def make_s3_param_proto(path_in, path_out): file_out = open(path_out, 'w')