form improvements

This commit is contained in:
Robin Müller 2021-07-29 12:55:05 +02:00
parent c3fade12a9
commit 4b494ae07c
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC

View File

@ -16,8 +16,10 @@ class ObjectDefinitionParser(FileParser):
if match:
self.mib_table.update({match.group(2): [match.group(1)]})
def _handle_file_parsing_moving_window(self, file_name: str, current_line: int, moving_window_size: int,
moving_window: list, *args, **kwargs):
def _handle_file_parsing_moving_window(
self, file_name: str, current_line: int, moving_window_size: int,
moving_window: list, *args, **kwargs
):
pass
def _post_parsing_operation(self):
@ -35,7 +37,8 @@ def write_translation_file(filename: str, list_of_entries, date_string_full: str
outputfile = open(filename, "w")
print('ObjectParser: Writing translation file ' + filename)
definitions = ""
function = "const char* translateObject(object_id_t object) {\n\tswitch( (object & 0xFFFFFFFF) ) {\n"
function = "const char* translateObject(object_id_t object) " \
"{\n\tswitch( (object & 0xFFFFFFFF) ) {\n"
for entry in list_of_entries:
# first part of translate file
definitions += f"const char *{entry[1][0]}_STRING = \"{entry[1][0]}\";\n"