nastasiasnk commited on
Commit
e07f8da
1 Parent(s): f91ce39

Update imports_utils.py

Browse files
Files changed (1) hide show
  1. imports_utils.py +15 -8
imports_utils.py CHANGED
@@ -49,6 +49,21 @@ notion = Client(auth=notion_token)
49
 
50
 
51
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
 
53
  # query full database
54
  def fetch_all_database_pages(client, database_id):
@@ -140,10 +155,6 @@ def get_page_by_id(notion_db_pages, page_id):
140
  if pg["id"] == page_id:
141
  return pg
142
 
143
-
144
-
145
- CLIENT = SpeckleClient(host="https://speckle.xyz/")
146
- CLIENT.authenticate_with_token(token=userdata.get(speckleToken))
147
 
148
  def streamMatrices (speckleToken, stream_id, branch_name_dm, commit_id):
149
 
@@ -229,7 +240,3 @@ def fetchDistanceMatrices (stream_distance_matrices):
229
  return distance_matrices
230
 
231
 
232
-
233
-
234
- #df_dm_transport = distance_matrices[dm_transportStops]
235
-
 
49
 
50
 
51
 
52
+ # ----------------------------------------------------------------------------------
53
+
54
+ speckleToken = os.getenv('speckleToken')
55
+ if speckleToken is None:
56
+ raise Exception("Speckle token not found")
57
+ else:
58
+ print("Speckle token found successfully!")
59
+
60
+ #CLIENT = SpeckleClient(host="https://speckle.xyz/")
61
+ #CLIENT.authenticate_with_token(token=userdata.get(speckleToken))
62
+
63
+ CLIENT = SpeckleClient(host="https://speckle.xyz/")
64
+ account = get_default_account()
65
+ CLIENT.authenticate(token=speckleToken)
66
+
67
 
68
  # query full database
69
  def fetch_all_database_pages(client, database_id):
 
155
  if pg["id"] == page_id:
156
  return pg
157
 
 
 
 
 
158
 
159
  def streamMatrices (speckleToken, stream_id, branch_name_dm, commit_id):
160
 
 
240
  return distance_matrices
241
 
242