Expand python code to auto-generate the array of names

This commit is contained in:
Ben V. Brown
2021-09-25 10:38:09 +10:00
parent a936eee83e
commit 7dad28a41e

View File

@@ -130,6 +130,18 @@ def get_debug_menu() -> List[str]:
]
def get_accel_names_list() -> List[str]:
return [
"Scanning",
"None",
"MMA",
"LIS",
"BMA",
"MSA",
"SC7",
]
def get_letter_counts(
defs: dict, lang: dict, build_version: str
) -> Tuple[List[str], Dict[str, int]]:
@@ -189,6 +201,7 @@ def get_letter_counts(
for x in constants:
text_list.append(x[1])
text_list.extend(get_debug_menu())
text_list.extend(get_accel_names_list())
# collapse all strings down into the composite letters and store totals for these
@@ -948,6 +961,16 @@ def get_translation_common_text(
f'\t "{convert_string(symbol_conversion_table, c)}",//{c} \n'
)
translation_common_text += "};\n\n"
# accel names
translation_common_text += "const char* AccelTypeNames[] = {\n"
for c in get_accel_names_list():
translation_common_text += (
f'\t "{convert_string(symbol_conversion_table, c)}",//{c} \n'
)
translation_common_text += "};\n\n"
return translation_common_text