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

Method startFileTransfer

src/astroprint/printer/marlin/comm.py:418–428  ·  view source on GitHub ↗
(self, filename, localFilename, remoteFilename)

Source from the content-addressed store, hash-verified

416 self._changeState(self.STATE_ERROR)
417
418 def startFileTransfer(self, filename, localFilename, remoteFilename):
419 if not self.isOperational() or self.isBusy():
420 logging.info("Printer is not operation or busy")
421 return
422
423 self._currentFile = StreamingGcodeFileInformation(filename, localFilename, remoteFilename)
424 self._currentFile.start()
425
426 self.sendCommand("M28 %s" % remoteFilename)
427 eventManager().fire(Events.TRANSFER_STARTED, {"local": localFilename, "remote": remoteFilename})
428 self._callback.mcFileTransferStarted(remoteFilename, self._currentFile.getFilesize())
429
430 def selectFile(self, filename, sd):
431 if self.isBusy():

Callers 1

addSdFileMethod · 0.80

Calls 9

isOperationalMethod · 0.95
isBusyMethod · 0.95
sendCommandMethod · 0.95
eventManagerFunction · 0.90
fireMethod · 0.80
getFilesizeMethod · 0.80
startMethod · 0.45
mcFileTransferStartedMethod · 0.45

Tested by

no test coverage detected