Change config import

This commit is contained in:
Starthur 2022-10-15 13:03:11 +02:00
parent 4792d91de5
commit 1b4fb12854
Signed by: Starthur
GPG Key ID: 68AD34A2CF658E32
2 changed files with 3 additions and 5 deletions

Binary file not shown.

View File

@ -3,13 +3,11 @@ import datetime
from beaupy import * from beaupy import *
from beaupy.spinners import * from beaupy.spinners import *
from prettytable import PrettyTable from prettytable import PrettyTable
from . import config import config
############ ############
## CONFIG ## ## CONFIG ##
############ ############
CLIENT_ID_API42 = config.CLIENT_ID_API42
CLIENT_SECRET_API42 = config.CLIENT_SECRET_API42
ENDPOINT_API42 = "https://api.intra.42.fr/" ENDPOINT_API42 = "https://api.intra.42.fr/"
############### ###############
@ -24,8 +22,8 @@ class EVENT:
def get_api_cred() -> str: def get_api_cred() -> str:
payload = { payload = {
'grant_type' : 'client_credentials', 'grant_type' : 'client_credentials',
'client_id' : CLIENT_ID_API42, 'client_id' : config.CLIENT_ID_API42,
'client_secret' : CLIENT_SECRET_API42 'client_secret' : config.CLIENT_SECRET_API42
} }
r = requests.post(ENDPOINT_API42 + "/oauth/token", params=payload) r = requests.post(ENDPOINT_API42 + "/oauth/token", params=payload)