nodes: 0, module; 1, function_definition; 2, function_name:OnSortAscending; 3, parameters; 4, block; 5, identifier:self; 6, identifier:event; 7, expression_statement; 8, try_statement; 9, expression_statement; 10, comment:"""Sort ascending event handler"""; 11, block; 12, except_clause; 13, call; 14, with_statement; 15, expression_statement; 16, identifier:Exception; 17, identifier:err; 18, block; 19, identifier:post_command_event; 20, argument_list; 21, with_clause; 22, block; 23, assignment; 24, expression_statement; 25, attribute; 26, attribute; 27, keyword_argument; 28, with_item; 29, expression_statement; 30, identifier:statustext; 31, call; 32, assignment; 33, attribute; 34, identifier:main_window; 35, attribute; 36, identifier:StatusBarMsg; 37, identifier:text; 38, identifier:statustext; 39, call; 40, call; 41, identifier:_; 42, argument_list; 43, identifier:statustext; 44, call; 45, identifier:self; 46, identifier:grid; 47, identifier:self; 48, identifier:grid; 49, attribute; 50, argument_list; 51, attribute; 52, argument_list; 53, string:u"Sorting complete."; 54, attribute; 55, argument_list; 56, identifier:undo; 57, identifier:group; 58, call; 59, attribute; 60, identifier:sort_ascending; 61, attribute; 62, call; 63, identifier:format; 64, identifier:err; 65, identifier:_; 66, argument_list; 67, attribute; 68, identifier:actions; 69, attribute; 70, identifier:cursor; 71, identifier:_; 72, argument_list; 73, string:"Sort ascending"; 74, identifier:self; 75, identifier:grid; 76, attribute; 77, identifier:actions; 78, string:u"Sorting failed: {}"; 79, identifier:self; 80, identifier:grid
code: def OnSortAscending(self, event):
          """Sort ascending event handler"""
  
          try:
              with undo.group(_("Sort ascending")):
                  self.grid.actions.sort_ascending(self.grid.actions.cursor)
              statustext = _(u"Sorting complete.")
  
          except Exception, err:
              statustext = _(u"Sorting failed: {}").format(err)
  
          post_command_event(self.grid.main_window, self.grid.StatusBarMsg,
                             text=statustext)