MCPcopy Index your code
hub / github.com/bpython/bpython / add_input_character

Method add_input_character

bpython/curtsiesfrontend/repl.py:162–175  ·  view source on GitHub ↗
(self, e: str)

Source from the content-addressed store, hash-verified

160 self.repl.send_to_stdin(self.current_line)
161
162 def add_input_character(self, e: str) -> None:
163 if e == "<SPACE>":
164 e = " "
165 if e.startswith("<") and e.endswith(">"):
166 return
167 assert len(e) == 1, "added multiple characters: %r" % e
168 logger.debug("adding normal char %r to current line", e)
169
170 self.current_line = (
171 self.current_line[: self.cursor_offset]
172 + e
173 + self.current_line[self.cursor_offset :]
174 )
175 self.cursor_offset += 1
176
177 def readline(self, size: int = -1) -> str:
178 if not isinstance(size, int):

Callers 1

process_eventMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected