mirror of
https://github.com/thiagoralves/OpenPLC_v3.git
synced 2026-08-18 19:48:42 +08:00
[RTOP-23] PR review fix
This commit is contained in:
@@ -33,8 +33,11 @@ webserver/core/glue_generator
|
||||
webserver/core/openplc
|
||||
webserver/iec2c
|
||||
webserver/st_optimizer
|
||||
webserver/active_program
|
||||
utils/libmodbus_src/src/.libs/*
|
||||
utils/libmodbus_src/tests/.libs/*
|
||||
webserver/scripts/openplc_driver
|
||||
webserver/scripts/openplc_platform
|
||||
|
||||
# Runtime directories
|
||||
.venv
|
||||
@@ -32,7 +32,7 @@ def restapi_plc_get(command):
|
||||
result = _handler_callback_get(command, data)
|
||||
return jsonify(result), 200
|
||||
except Exception as e:
|
||||
print(f"Error in restapi_start_plc: {e}")
|
||||
print(f"Error in restapi_plc_get: {e}")
|
||||
return jsonify({"error": str(e)}), 500
|
||||
|
||||
@restapi_bp.route("/<command>", methods=["POST"])
|
||||
@@ -47,5 +47,5 @@ def restapi_plc_post(command):
|
||||
result = _handler_callback_post(command, data)
|
||||
return jsonify(result), 200
|
||||
except Exception as e:
|
||||
print(f"Error in restapi_start_plc_post: {e}")
|
||||
print(f"Error in restapi_plc_post: {e}")
|
||||
return jsonify({"error": str(e)}), 500
|
||||
|
||||
@@ -924,7 +924,7 @@ def upload_program():
|
||||
if (prog_file.filename == ''):
|
||||
return draw_blank_page() + "<h2>Error</h2><p>You need to select a file to be uploaded!<br><br>Use the back-arrow on your browser to return</p></div></div></div></body></html>"
|
||||
|
||||
# TODO colocar em outra funçao
|
||||
# TODO realocate to another function
|
||||
filename = str(random.randint(1,1000000)) + ".st"
|
||||
prog_file.save(os.path.join('st_files', filename))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user