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

Function uploadSoftwarePlugin

src/astroprint/api/settings.py:371–383  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

369@api.route("/settings/software/plugins", methods=["POST"])
370@restricted_access
371def uploadSoftwarePlugin():
372 if not "file" in request.files.keys():
373 return make_response("No file included", 400)
374
375 file = request.files["file"]
376
377 pm = pluginManager()
378 r = pm.checkFile(file)
379
380 if 'error' in r:
381 return make_response(r['error'], 500)
382 else:
383 return jsonify(r)
384
385@api.route("/settings/software/plugins", methods=["DELETE"])
386@restricted_access

Callers

nothing calls this directly

Calls 2

pluginManagerFunction · 0.90
checkFileMethod · 0.80

Tested by

no test coverage detected