Spaces:
Running
Running
Update test.py
Browse files
test.py
CHANGED
@@ -80,7 +80,7 @@ async def auth_google(request: Request):
|
|
80 |
|
81 |
gmail_response = requests.get(gmail_url, headers={"Authorization": f"Bearer {access_token_new}"})
|
82 |
gmail_data = gmail_response.json()
|
83 |
-
|
84 |
# Check if there are messages in the response
|
85 |
if "messages" in gmail_data:
|
86 |
messages.extend(gmail_data["messages"])
|
@@ -201,9 +201,10 @@ async def test_websocket(websocket: WebSocket):
|
|
201 |
gmail_url += f"&pageToken={page_token}"
|
202 |
|
203 |
gmail_response = requests.get(gmail_url, headers={"Authorization": f"Bearer {access_token}"})
|
|
|
204 |
print(gmail_response)
|
205 |
gmail_data = gmail_response.json()
|
206 |
-
|
207 |
# Check if there are messages in the response
|
208 |
if "messages" in gmail_data:
|
209 |
messages.extend(gmail_data["messages"])
|
@@ -227,7 +228,10 @@ async def test_websocket(websocket: WebSocket):
|
|
227 |
|
228 |
|
229 |
print(messages)
|
|
|
230 |
print(filtered_data_list)
|
|
|
|
|
231 |
return filtered_data_list
|
232 |
|
233 |
async def event_generator(code:str):
|
@@ -250,6 +254,9 @@ async def test_websocket(websocket: WebSocket):
|
|
250 |
|
251 |
for i,message in enumerate(messages) :
|
252 |
print(i)
|
|
|
|
|
|
|
253 |
print(message)
|
254 |
|
255 |
if message:
|
|
|
80 |
|
81 |
gmail_response = requests.get(gmail_url, headers={"Authorization": f"Bearer {access_token_new}"})
|
82 |
gmail_data = gmail_response.json()
|
83 |
+
|
84 |
# Check if there are messages in the response
|
85 |
if "messages" in gmail_data:
|
86 |
messages.extend(gmail_data["messages"])
|
|
|
201 |
gmail_url += f"&pageToken={page_token}"
|
202 |
|
203 |
gmail_response = requests.get(gmail_url, headers={"Authorization": f"Bearer {access_token}"})
|
204 |
+
logging.info(f"{gmail_response}")
|
205 |
print(gmail_response)
|
206 |
gmail_data = gmail_response.json()
|
207 |
+
|
208 |
# Check if there are messages in the response
|
209 |
if "messages" in gmail_data:
|
210 |
messages.extend(gmail_data["messages"])
|
|
|
228 |
|
229 |
|
230 |
print(messages)
|
231 |
+
|
232 |
print(filtered_data_list)
|
233 |
+
logging.info(f"{filtered_data_list}")
|
234 |
+
|
235 |
return filtered_data_list
|
236 |
|
237 |
async def event_generator(code:str):
|
|
|
254 |
|
255 |
for i,message in enumerate(messages) :
|
256 |
print(i)
|
257 |
+
logging.info(f"{i}")
|
258 |
+
logging.info(f"{message}")
|
259 |
+
|
260 |
print(message)
|
261 |
|
262 |
if message:
|