MCPcopy Index your code
hub / github.com/tinode/chat / readLinesFromStdin

Function readLinesFromStdin

tn-cli/input_handler.py:12–24  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10
11# Prints prompt and reads lines from stdin.
12def readLinesFromStdin():
13 if tn_globals.IsInteractive:
14 while True:
15 try:
16 line = tn_globals.Prompt.prompt()
17 yield line
18 except EOFError as e:
19 # Ctrl+D.
20 break
21 else:
22 # iter(...) is a workaround for a python2 bug https://bugs.python.org/issue3907
23 for cmd in iter(sys.stdin.readline, ''):
24 yield cmd
25
26
27# Stdin reads a possibly multiline input from stdin and queues it for asynchronous processing.

Callers 1

stdinFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…