def indent(self):
if not self.tab_always_indent:<EOL><INDENT>super(PyIndenterMode, self).indent()<EOL><DEDENT>else:<EOL><INDENT>cursor = self.editor.textCursor()<EOL>assert isinstance(cursor, QtGui.QTextCursor)<EOL>if cursor.hasSelection():<EOL><INDENT>self.indent_selection(cursor)<EOL><DEDENT>else:<EOL><INDENT>tab_len = self.editor.tab_length<EOL>cursor.beginEditBlock()<EOL>if self.editor.use_spaces_instead_of_tabs:<EOL><INDENT>cursor.insertText(tab_len * "<STR_LIT:U+0020>")<EOL><DEDENT>else:<EOL><INDENT>cursor.insertText('<STR_LIT:\t>')<EOL><DEDENT>cursor.endEditBlock()<EOL>self.editor.setTextCursor(cursor)<EOL><DEDENT><DEDENT>
Performs an indentation