Esempio n. 1
0
 def __init__(self, *, parent=None):
     super().__init__(parent)
     self.history = cmdhistory.History(parent=self)
     self._validator = _CommandValidator(self)
     self.setValidator(self._validator)
     self.textEdited.connect(self.on_text_edited)
     self.cursorPositionChanged.connect(self.__on_cursor_position_changed)
     self._promptlen = 0
Esempio n. 2
0
    def __init__(self, _namespace, parent):
        """Constructor.

        Args:
            _namespace: The local namespace of the interpreter.
        """
        super().__init__(parent=parent)
        self._update_font()
        config.instance.changed.connect(self._update_font)
        self._history = cmdhistory.History(parent=self)
        self.returnPressed.connect(self.on_return_pressed)
Esempio n. 3
0
def test_history():
    hist = cmdhistory.History(history=HISTORY)
    assert hist.history == HISTORY
Esempio n. 4
0
def test_no_history():
    hist = cmdhistory.History()
    assert hist.history == []
Esempio n. 5
0
def hist():
    return cmdhistory.History(history=HISTORY)