Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -236,11 +236,11 @@ html_content = """
|
|
236 |
# Endpoint to display the home page with the email processor's status
|
237 |
@app.get("/", response_class=HTMLResponse)
|
238 |
async def home():
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
global running
|
245 |
status = "Running" if running else "Stopped"
|
246 |
return HTMLResponse(content=html_content.replace("{{ status }}", status), status_code=200)
|
@@ -347,9 +347,6 @@ def get_latest_email(service):
|
|
347 |
except HttpError as error:
|
348 |
print(f'An error occurred: {error}')
|
349 |
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
if __name__ == "__main__":
|
354 |
|
355 |
print('starting')
|
|
|
236 |
# Endpoint to display the home page with the email processor's status
|
237 |
@app.get("/", response_class=HTMLResponse)
|
238 |
async def home():
|
239 |
+
service = authenticate_gmail()
|
240 |
+
logger.info(service)
|
241 |
+
print(service)
|
242 |
+
if service:
|
243 |
+
get_latest_email(service)
|
244 |
global running
|
245 |
status = "Running" if running else "Stopped"
|
246 |
return HTMLResponse(content=html_content.replace("{{ status }}", status), status_code=200)
|
|
|
347 |
except HttpError as error:
|
348 |
print(f'An error occurred: {error}')
|
349 |
|
|
|
|
|
|
|
350 |
if __name__ == "__main__":
|
351 |
|
352 |
print('starting')
|