@@ -3224,9 +3224,9 @@ def __init__(self, name, sender, tool, canvasevent=None, data=None):
32243224
32253225
32263226class NavigationMessageEvent (object ):
3227- """Event carring messages from navigation
3227+ """Event carrying messages from navigation
32283228
3229- Messages are generaly displayed to the user by the toolbar
3229+ Messages usually get displayed to the user by the toolbar
32303230 """
32313231 def __init__ (self , name , sender , message ):
32323232 self .name = name
@@ -3313,7 +3313,7 @@ def active_toggle(self):
33133313 return self ._toggled
33143314
33153315 def get_tool_keymap (self , name ):
3316- """Get the keymap associated with a tool
3316+ """Get the keymap associated with the specified tool
33173317
33183318 Parameters
33193319 ----------
@@ -3334,13 +3334,13 @@ def _remove_keys(self, name):
33343334 del self ._keys [k ]
33353335
33363336 def set_tool_keymap (self , name , * keys ):
3337- """Set the keymap associated with a tool
3337+ """Set the keymap to associate with the specified tool
33383338
33393339 Parameters
33403340 ----------
33413341 name : string
33423342 Name of the Tool
3343- keys : keys to associated with the Tool
3343+ keys : keys to associate with the Tool
33443344 """
33453345
33463346 if name not in self ._tools :
@@ -3414,7 +3414,7 @@ def add_tool(self, name, tool, group=None, position=None):
34143414 group: String
34153415 Group to position the tool in
34163416 position : int or None (default)
3417- Position within its group in the toolbar, if None, is positioned at the end
3417+ Position within its group in the toolbar, if None, it goes at the end
34183418 """
34193419
34203420 tool_cls = self ._get_cls_to_instantiate (tool )
@@ -3431,7 +3431,7 @@ def add_tool(self, name, tool, group=None, position=None):
34313431 if tool_cls .keymap is not None :
34323432 self .set_tool_keymap (name , tool_cls .keymap )
34333433
3434- # For toggle tools init the radio_grop in self._toggled
3434+ # For toggle tools init the radio_group in self._toggled
34353435 if getattr (tool_cls , 'toggled' , False ) is not False :
34363436 # None group is not mutually exclusive, a set is used to keep track
34373437 # of all toggled tools in this group
@@ -3451,8 +3451,8 @@ def _tool_added_event(self, tool, group, position):
34513451 self ._callbacks .process (s , event )
34523452
34533453 def _handle_toggle (self , tool , sender , canvasevent , data ):
3454- # Toggle tools, need to be untoggled before other Toggle tool is used
3455- # This is called from tool_trigger_event
3454+ # Toggle tools, need to untoggle prior to using other Toggle tool
3455+ # Called from tool_trigger_event
34563456
34573457 radio_group = tool .radio_group
34583458 # radio_group None is not mutually exclusive
@@ -3464,8 +3464,7 @@ def _handle_toggle(self, tool, sender, canvasevent, data):
34643464 self ._toggled [None ].add (tool .name )
34653465 return
34663466
3467- # If it is the same tool that is toggled in the radio_group
3468- # untoggle it
3467+ # If the tool already has a toggled state, untoggle it
34693468 if self ._toggled [radio_group ] == tool .name :
34703469 toggled = None
34713470 # If no tool was toggled in the radio_group
@@ -3510,7 +3509,7 @@ def tool_trigger_event(self, name, sender=None, canvasevent=None,
35103509 name : string
35113510 Name of the tool
35123511 sender: object
3513- Object that wish to trigger the tool
3512+ Object that wishes to trigger the tool
35143513 canvasevent : Event
35153514 Original Canvas event or None
35163515 data : Object
@@ -3541,7 +3540,7 @@ def _trigger_tool(self, name, sender=None, canvasevent=None, data=None):
35413540 self ._handle_toggle (tool , sender , canvasevent , data )
35423541
35433542 # Important!!!
3544- # This is where the Tool object is triggered
3543+ # This is where the Tool object gets triggered
35453544 tool .trigger (sender , canvasevent , data )
35463545
35473546 def _key_press (self , event ):
@@ -3590,21 +3589,21 @@ def __init__(self, manager):
35903589 self ._remove_tool_cbk )
35913590
35923591 def _message_cbk (self , event ):
3593- """Captures the 'tool_message_event' to set message on the toolbar"""
3592+ """Captures the 'tool_message_event' to set the message on the toolbar"""
35943593 self .set_message (event .message )
35953594
35963595 def _tool_triggered_cbk (self , event ):
35973596 """Captures the 'tool-trigger-toolname
35983597
3599- This is only used for toggled tools
3598+ This only gets used for toggled tools
36003599 """
36013600 if event .sender is self :
36023601 return
36033602
36043603 self .toggle_toolitem (event .tool .name )
36053604
36063605 def _add_tool_cbk (self , event ):
3607- """Captures 'tool_added_event' and add the tool to the toolbar"""
3606+ """Captures 'tool_added_event' and adds the tool to the toolbar"""
36083607 image = self ._get_image_filename (event .tool .image )
36093608 toggle = getattr (event .tool , 'toggled' , None ) is not None
36103609 self .add_toolitem (event .tool .name ,
@@ -3618,11 +3617,11 @@ def _add_tool_cbk(self, event):
36183617 self ._tool_triggered_cbk )
36193618
36203619 def _remove_tool_cbk (self , event ):
3621- """Captures the 'tool_removed_event' signal and remove the tool"""
3620+ """Captures the 'tool_removed_event' signal and removes the tool"""
36223621 self .remove_toolitem (event .tool .name )
36233622
36243623 def _get_image_filename (self , image ):
3625- """"Base on the image name find the corresponding image """
3624+ """Find the image based on its name """
36263625 # TODO: better search for images, they are not always in the
36273626 # datapath
36283627 basedir = os .path .join (rcParams ['datapath' ], 'images' )
@@ -3638,28 +3637,28 @@ def trigger_tool(self, name):
36383637 Parameters
36393638 ----------
36403639 name : String
3641- Name(id) of the tool that was triggered in the toolbar
3640+ Name(id) of the tool triggered from within the toolbar
36423641
36433642 """
36443643 self .navigation .tool_trigger_event (name , sender = self )
36453644
36463645 def add_toolitem (self , name , group , position , image , description , toggle ):
36473646 """Add a toolitem to the toolbar
36483647
3649- This method has to be implemented per backend
3648+ This method must get implemented per backend
36503649
36513650 The callback associated with the button click event,
36523651 must be **EXACTLY** `self.trigger_tool(name)`
36533652
36543653 Parameters
36553654 ----------
36563655 name : string
3657- Name of the tool to add, this is used as ID and as default label
3658- of the buttons
3656+ Name of the tool to add, this gets used as the tool's ID and as the
3657+ default label of the buttons
36593658 group : String
3660- Name of the group that the tool belongs to
3659+ Name of the group that this tool belongs to
36613660 position : Int
3662- Position of the tool whthin its group if -1 at the End
3661+ Position of the tool within its group, if -1 it goes at the End
36633662 image_file : String
36643663 Filename of the image for the button or `None`
36653664 description : String
@@ -3697,9 +3696,9 @@ def toggle_toolitem(self, name):
36973696 def remove_toolitem (self , name ):
36983697 """Remove a toolitem from the `Toolbar`
36993698
3700- This method has to be implemented per backend
3699+ This method must get implemented per backend
37013700
3702- Called when `tool_removed_event` is emited by `NavigationBase `
3701+ Called when `NavigationBase` emits a `tool_removed_event `
37033702
37043703 Parameters
37053704 ----------
0 commit comments