Fixed file so it passes the linter

This commit is contained in:
jeffser 2024-08-04 20:28:27 -06:00
parent 44640b7e53
commit 634ac122d9

View File

@ -1,9 +1,17 @@
"""
Moves the descriptions of models to src/available_models_descriptions.py
so they can be translated
"""
import json
with open('src/available_models.json', 'r') as f:
data = json.load(f)
results = 'descriptions = {\n'
for key, value in data.items():
results += f" '{key}': _(\"{value['description']}\"),\n"
results += '}'
with open('src/available_models_descriptions.py', 'w+') as f:
f.write(results)
if __name__ == "__main__":
with open('src/available_models.json', 'r', encoding="utf-8") as f:
data = json.load(f)
RESULTS = 'descriptions = {\n'
for key, value in data.items():
RESULTS += f" '{key}': _(\"{value['description']}\"),\n"
RESULTS += '}'
with open('src/available_models_descriptions.py', 'w+', encoding="utf-8") as f:
f.write(results)