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

Function readPrintFilesForOrigin

src/astroprint/api/files.py:32–41  ·  view source on GitHub ↗
(origin)

Source from the content-addressed store, hash-verified

30
31@api.route("/files/<string:origin>", methods=["GET"])
32def readPrintFilesForOrigin(origin):
33 if origin not in [FileDestinations.LOCAL, FileDestinations.SDCARD]:
34 return make_response("Unknown origin: %s" % origin, 404)
35
36 files = _getFileList(origin)
37
38 if origin == FileDestinations.LOCAL:
39 return jsonify(files=files, free=util.getFreeBytes(settings().getBaseFolder("uploads")))
40 else:
41 return jsonify(files=files)
42
43
44def _getFileDetails(origin, filename):

Callers

nothing calls this directly

Calls 3

settingsFunction · 0.90
_getFileListFunction · 0.85
getBaseFolderMethod · 0.45

Tested by

no test coverage detected