'Selects an entire line.
:param line: Line to select. If None, the current line will be selected
:param apply_selection: True to apply selection on the text editor
widget, False to just return the text cursor without setting it
on the editor.
:return: QTextCursor'

def select_whole_line(self, line=None, apply_selection=True):

    if (line is None):
        line = self.current_line_nbr()
    return self.select_lines(line, line, apply_selection=apply_selection)
