MCPcopy
hub / github.com/Jrohy/multi-v2ray / readchar

Function readchar

v2ray_util/util_core/utils.py:340–354  ·  view source on GitHub ↗
(prompt="")

Source from the content-addressed store, hash-verified

338 print(ColorStr.red(_("input error, please input again")))
339
340def readchar(prompt=""):
341 if prompt:
342 sys.stdout.write(prompt)
343 sys.stdout.flush()
344
345 fd = sys.stdin.fileno()
346 old_settings = termios.tcgetattr(fd)
347 try:
348 tty.setraw(sys.stdin.fileno())
349 ch = sys.stdin.read(1)
350 finally:
351 termios.tcsetattr(fd, termios.TCSADRAIN, old_settings)
352
353 print(ch)
354 return ch.strip()

Callers 15

manageFunction · 0.85
manageFunction · 0.85
manageFunction · 0.85
manageFunction · 0.85
del_portFunction · 0.85
del_userFunction · 0.85
dyn_portFunction · 0.85
new_uuidFunction · 0.85
tfoFunction · 0.85
selectMethod · 0.85
turn_onMethod · 0.85
modifyFunction · 0.85

Calls 1

writeMethod · 0.80

Tested by

no test coverage detected