removed spliting , logging delete handler in filehandler
This commit is contained in:
@@ -94,7 +94,7 @@ module.exports = {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
loadMacrosGcode: async function () {
|
loadMacrosGcode: async function () {
|
||||||
if(this.tab==0){
|
if (this.tab == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const file = this.fileName;
|
const file = this.fileName;
|
||||||
@@ -103,7 +103,8 @@ module.exports = {
|
|||||||
cache: "no-cache",
|
cache: "no-cache",
|
||||||
});
|
});
|
||||||
if (response.status == 200) {
|
if (response.status == 200) {
|
||||||
const text = (await response.text()).split(" ").join("\n");
|
const text = await response.text();
|
||||||
|
console.log("text: ", text);
|
||||||
this.newGcode = text;
|
this.newGcode = text;
|
||||||
} else {
|
} else {
|
||||||
console.error("error loading");
|
console.error("error loading");
|
||||||
|
|||||||
@@ -133,6 +133,9 @@ class FileHandler(bbctrl.APIHandler):
|
|||||||
filebasename = os.path.basename(url_unescape(filename))
|
filebasename = os.path.basename(url_unescape(filename))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
filename=self.get_upload(filebasename).encode('utf8')
|
||||||
|
self.get_log('FileHandler').info(
|
||||||
|
'138 FileName: ' + filename)
|
||||||
with open(self.get_upload(filebasename).encode('utf8'), 'r') as f:
|
with open(self.get_upload(filebasename).encode('utf8'), 'r') as f:
|
||||||
self.write(f.read())
|
self.write(f.read())
|
||||||
except Exception:
|
except Exception:
|
||||||
|
|||||||
Reference in New Issue
Block a user