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

Function printer_profile_patch

src/astroprint/api/printerprofile.py:15–32  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13
14@api.route('/printer-profile', methods=['PATCH', 'GET'])
15def printer_profile_patch():
16 ppm = printerProfileManager()
17
18 if request.method == "PATCH":
19 changes = request.json
20 if changes.get('check_clear_bed') is False and ppm.data.get('check_clear_bed') is True:
21 printerManager().set_bed_clear(True)
22 ppm.set(changes)
23 ppm.save()
24
25 return jsonify()
26
27 else:
28
29 result = ppm.data.copy()
30 result.update( {"driverChoices": ppm.driverChoices()} )
31
32 return jsonify( result )
33
34@api.route('/temperature-preset', methods=['POST'])
35@restricted_access

Callers

nothing calls this directly

Calls 9

printerProfileManagerFunction · 0.90
printerManagerFunction · 0.90
updateMethod · 0.80
driverChoicesMethod · 0.80
getMethod · 0.45
set_bed_clearMethod · 0.45
setMethod · 0.45
saveMethod · 0.45
copyMethod · 0.45

Tested by

no test coverage detected