@@ -937,6 +937,7 @@ def trigger(self, *args, **kwargs):
937937 self .toolmanager .message_event (message , self )
938938
939939
940+ #: The default tools to add to a tool manager.
940941default_tools = {'home' : ToolHome , 'back' : ToolBack , 'forward' : ToolForward ,
941942 'zoom' : ToolZoom , 'pan' : ToolPan ,
942943 'subplots' : ConfigureSubplotsBase ,
@@ -956,12 +957,13 @@ def trigger(self, *args, **kwargs):
956957 'copy' : ToolCopyToClipboardBase ,
957958 }
958959
960+ #: The default tools to add to a container.
959961default_toolbar_tools = [['navigation' , ['home' , 'back' , 'forward' ]],
960962 ['zoompan' , ['pan' , 'zoom' , 'subplots' ]],
961963 ['io' , ['save' , 'help' ]]]
962964
963965
964- def add_tools_to_manager (toolmanager , tools = default_tools ):
966+ def add_tools_to_manager (toolmanager , tools = None ):
965967 """
966968 Add multiple tools to a `.ToolManager`.
967969
@@ -971,14 +973,16 @@ def add_tools_to_manager(toolmanager, tools=default_tools):
971973 Manager to which the tools are added.
972974 tools : {str: class_like}, optional
973975 The tools to add in a {name: tool} dict, see
974- `.backend_managers.ToolManager.add_tool` for more info.
976+ `.backend_managers.ToolManager.add_tool` for more info. If not specified, then
977+ defaults to `.default_tools`.
975978 """
976-
979+ if tools is None :
980+ tools = default_tools
977981 for name , tool in tools .items ():
978982 toolmanager .add_tool (name , tool )
979983
980984
981- def add_tools_to_container (container , tools = default_toolbar_tools ):
985+ def add_tools_to_container (container , tools = None ):
982986 """
983987 Add multiple tools to the container.
984988
@@ -990,9 +994,11 @@ def add_tools_to_container(container, tools=default_toolbar_tools):
990994 tools : list, optional
991995 List in the form ``[[group1, [tool1, tool2 ...]], [group2, [...]]]``
992996 where the tools ``[tool1, tool2, ...]`` will display in group1.
993- See `.backend_bases.ToolContainerBase.add_tool` for details.
997+ See `.backend_bases.ToolContainerBase.add_tool` for details. If not specified,
998+ then defaults to `.default_toolbar_tools`.
994999 """
995-
1000+ if tools is None :
1001+ tools = default_toolbar_tools
9961002 for group , grouptools in tools :
9971003 for position , tool in enumerate (grouptools ):
9981004 container .add_tool (tool , group , position )
0 commit comments