@@ -183,25 +183,32 @@ def _remove_keys(self, name):
183183 for k in self .get_tool_keymap (name ):
184184 del self ._keys [k ]
185185
186- def update_keymap (self , name , * keys ):
186+ @cbook ._delete_parameter ("3.3" , "args" )
187+ def update_keymap (self , name , key , * args ):
187188 """
188189 Set the keymap to associate with the specified tool.
189190
190191 Parameters
191192 ----------
192193 name : str
193194 Name of the Tool.
194- keys : list of str
195+ keys : str or list of str
195196 Keys to associate with the tool.
196197 """
197-
198198 if name not in self ._tools :
199199 raise KeyError ('%s not in Tools' % name )
200-
201200 self ._remove_keys (name )
202-
203- for key in keys :
204- for k in validate_stringlist (key ):
201+ for key in [key , * args ]:
202+ if isinstance (key , str ) and validate_stringlist (key ) != [key ]:
203+ cbook .warn_deprecated (
204+ "3.3" , message = "Passing a list of keys as a single "
205+ "comma-separated string is deprecated since %(since)s and "
206+ "support will be removed %(removal)s; pass keys as a list "
207+ "of strings instead." )
208+ key = validate_stringlist (key )
209+ if isinstance (key , str ):
210+ key = [key ]
211+ for k in key :
205212 if k in self ._keys :
206213 cbook ._warn_external ('Key %s changed from %s to %s' %
207214 (k , self ._keys [k ], name ))
0 commit comments