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

Method getLocalFiles

src/astroprint/plugin/services/files.py:108–123  ·  view source on GitHub ↗
(self, sendResponse)

Source from the content-addressed store, hash-verified

106 sendResponse({ 'baseFolder' : externalDriveManager().getBaseFolder(key) })
107
108 def getLocalFiles(self, sendResponse):
109 try:
110 try:
111 files = self._getLocalFileList(FileDestinations.LOCAL)
112 except:
113 pass
114
115 try:
116 files.extend(self._getLocalFileList(FileDestinations.SDCARD))
117 except:
118 pass
119 sendResponse( { 'files': files, 'free': util.getFreeBytes(settings().getBaseFolder("uploads")) })
120
121 except Exception as e:
122 self._logger.error("files can not be obtained", exc_info = True)
123 sendResponse('no_files_obtained',True)
124
125 def _getLocalFileList(self, data):
126

Callers

nothing calls this directly

Calls 4

_getLocalFileListMethod · 0.95
settingsFunction · 0.90
getBaseFolderMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected