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

Function fileProcessingFinished

src/astroprint/api/files.py:137–148  ·  view source on GitHub ↗

Callback for when the file processing (upload, optional slicing, addition to analysis queue) has finished. Depending on the file's destination triggers either streaming to SD card or directly calls selectAndOrPrint.

(filename, absFilename, destination)

Source from the content-addressed store, hash-verified

135 return make_response("Trying to overwrite file that is currently being printed: %s" % currentFilename, 409)
136
137 def fileProcessingFinished(filename, absFilename, destination):
138 """
139 Callback for when the file processing (upload, optional slicing, addition to analysis queue) has
140 finished.
141
142 Depending on the file's destination triggers either streaming to SD card or directly calls selectAndOrPrint.
143 """
144 if destination == FileDestinations.SDCARD:
145 return filename, printerManager().addSdFile(filename, absFilename, selectAndOrPrint)
146 else:
147 selectAndOrPrint(filename, absFilename, destination)
148 return filename
149
150 def selectAndOrPrint(filename, absFilename, destination):
151 """

Callers

nothing calls this directly

Calls 3

printerManagerFunction · 0.90
selectAndOrPrintFunction · 0.85
addSdFileMethod · 0.80

Tested by

no test coverage detected