serJD commited on
Commit
8d0d57c
·
verified ·
1 Parent(s): faefffe

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -3
app.py CHANGED
@@ -4,6 +4,7 @@ import sys
4
  import time
5
  import copy
6
  from notion_client import Client
 
7
 
8
  from specklepy.api.client import SpeckleClient
9
  from specklepy.api.credentials import get_default_account, get_local_accounts
@@ -169,6 +170,8 @@ async def update_streams(request: Request):
169
  # Initialize flag
170
  should_continue = False
171
 
 
 
172
  # Read the request body as JSON
173
  payload = await request.json()
174
 
@@ -178,7 +181,7 @@ async def update_streams(request: Request):
178
  print(config)
179
  print("============= rest ==============")
180
 
181
-
182
  payload = payload["payload"]
183
  # Check if the payload structure matches the expected format
184
  # Assuming payload["event"]["event_name"] gives you the event type
@@ -199,7 +202,9 @@ async def update_streams(request: Request):
199
  if streamName in config:
200
  if branchName in config[streamName]:
201
  print("found branchName", branchName)
 
202
  stream_config = config[streamName][branchName]
 
203
  should_continue = True
204
  else:
205
  print(f"Branch name {branchName} not found in config for stream {streamName}.")
@@ -210,8 +215,8 @@ async def update_streams(request: Request):
210
 
211
  # If the flag is True, continue running the main part of the code
212
  if should_continue:
213
- print("is continuing with branch name: ", branchName)
214
- config_entry = config[streamName][branchName]
215
  print("--> selected config subset", config_entry)
216
  STREAM_NAME = config_entry["STREAM_NAME"]
217
  STREAM_ID = config_entry["STREAM_ID"]
 
4
  import time
5
  import copy
6
  from notion_client import Client
7
+ import copy
8
 
9
  from specklepy.api.client import SpeckleClient
10
  from specklepy.api.credentials import get_default_account, get_local_accounts
 
170
  # Initialize flag
171
  should_continue = False
172
 
173
+ finalBranchName = None
174
+
175
  # Read the request body as JSON
176
  payload = await request.json()
177
 
 
181
  print(config)
182
  print("============= rest ==============")
183
 
184
+
185
  payload = payload["payload"]
186
  # Check if the payload structure matches the expected format
187
  # Assuming payload["event"]["event_name"] gives you the event type
 
202
  if streamName in config:
203
  if branchName in config[streamName]:
204
  print("found branchName", branchName)
205
+ finalBranchName = copy(branchName)
206
  stream_config = config[streamName][branchName]
207
+ print(".----> first config subset", stream_config )
208
  should_continue = True
209
  else:
210
  print(f"Branch name {branchName} not found in config for stream {streamName}.")
 
215
 
216
  # If the flag is True, continue running the main part of the code
217
  if should_continue:
218
+ print("is continuing with branch name: ", branchName, "fin branchname", finalBranchName)
219
+ config_entry = config[streamName][finalBranchName]
220
  print("--> selected config subset", config_entry)
221
  STREAM_NAME = config_entry["STREAM_NAME"]
222
  STREAM_ID = config_entry["STREAM_ID"]