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
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)
def test_history(): hist = cmdhistory.History(history=HISTORY) assert hist.history == HISTORY
def test_no_history(): hist = cmdhistory.History() assert hist.history == []
def hist(): return cmdhistory.History(history=HISTORY)