Spaces:
Sleeping
Sleeping
Update API.py
Browse files
API.py
CHANGED
|
@@ -19,7 +19,7 @@ from google.oauth2 import service_account
|
|
| 19 |
import pygsheets
|
| 20 |
import numpy as np
|
| 21 |
from datetime import datetime
|
| 22 |
-
|
| 23 |
from threading import Thread, Event
|
| 24 |
|
| 25 |
prjnamesURL= 'https://docs.google.com/spreadsheets/d/1I4P7wiCXTAwnld0YQfUJC8bPtuiETna1HGWVuHbuDBk/edit#gid=0'
|
|
@@ -82,14 +82,14 @@ def createSheet():
|
|
| 82 |
|
| 83 |
# %%
|
| 84 |
def APIValues():
|
| 85 |
-
query={'loginname':'
|
| 86 |
#token="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiQURSIiwibmJmIjoiMTY4MDg1OTgzMyIsImV4cCI6IjE2ODA5MDMwMzMifQ.-FULhKD_M-cyIdSMMIYDlEo9DoZtc00yIlyXIPuyLZI"
|
| 87 |
head={'Content-Type':'application/json'}
|
| 88 |
-
response=requests.post(url="https://
|
| 89 |
key=response.text
|
| 90 |
|
| 91 |
head={'Content-Type':'application/json;charset=UTF-8',"Authorization":'Bearer {}'.format(key)}
|
| 92 |
-
response=requests.post(url="https://
|
| 93 |
dict1=response.json()
|
| 94 |
return dict1
|
| 95 |
|
|
|
|
| 19 |
import pygsheets
|
| 20 |
import numpy as np
|
| 21 |
from datetime import datetime
|
| 22 |
+
from save_thread_result import ThreadWithResult
|
| 23 |
from threading import Thread, Event
|
| 24 |
|
| 25 |
prjnamesURL= 'https://docs.google.com/spreadsheets/d/1I4P7wiCXTAwnld0YQfUJC8bPtuiETna1HGWVuHbuDBk/edit#gid=0'
|
|
|
|
| 82 |
|
| 83 |
# %%
|
| 84 |
def APIValues():
|
| 85 |
+
query={'loginname':'Marthe','password':'marthemain'}
|
| 86 |
#token="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiQURSIiwibmJmIjoiMTY4MDg1OTgzMyIsImV4cCI6IjE2ODA5MDMwMzMifQ.-FULhKD_M-cyIdSMMIYDlEo9DoZtc00yIlyXIPuyLZI"
|
| 87 |
head={'Content-Type':'application/json'}
|
| 88 |
+
response=requests.post(url="https://console.trevorsadd.co.uk/account/login",json=query,headers=head)
|
| 89 |
key=response.text
|
| 90 |
|
| 91 |
head={'Content-Type':'application/json;charset=UTF-8',"Authorization":'Bearer {}'.format(key)}
|
| 92 |
+
response=requests.post(url="https://console.trevorsadd.co.uk/project/getprojectslist",json=query,headers=head)
|
| 93 |
dict1=response.json()
|
| 94 |
return dict1
|
| 95 |
|