Also support extended sd file list (including size in bytes) from printer

See also #486 where support for SD_EXTENDED_DIR format was requested between the lines ;)
This commit is contained in:
Gina Häußge committed 2014-05-30 18:05:43 +02:00
1 parent 7414c921f3
commit ee31808522
4 files changed
+43 -12

No files matched your search

+6 -3
View File
@@ -51,14 +51,17 @@ def _getFileList(origin):
files = []
if sdFileList is not None:
for sdFile in sdFileList:
files.append({
for sdFile, sdSize in sdFileList:
file = {
"name": sdFile,
"origin": FileDestinations.SDCARD,
"refs": {
"resource": url_for(".readGcodeFile", target=FileDestinations.SDCARD, filename=sdFile, _external=True)
}
})
}
if sdSize is not None:
file.update({"size": sdSize})
files.append(file)
else:
files = gcodeManager.getAllFileData()
for file in files: