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

Method localFileExists

src/astroprint/externaldrive/base.py:61–69  ·  view source on GitHub ↗
(self, filename)

Source from the content-addressed store, hash-verified

59 return printerManager().fileManager.SUPPORTED_EXTENSIONS
60
61 def localFileExists(self, filename):
62 try:
63 filename = secure_filename(filename)
64 s = open(self._cleanFileLocation(self.getBaseFolder('uploads') + '/' + filename), 'rb')
65 except Exception as e:
66 return False
67
68 s.close()
69 return True
70
71 def copy(self, src, dst, progressCb, observerId):
72 blksize = 1048576 # 1MiB

Callers

nothing calls this directly

Calls 3

_cleanFileLocationMethod · 0.95
getBaseFolderMethod · 0.95
closeMethod · 0.45

Tested by

no test coverage detected