Abimael Torcate Claude commited on
Commit
9c864b0
·
1 Parent(s): fc2a1ca

Fix Python syntax error in app.py

Browse files

- Correct indentation of code block after try/except
- Move all main application code inside the main try block
- Fix SyntaxError: expected 'except' or 'finally' block
- Application should now run without syntax errors

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

Files changed (1) hide show
  1. app.py +42 -42
app.py CHANGED
@@ -47,53 +47,53 @@ def main():
47
  st.info("💡 O Hugging Face Space pode estar bloqueado para acessar servidores externos")
48
  st.code(traceback.format_exc())
49
  st.stop()
50
-
51
- col1, col2, col3 = st.columns([1, 2, 1])
52
-
53
- with col2:
54
- st.markdown("### Bem-vindo!")
55
- st.markdown("Crie e gerencie seus checklists personalizados de forma simples e eficiente.")
56
 
57
- st.markdown("")
58
 
59
- col1, col2, col3 = st.columns(3)
60
- with col1:
61
- if st.button("➕ Novo Checklist", type="primary", use_container_width=True):
62
- st.switch_page("pages/criar_checklist.py")
63
  with col2:
64
- if st.button("📊 Dashboard Geral", use_container_width=True):
65
- st.switch_page("pages/dashboard_geral.py")
66
- with col3:
67
- if st.button("🤖 Relatórios IA", use_container_width=True):
68
- st.switch_page("pages/relatorio_ia.py")
69
-
70
- # Buscar checklists do banco
71
- try:
72
- checklists = get_all_checklists()
73
 
74
- if checklists:
75
- st.markdown("### Seus Checklists")
76
- for checklist in checklists:
77
- col_name, col_process, col_date, col_btn = st.columns([3, 2, 1.5, 1])
78
- with col_name:
79
- st.write(f"📋 {checklist['name']}")
80
- with col_process:
81
- if checklist['numero_processo']:
82
- st.caption(f"🔢 {checklist['numero_processo']}")
83
- else:
84
- st.caption("🔢 Sem processo")
85
- with col_date:
86
- st.caption(checklist['created_at'].strftime("%d/%m/%Y"))
87
- with col_btn:
88
- if st.button("Ver", key=f"view_{checklist['id']}"):
89
- st.session_state.current_checklist_id = checklist['id']
90
- st.switch_page("pages/dashboard.py")
91
- else:
92
- st.info("Você ainda não tem checklists. Clique em 'Novo Checklist' para criar o primeiro!")
93
 
94
- except Exception as e:
95
- st.error(f"Erro ao buscar checklists: {str(e)}")
96
- st.code(traceback.format_exc())
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
97
 
98
  except Exception as e:
99
  st.error(f"❌ Erro crítico na aplicação: {str(e)}")
 
47
  st.info("💡 O Hugging Face Space pode estar bloqueado para acessar servidores externos")
48
  st.code(traceback.format_exc())
49
  st.stop()
 
 
 
 
 
 
50
 
51
+ col1, col2, col3 = st.columns([1, 2, 1])
52
 
 
 
 
 
53
  with col2:
54
+ st.markdown("### Bem-vindo!")
55
+ st.markdown("Crie e gerencie seus checklists personalizados de forma simples e eficiente.")
 
 
 
 
 
 
 
56
 
57
+ st.markdown("")
58
+
59
+ col1, col2, col3 = st.columns(3)
60
+ with col1:
61
+ if st.button("➕ Novo Checklist", type="primary", use_container_width=True):
62
+ st.switch_page("pages/criar_checklist.py")
63
+ with col2:
64
+ if st.button("📊 Dashboard Geral", use_container_width=True):
65
+ st.switch_page("pages/dashboard_geral.py")
66
+ with col3:
67
+ if st.button("🤖 Relatórios IA", use_container_width=True):
68
+ st.switch_page("pages/relatorio_ia.py")
69
+
70
+ # Buscar checklists do banco
71
+ try:
72
+ checklists = get_all_checklists()
 
 
 
73
 
74
+ if checklists:
75
+ st.markdown("### Seus Checklists")
76
+ for checklist in checklists:
77
+ col_name, col_process, col_date, col_btn = st.columns([3, 2, 1.5, 1])
78
+ with col_name:
79
+ st.write(f"📋 {checklist['name']}")
80
+ with col_process:
81
+ if checklist['numero_processo']:
82
+ st.caption(f"🔢 {checklist['numero_processo']}")
83
+ else:
84
+ st.caption("🔢 Sem processo")
85
+ with col_date:
86
+ st.caption(checklist['created_at'].strftime("%d/%m/%Y"))
87
+ with col_btn:
88
+ if st.button("Ver", key=f"view_{checklist['id']}"):
89
+ st.session_state.current_checklist_id = checklist['id']
90
+ st.switch_page("pages/dashboard.py")
91
+ else:
92
+ st.info("Você ainda não tem checklists. Clique em 'Novo Checklist' para criar o primeiro!")
93
+
94
+ except Exception as e:
95
+ st.error(f"Erro ao buscar checklists: {str(e)}")
96
+ st.code(traceback.format_exc())
97
 
98
  except Exception as e:
99
  st.error(f"❌ Erro crítico na aplicação: {str(e)}")