broadfield-dev commited on
Commit
49b6209
·
verified ·
1 Parent(s): 5d1d174

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -1
app.py CHANGED
@@ -13,7 +13,24 @@ if not os.path.exists(UPLOAD_FOLDER):
13
  @app.route('/')
14
  def index():
15
  return render_template('index.html')
16
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  @app.route('/parse_code', methods=['POST'])
18
  def parse_code():
19
  code = None
 
13
  @app.route('/')
14
  def index():
15
  return render_template('index.html')
16
+
17
+ @app.route('/update_node', methods=['POST'])
18
+ def update_node():
19
+ data = request.get_json()
20
+ node_id = data.get('id')
21
+ new_source = data.get('source')
22
+ # Update node in stored nodes (e.g., in-memory or database)
23
+ # Re-parse to validate and update connections
24
+ return jsonify({'status': 'success'})
25
+
26
+ @app.route('/update_program', methods=['POST'])
27
+ def update_program():
28
+ data = request.get_json()
29
+ code = data.get('code')
30
+ parts, _ = parse_python_code(code)
31
+ # Update nodes and connections
32
+ return jsonify({'status': 'success'})
33
+
34
  @app.route('/parse_code', methods=['POST'])
35
  def parse_code():
36
  code = None