MCPcopy Create free account
hub / github.com/AshampooSystems/boden / handleBasicMessage

Function handleBasicMessage

bauer/cmakelib.py:354–374  ·  view source on GitHub ↗
(proc, obj, debug)

Source from the content-addressed store, hash-verified

352 sys.exit(1)
353
354def handleBasicMessage(proc, obj, debug):
355 if 'sendRaw' in obj:
356 data = obj['sendRaw']
357 if debug: print("Sending raw:", data)
358 writeRawData(proc, data)
359 return True
360 elif 'send' in obj:
361 data = obj['send']
362 if debug: print("Sending:", json.dumps(data))
363 writePayload(proc, data)
364 return True
365 elif 'recv' in obj:
366 data = obj['recv']
367 if debug: print("Waiting for:", json.dumps(data))
368 waitForMessage(proc, data)
369 return True
370 elif 'message' in obj:
371 print("MESSAGE:", obj["message"])
372 sys.stdout.flush()
373 return True
374 return False
375
376def shutdownProc(proc):
377 # Tell the server to exit.

Callers

nothing calls this directly

Calls 3

writeRawDataFunction · 0.85
writePayloadFunction · 0.85
waitForMessageFunction · 0.85

Tested by

no test coverage detected