def output(keybind="", command=""):
'''Output the keybinds in a nice table.
Call fix_table if needed.
'''
headers = ['Keybind', 'Modifier', 'Command']
t_data = []
if binds:
binds.sort()
for l in binds:
if keybind:
if keybind in l[0].lower():
t_data.append(l)
elif command:
if command in l[2].lower():
t_data.append(l)
else:
t_data.append(l)
if t_data:
t_data.insert(0, headers)
table = SingleTable(t_data)
if table.ok:
if args.verbose:
print('Table ok.')
print(table.table)
else:
fix_table(table)
print(table.table)
else:
print('No keybinds found.')
评论列表
文章目录