def autoIndentBlock(self, block, char = '\n'):
        """Indent block after Enter pressed or trigger character typed
        """
        cursor = QTextCursor(block)
        currentText = block.text()
        spaceAtStartLen = len(currentText) - len(currentText.lstrip())
        currentIndent = currentText[:spaceAtStartLen]
        indent = self._smartIndenter.computeIndent(block, char)
        if indent is not None and indent != currentIndent:
            self._qpart.replaceText(block.position(), spaceAtStartLen, indent)
def _handle_sigint_if_enabled(self, signum, _frame):
        with self._ignore_sigint_lock:
            self._check_sigint_gate_is_correct()
            threads_ignoring_sigint = self._threads_ignoring_sigint
            ignoring_sigint_v2_engine = self._ignoring_sigint_v2_engine
        if threads_ignoring_sigint == 0 and not ignoring_sigint_v2_engine:
            self.handle_sigint(signum, _frame)