This repository was archived by the owner on May 11, 2026. It is now read-only.
Fix matrufsc save feature#8
Open
ramoslucas-lr wants to merge 3 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Esta alteração implementa uma refatoração nos mecanismos de persistência, tanto no frontend (JavaScript) quanto no backend (Python), com foco em modernizar os endpoints e aprimorar a lógica de feedback ao usuário após o salvamento de um horário.
Principais Alterações
Backend (py/capim.py)
load2.cgi) e salvamento (save2.cgi) foram renomeados para/loade/store, respectivamente. Isso pois as função de save e load no js não enviam mais comoload2.cgiesave2.cgi:Geração de Nome de Arquivo: A função
encoded_fnamefoi refatorada para aceitar oidentifierdiretamente e usar a codificação UTF-8 seguida de.hex()para gerar o nome do arquivo. Pelo mesmo motivo. Antes o identificar era esperado assim:/save2.cgi?q=1234. Porém, com o update para /store/id, o encodefname pode ser alterado para obter o identificador diretamente do path.Tratamento de Requisição: No endpoint
/store, a leitura do corpo da requisição (environ['wsgi.input']) agora considera oCONTENT_LENGTHdo ambiente WSGI.Retorno: O retorno de sucesso do endpoint
/storefoi ajustado parab'OK'(bytes).Frontend (js/main.js)
persistence.write_id(identifier)), e a atualização da flag de mudanças (mudancas = false) agora estão em um blocoelse.Não consegui rodar o matrufsc diretamente a ponto de testar a funcionalidade de salvar. Tive que fazer várias atualizações aqui que não faria sentido incluir no PR, pois acredito que isso seja devido principalmente à uma incompatibilidade entre as versões das bibliotecas que usei.