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

Function emptyFolder

src/astroprint/api/settings.py:27–35  ·  view source on GitHub ↗
(folder)

Source from the content-addressed store, hash-verified

25
26#empty all folders
27def emptyFolder(folder):
28 if folder and os.path.exists(folder):
29 for f in os.listdir(folder):
30 p = os.path.join(folder, f)
31 try:
32 if os.path.isfile(p):
33 os.unlink(p)
34 except Exception:
35 pass
36
37@api.route("/settings", methods=['GET'])
38def handleSettings():

Callers 4

resetFactorySettingsMethod · 0.85
clearFileStorageMethod · 0.85
resetFactorySettingsFunction · 0.85
clearUploadsFunction · 0.85

Calls 2

joinMethod · 0.80
unlinkMethod · 0.80

Tested by

no test coverage detected