Exemple #1
0
 def __init__(self, parent=None):
     super(InteractiveConsole, self).__init__(parent)
     self._stdout_col = QColor("#404040")
     self._app_msg_col = QColor("#4040FF")
     self._stdin_col = QColor("#22AA22")
     self._stderr_col = QColor("#FF0000")
     self._process = None
     self._args = None
     self._usr_buffer = ""
     self._clear_on_start = True
     self.process = QProcess()
     self._merge_outputs = False
     self.process.finished.connect(self._on_process_finished)
     self.process.error.connect(self._write_error)
     self.process.readyReadStandardError.connect(self._on_stderr)
     self.process.readyReadStandardOutput.connect(self._on_stdout)
     self._running = False
     self._writer = self.write
     self._user_stop = False
     font = "monospace"
     if sys.platform == "win32":
         font = "Consolas"
     elif sys.platform == "darwin":
         font = 'Monaco'
     self._font_family = font
     self.setFont(QFont(font, 10))
     self.setReadOnly(True)
Exemple #2
0
 def __init__(self, parent=None):
     super(InteractiveConsole, self).__init__(parent)
     self.panels = PanelsManager(self)
     self.decorations = TextDecorationsManager(self)
     from pyqode.core.panels import SearchAndReplacePanel
     self.panels.append(SearchAndReplacePanel(),
                        SearchAndReplacePanel.Position.TOP)
     self._stdout_col = QColor("#404040")
     self._app_msg_col = QColor("#4040FF")
     self._stdin_col = QColor("#22AA22")
     self._stderr_col = QColor("#FF0000")
     self._write_app_messages = True
     self._process_name = ''
     self.process = None
     self._args = None
     self._usr_buffer = ""
     self._clear_on_start = True
     self._merge_outputs = False
     self._running = False
     self._writer = self.write
     self._user_stop = False
     font = "monospace"
     if sys.platform == "win32":
         font = "Consolas"
     elif sys.platform == "darwin":
         font = 'Monaco'
     self._font_family = font
     self.setFont(QFont(font, 10))
     self.setReadOnly(True)
     self._mask_user_input = False
     action = QAction('Copy', self)
     action.setShortcut(QKeySequence.Copy)
     action.triggered.connect(self.copy)
     self.add_action(action)
     action = QAction('Paste', self)
     action.setShortcut(QKeySequence.Paste)
     action.triggered.connect(self.paste)
     self.add_action(action)