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

Method copyFileToLocal

src/astroprint/externaldrive/base.py:104–119  ·  view source on GitHub ↗
(self, origin, destination, observerId)

Source from the content-addressed store, hash-verified

102 d.close()
103
104 def copyFileToLocal(self, origin, destination, observerId):
105 try:
106 secureFilename = secure_filename(origin.split('/')[-1:][0])
107 self.copy(
108 self._cleanFileLocation(origin),
109 self._cleanFileLocation(destination) + '/' + secureFilename,
110 self._progressCb,
111 observerId
112 )
113
114 return secureFilename
115
116 except Exception as e:
117 self._logger.error("copy print file to local folder failed", exc_info = True)
118
119 return False
120
121 def _progressCb(self, progress,file,observerId):
122 self._eventManager.fire(

Callers

nothing calls this directly

Calls 3

copyMethod · 0.95
_cleanFileLocationMethod · 0.95
errorMethod · 0.45

Tested by

no test coverage detected