Spaces:
Running
Running
File size: 918 Bytes
3567e13 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
import json
try:
with open("data/config.json", "r", encoding="UTF-8") as file:
config: dict = json.load(file)
except:
raise "ERROr ao carregar config.json"
def extrair_dados_config(config: dict = config):
try:
regras: str = "\n".join(
[
f"- {rule['rule_name']}: {rule['description']}"
for rule in config["config"]["rules"]
]
)
desenvolvedor_name: str = config["config"]["developers Hublast"]["wendellast"][
"name"
]
name_gui: str = config["config"]["name"]
country: str = config["config"]["status"]["country"]
desenvolvedor_description: dict = config["config"]["developers Hublast"]
return regras, desenvolvedor_name, desenvolvedor_description, name_gui, country
except KeyError as e:
print(f"Erro ao acessar a chave: {e}")
return None
|