309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
|
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
|
+
-
+
+
+
+
+
-
+
+
|
cmd = sys.stdin.readline()
# Check for eof
if cmd == "":
break
answer = send_command(options.sock, cmd.rstrip())
idx = answer.index('\n')
print(answer[idx+1:], end="")
eol = answer.endswith("\n")
sys.stdout.flush()
elif options.sock in readfd:
print("UNSOLICITED MESSAGE %" +
options.sock.readline().rstrip())
options.sock.recv(1000).decode("utf-8").rstrip())
eol = True
except KeyboardInterrupt:
if not eol:
print("")
eol = True
print("Keyboard interrupt")
if not eol:
print("")
def cmd_reset(options):
""" vws reset """
print(send_command(options.sock, 'system_reset'))
def cmd_save(options):
""" vws save """
|