@@ -27,22 +27,22 @@ class ListTools(ToolBase):
2727
2828 def trigger (self , * args , ** kwargs ):
2929 print ('_' * 80 )
30- print ( "{0 :12} {1 :45} {2 }" .format (
31- 'Name (id)' , 'Tool description' , 'Keymap' ))
30+ fmt_tool = "{ :12} {:45} {}" .format
31+ print ( fmt_tool ( 'Name (id)' , 'Tool description' , 'Keymap' ))
3232 print ('-' * 80 )
3333 tools = self .toolmanager .tools
3434 for name in sorted (tools ):
3535 if not tools [name ].description :
3636 continue
3737 keys = ', ' .join (sorted (self .toolmanager .get_tool_keymap (name )))
38- print ("{0:12} {1:45} {2}" .format (
39- name , tools [name ].description , keys ))
38+ print (fmt_tool (name , tools [name ].description , keys ))
4039 print ('_' * 80 )
40+ fmt_active_toggle = "{0!s:12} {1!s:45}" .format
4141 print ("Active Toggle tools" )
42- print ("{0:12} {1:45}" . format ("Group" , "Active" ))
42+ print (fmt_active_toggle ("Group" , "Active" ))
4343 print ('-' * 80 )
4444 for group , active in self .toolmanager .active_toggle .items ():
45- print ("{0:12} {1:45}" . format ( str ( group ), str ( active ) ))
45+ print (fmt_active_toggle ( group , active ))
4646
4747
4848class GroupHideTool (ToolToggleBase ):
0 commit comments