Skip to content

Commit 8913afc

Browse files
committed
server bug fix
1 parent 5dda70c commit 8913afc

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

glimpse/electron-builder.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ win:
2727
- x64
2828
mac:
2929
target:
30-
- target: dmg
30+
- target: pkg
3131
arch:
3232
- arm64
3333

glimpse/local-server/server.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,13 @@
77

88
GRAPH = nx.MultiGraph()
99

10-
#Convert glm file to python dictionary
1110
def glm_to_dict( file_paths: list ) -> dict:
1211
glm_dicts = {}
1312
for glm_path in file_paths:
1413
glm_dicts[ path.basename(glm_path).split(".")[0] + ".json" ] = glm.load(glm_path)
1514

1615
return glm_dicts
1716

18-
#Converts glm dict to json
1917
def dict2json( glm_dict: dict ) -> str:
2018
glm_json = json.dumps( glm_dict, indent= 3 )
2119
return glm_json
@@ -152,6 +150,6 @@ def delete_edge(edgeID):
152150
#-------------------------- Start WebSocket Server --------------------------#
153151

154152
if __name__ == "__main__":
155-
socketio.run(app, port=5051, debug=True)
153+
socketio.run(app, port=5051, debug=False)
156154

157155
#-------------------------- End Start WebSocket Server --------------------------#

glimpse/main.js

+6-5
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const path = require("path");
1313
const { io } = require("socket.io-client");
1414
const fs = require("fs");
1515
const Ajv = require("ajv");
16+
// const kill = require("tree-kill");
1617
// const log = require('electron-log');
1718
// const { autoUpdater } = require("electron-updater");
1819

@@ -437,8 +438,8 @@ const initiateServer = () => {
437438
} else {
438439
const python = spawn("python", [path.join(__dirname, "local-server", "server.py")]);
439440
python.stdout.on("data", (data) => {
440-
// console.log("data: ", data.toString("utf8"));
441-
console.log("data: ", data);
441+
console.log("data: ", data.toString("utf8"));
442+
// console.log("data: ", data);
442443
});
443444
python.stderr.on("data", (data) => {
444445
console.log(`log: ${data}`); // when error
@@ -475,10 +476,10 @@ app.whenReady()
475476
});
476477
});
477478

479+
// app.on("before-quit", () => kill(process.pid));
480+
478481
app.on("window-all-closed", () => {
479-
if (process.platform !== "darwin") {
480-
app.quit();
481-
}
482+
app.quit();
482483
});
483484

484485
app.on("activate", () => {

0 commit comments

Comments
 (0)