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

Function readPrintFile

src/astroprint/api/files.py:207–215  ·  view source on GitHub ↗
(target, filename)

Source from the content-addressed store, hash-verified

205
206@api.route("/files/<string:target>/<path:filename>", methods=["GET"])
207def readPrintFile(target, filename):
208 if not target in [FileDestinations.LOCAL, FileDestinations.SDCARD]:
209 return make_response("Unknown target: %s" % target, 404)
210
211 file = _getFileDetails(target, filename)
212 if not file:
213 return make_response("File not found on '%s': %s" % (target, filename), 404)
214
215 return jsonify(file)
216
217
218@api.route("/files/<string:target>/<path:filename>", methods=["POST"])

Callers

nothing calls this directly

Calls 1

_getFileDetailsFunction · 0.85

Tested by

no test coverage detected