[feature] #2: validação chave API
implementação da função 'aux.validarChaveAPI()'
This commit is contained in:
@ -9,8 +9,12 @@ import mplfinance as mpf
|
||||
# a chave da API 'CHAVE_API_DEMO'
|
||||
if not os.path.exists('modulos/constantes.py'):
|
||||
chave_api = input('Introduza a chave da API Demo de CoinGecko: ')
|
||||
with open('modulos/constantes.py', 'w') as f:
|
||||
f.write(f'CHAVE_API_DEMO = \'{chave_api}\'\n')
|
||||
if (not aux.validarChaveAPI(chave_api)):
|
||||
print(f'erro na validação da chave API {chave_api}')
|
||||
quit()
|
||||
else:
|
||||
with open('modulos/constantes.py', 'w') as f:
|
||||
f.write(f'CHAVE_API_DEMO = \'{chave_api}\'\n')
|
||||
|
||||
import modulos.coingecko_api as cgapi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user