Browse code

misc/tools/kemi: lua - replaced markdown term

- no longer suitable for the new tools

Daniel-Constantin Mierla authored on 24/11/2020 08:49:37
Showing 2 changed files
... ...
@@ -8,7 +8,7 @@ PATH_GENERATED_OBJ = "KSR.lua"
8 8
 class ModuleObjGenerator(object):
9 9
 
10 10
     # Contains the output until it should be written to disk
11
-    markdown_string = ""
11
+    output_string = ""
12 12
 
13 13
     def execute(self, data):
14 14
         # Validate that we got some methods back. 155 is an arbitrary large number.
... ...
@@ -57,7 +57,7 @@ class ModuleObjGenerator(object):
57 57
             module_prefix = module + "."
58 58
 
59 59
         for value in methods:
60
-            self.markdown_string += "local function KSR." + module_prefix + value["name"]
60
+            self.object_string += "local function KSR." + module_prefix + value["name"]
61 61
 
62 62
             # Sanitize the return values
63 63
             if value["return"] == "none":
... ...
@@ -79,10 +79,10 @@ class ModuleObjGenerator(object):
79 79
             else:
80 80
                 params_value = value["params"]
81 81
 
82
-            # Generate the output string for the markdown page
83
-            self.markdown_string += "(" + params_value + ")\n"
84
-            self.markdown_string += "\treturn" + return_value + ";\n"
85
-            self.markdown_string += "end\n\n"
82
+            # Generate the output string for the file
83
+            self.object_string += "(" + params_value + ")\n"
84
+            self.object_string += "\treturn" + return_value + ";\n"
85
+            self.object_string += "end\n\n"
86 86
 
87 87
 
88 88
         return True
... ...
@@ -90,7 +90,7 @@ class ModuleObjGenerator(object):
90 90
     def obj_write(self):
91 91
         f = open(PATH_GENERATED_OBJ, "w")
92 92
         f.write("local KSR = {};\n\n")
93
-        f.write(self.markdown_string)
93
+        f.write(self.object_string)
94 94
         f.write("return KSR;\n")
95 95
         f.close()
96 96
         return True
... ...
@@ -8,7 +8,7 @@ PATH_GENERATED_OBJ = "KSR.luacheckrc"
8 8
 class ModuleObjGenerator(object):
9 9
 
10 10
     # Contains the output until it should be written to disk
11
-    markdown_string = ""
11
+    object_string = ""
12 12
 
13 13
     def execute(self, data):
14 14
         # Validate that we got some methods back. 155 is an arbitrary large number.
... ...
@@ -19,7 +19,7 @@ class ModuleObjGenerator(object):
19 19
         functions_parsed = self.parse_function_list(data)
20 20
         self.output_obj(functions_parsed)
21 21
 
22
-        print ("Markdown doc created successfully at " + PATH_GENERATED_OBJ)
22
+        print ("File created successfully at " + PATH_GENERATED_OBJ)
23 23
 
24 24
     def parse_function_list(self, functions):
25 25
         data = {}
... ...
@@ -52,22 +52,22 @@ class ModuleObjGenerator(object):
52 52
 
53 53
     def object_module_content(self, module, methods):
54 54
         if module != "_core":
55
-            self.markdown_string += "\t\t\t\t" + module + " = {\n\t\t\t\t\tfields= {\n"
55
+            self.object_string += "\t\t\t\t" + module + " = {\n\t\t\t\t\tfields= {\n"
56 56
 
57 57
         for value in methods:
58 58
             if module != "_core":
59
-                self.markdown_string += "\t\t\t\t\t\t" + value["name"] + " = {},\n"
59
+                self.object_string += "\t\t\t\t\t\t" + value["name"] + " = {},\n"
60 60
             else:
61
-                self.markdown_string += "\t\t\t\t" + value["name"] + " = {},\n"
61
+                self.object_string += "\t\t\t\t" + value["name"] + " = {},\n"
62 62
 
63 63
         if module != "_core":
64
-            self.markdown_string += "\t\t\t\t\t},\n\t\t\t\t},\n"
64
+            self.object_string += "\t\t\t\t\t},\n\t\t\t\t},\n"
65 65
         return True
66 66
 
67 67
     def obj_write(self):
68 68
         f = open(PATH_GENERATED_OBJ, "w")
69 69
         f.write("stds.KSR = {\n\tread_globals = {\n\t\tKSR = {\n\t\t\tfields = {\n")
70
-        f.write(self.markdown_string)
70
+        f.write(self.object_string)
71 71
         f.write("\t\t\t\tx = {\n\t\t\t\t\tfields= {\n")
72 72
         f.write("\t\t\t\t\t\tdrop= {},\n")
73 73
         f.write("\t\t\t\t\t\texit= {},\n")