Spaces:
Sleeping
Sleeping
Download document/mesa_content.py from gui-sparim/teste_docs: direct link, hf CLI and curl.
- Browser
- Download file 685 Bytes
-
https://huggingface.co/spaces/gui-sparim/teste_docs/resolve/main/document/mesa_content.py
- Command line
-
hf download hf://spaces/gui-sparim/teste_docs/document/mesa_content.py
-
curl -L -o mesa_content.py https://huggingface.co/spaces/gui-sparim/teste_docs/resolve/main/document/mesa_content.py
685 Bytes
| """Versioned documentary content extracted from MESA, never manually duplicated.""" | |
| import json | |
| from functools import lru_cache | |
| from config.settings import BASE_DIR | |
| def current_content(): | |
| return json.loads((BASE_DIR / 'config/mesa_documentacao.json').read_text()) | |
| def content_for(source): | |
| saved = source.get('documentacaoTecnica') or {} | |
| keys = ('notas','referencias','normas','redutores_termos','funcoes_mqc','criterios_fc','descricoes_modelo','requisitos_modelo') | |
| valid = isinstance(saved,dict) and saved.get('versao') == 1 and saved.get('identificador') and all(key in saved for key in keys) | |
| return saved if valid else current_content() | |