(routine)
| 506 | |
| 507 | @api.route("/printer/execute-routine/<string:routine>", methods=["POST"]) |
| 508 | def 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']) |
| 526 | def postHostCommand(): |
nothing calls this directly
no test coverage detected