'Select the entire line but starts at the first non whitespace character
and stops at the non-whitespace character.
:return:'

def select_line(self):

    self.cursor.movePosition(self.cursor.StartOfBlock)
    text = self.cursor.block().text()
    lindent = (len(text) - len(text.lstrip()))
    self.cursor.setPosition((self.cursor.block().position() + lindent))
    self.cursor.movePosition(self.cursor.EndOfBlock, self.cursor.KeepAnchor)
