MCPcopy Create free account
hub / github.com/CITGuru/PyInquirer / readline

Method readline

tests/helpers.py:138–150  ·  view source on GitHub ↗

Read one line from the pseudoterminal, and return it as unicode. Can block if there is nothing to read. Raises :exc:`EOFError` if the terminal was closed. note: this is a specialized version that does not have \r\n at the end

(self)

Source from the content-addressed store, hash-verified

136 return self.decoder.decode(b, final=False)
137
138 def readline(self):
139 """Read one line from the pseudoterminal, and return it as unicode.
140
141 Can block if there is nothing to read. Raises :exc:`EOFError` if the
142 terminal was closed.
143 note: this is a specialized version that does not have \r\n at the end
144 """
145 # TODO implement a timeout
146 b = super(SimplePty, self).readline().strip()
147 s = self.decoder.decode(b, final=False)
148 if self.skip_ansi:
149 s = remove_ansi_escape_sequences(s)
150 return s
151
152 def write(self, s):
153 """Write the unicode string ``s`` to the pseudoterminal.

Callers 2

test_example_appFunction · 0.80
test_example_app_regexFunction · 0.80

Calls 1

Tested by 2

test_example_appFunction · 0.64
test_example_app_regexFunction · 0.64