(
self,
entries: Iterable[str] | None = None,
duplicates: bool = True,
hist_size: int = 100,
)
| 36 | """Stores readline-style history and current place in it""" |
| 37 | |
| 38 | def __init__( |
| 39 | self, |
| 40 | entries: Iterable[str] | None = None, |
| 41 | duplicates: bool = True, |
| 42 | hist_size: int = 100, |
| 43 | ) -> None: |
| 44 | if entries is None: |
| 45 | self.entries = [""] |
| 46 | else: |
| 47 | self.entries = list(entries) |
| 48 | # how many lines back in history is currently selected where 0 is the |
| 49 | # saved typed line, 1 the prev entered line |
| 50 | self.index = 0 |
| 51 | # what was on the prompt before using history |
| 52 | self.saved_line = "" |
| 53 | self.duplicates = duplicates |
| 54 | self.hist_size = hist_size |
| 55 | |
| 56 | def append(self, line: str) -> None: |
| 57 | self.append_to(self.entries, line) |
nothing calls this directly
no outgoing calls
no test coverage detected