misc/tools/kemi: lua - replaced markdown term master
authorDaniel-Constantin Mierla <miconda@gmail.com>
Tue, 24 Nov 2020 08:49:37 +0000 (09:49 +0100)
committerDaniel-Constantin Mierla <miconda@gmail.com>
Tue, 24 Nov 2020 08:49:37 +0000 (09:49 +0100)
- no longer suitable for the new tools

misc/tools/kemi/lua/kemiksrlib.py
misc/tools/kemi/lua/kemiluacheck.py

index dfa528c..f801a9d 100644 (file)
@@ -8,7 +8,7 @@ PATH_GENERATED_OBJ = "KSR.lua"
 class ModuleObjGenerator(object):
 
     # Contains the output until it should be written to disk
-    markdown_string = ""
+    output_string = ""
 
     def execute(self, data):
         # Validate that we got some methods back. 155 is an arbitrary large number.
@@ -57,7 +57,7 @@ class ModuleObjGenerator(object):
             module_prefix = module + "."
 
         for value in methods:
-            self.markdown_string += "local function KSR." + module_prefix + value["name"]
+            self.object_string += "local function KSR." + module_prefix + value["name"]
 
             # Sanitize the return values
             if value["return"] == "none":
@@ -79,10 +79,10 @@ class ModuleObjGenerator(object):
             else:
                 params_value = value["params"]
 
-            # Generate the output string for the markdown page
-            self.markdown_string += "(" + params_value + ")\n"
-            self.markdown_string += "\treturn" + return_value + ";\n"
-            self.markdown_string += "end\n\n"
+            # Generate the output string for the file
+            self.object_string += "(" + params_value + ")\n"
+            self.object_string += "\treturn" + return_value + ";\n"
+            self.object_string += "end\n\n"
 
 
         return True
@@ -90,7 +90,7 @@ class ModuleObjGenerator(object):
     def obj_write(self):
         f = open(PATH_GENERATED_OBJ, "w")
         f.write("local KSR = {};\n\n")
-        f.write(self.markdown_string)
+        f.write(self.object_string)
         f.write("return KSR;\n")
         f.close()
         return True
index 3da2853..75c6e59 100644 (file)
@@ -8,7 +8,7 @@ PATH_GENERATED_OBJ = "KSR.luacheckrc"
 class ModuleObjGenerator(object):
 
     # Contains the output until it should be written to disk
-    markdown_string = ""
+    object_string = ""
 
     def execute(self, data):
         # Validate that we got some methods back. 155 is an arbitrary large number.
@@ -19,7 +19,7 @@ class ModuleObjGenerator(object):
         functions_parsed = self.parse_function_list(data)
         self.output_obj(functions_parsed)
 
-        print ("Markdown doc created successfully at " + PATH_GENERATED_OBJ)
+        print ("File created successfully at " + PATH_GENERATED_OBJ)
 
     def parse_function_list(self, functions):
         data = {}
@@ -52,22 +52,22 @@ class ModuleObjGenerator(object):
 
     def object_module_content(self, module, methods):
         if module != "_core":
-            self.markdown_string += "\t\t\t\t" + module + " = {\n\t\t\t\t\tfields= {\n"
+            self.object_string += "\t\t\t\t" + module + " = {\n\t\t\t\t\tfields= {\n"
 
         for value in methods:
             if module != "_core":
-                self.markdown_string += "\t\t\t\t\t\t" + value["name"] + " = {},\n"
+                self.object_string += "\t\t\t\t\t\t" + value["name"] + " = {},\n"
             else:
-                self.markdown_string += "\t\t\t\t" + value["name"] + " = {},\n"
+                self.object_string += "\t\t\t\t" + value["name"] + " = {},\n"
 
         if module != "_core":
-            self.markdown_string += "\t\t\t\t\t},\n\t\t\t\t},\n"
+            self.object_string += "\t\t\t\t\t},\n\t\t\t\t},\n"
         return True
 
     def obj_write(self):
         f = open(PATH_GENERATED_OBJ, "w")
         f.write("stds.KSR = {\n\tread_globals = {\n\t\tKSR = {\n\t\t\tfields = {\n")
-        f.write(self.markdown_string)
+        f.write(self.object_string)
         f.write("\t\t\t\tx = {\n\t\t\t\t\tfields= {\n")
         f.write("\t\t\t\t\t\tdrop= {},\n")
         f.write("\t\t\t\t\t\texit= {},\n")