generate_param: more uniform formatting of various type dicts
authorMichael Adam <obnox@samba.org>
Thu, 23 Jul 2015 16:00:41 +0000 (18:00 +0200)
committerJeremy Allison <jra@samba.org>
Thu, 30 Jul 2015 23:55:32 +0000 (01:55 +0200)
This allows for easier extension later on (patch context-wise).

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
script/generate_param.py

index 351ea6bbb40d28945edbabb049fb8660a944e985..494e23972a2dee8a968722886d08b40d6fcb9d6a 100644 (file)
@@ -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')