<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def OnQuote(self, event):
 """Quotes selection or if none the current cell"""


        grid = self.grid
        grid.DisableCellEditControl()

        with undo.group(_("Quote cell(s)")):
            # Is a selection present?
            if self.grid.IsSelection():
                # Enclose all selected cells
                self.grid.actions.quote_selection()

                # Update grid
                self.grid.ForceRefresh()

            else:
                row = self.grid.GetGridCursorRow()
                col = self.grid.GetGridCursorCol()
                key = row, col, grid.current_table

                self.grid.actions.quote_code(key)

                grid.MoveCursorDown(False)