Refactor: More f-string for tools

This commit is contained in:
pagedown
2022-01-29 20:14:36 +08:00
parent 9f250fdf26
commit a22f37b919
7 changed files with 39 additions and 38 deletions

View File

@@ -67,7 +67,7 @@ def cmd_for_report(report_name: str, keymap: KeymapType, type_map: Dict[str, Any
flag_fmt, flag_attrs = [], []
cv = {'flag': 'c', 'int': 'i', 'uint': 'I'}[atype]
for ch in type_map[atype]:
flag_fmt.append('s' + cv)
flag_fmt.append(f's{cv}')
attr = keymap[ch][0]
flag_attrs.append(f'"{attr}", {conv}g.{attr}')
return ' '.join(flag_fmt), ', '.join(flag_attrs)