MCPcopy Create free account
hub / github.com/AstroPrint/AstroBox / executeRoutine

Function executeRoutine

src/astroprint/api/printer.py:508–523  ·  view source on GitHub ↗
(routine)

Source from the content-addressed store, hash-verified

506
507@api.route("/printer/execute-routine/<string:routine>", methods=["POST"])
508def executeRoutine(routine):
509
510 if not routine:
511 return make_response("Routine name needed", 400)
512
513 pm = printerManager()
514
515 if not pm.isOperational():
516 return make_response("No Printer connected", 404)
517
518 executedSuccess = pm.executeRoutine(routine)
519
520 if not executedSuccess:
521 return make_response(routine + " routine executing failed", 400)
522 else:
523 return make_response(routine + " executed successfuly", 200)
524
525@api.route("/printer/prompt/choice", methods=['POST'])
526def postHostCommand():

Callers

nothing calls this directly

Calls 3

printerManagerFunction · 0.90
executeRoutineMethod · 0.80
isOperationalMethod · 0.45

Tested by

no test coverage detected