Skip to content

Commit db873a9

Browse files
newversion 3.0 (#118)
* Update main.py * Update README.md * Update escolasegura.py * Create localCSS.css * Update utils.py * Update localCSS.css * Add files via upload * Add files via upload * Add files via upload * Add files via upload * Update escolasegura.py * Update starting * update master with new version (#111) * Delete inicio2.py * Update inicio.py * Update specialistContainer.py * Update escolasegura.py * Update escolasegura.py * Update escolasegura.py * Add files via upload * Update escolasegura.py * Update inicio.py * Update escolasegura.py * Update inicio.py * Update inicio.py * Update header.py * Updatemaster (#112) * Add files via upload * Update localCSS.css * Update utils.py * Update escolasegura.py * Add files via upload * Add files via upload * Delete footerContainer.py * Delete main.py * Delete monitorContainer.py * Delete planContainer.py * Delete prepareContainer.py * Add files via upload * Update simulacao.py * Update inicio.py * Update master (#113) * Update simulacao.py * Update get_school_return_data.py * Update localCSS.css * update-master-thaissugestions (#114) * Update simulacao.py * Update get_school_return_data.py * Update localCSS.css * Update localCSS.css * Update utils.py * Update inicio.py * Add files via upload * Update inicio.css * Update inicio.css * Update utils.py * Update localCSS.css * Update requirements.txt * Update simulacao.py * Update inicio.css * Update inicio.py * Update utils.py * Update textmaster (#115) * Add files via upload * Add files via upload * Add files via upload * Update inicio.py * Update passos.py * Update passos.py * Update utils.py * Update utils.py * Update localCSS.css * Update about.py * Update passos.py * Update simulacao.py * Update duvidas.py * Update header.py * Update inicio.py * Update about.py * Update simulacao.py * Update passos.py * Update passos.py * Update simulacao.py * Update simulacao.py * Update footer.py * Update footer.py * Delete inicio2.py * Update header.py * Update inicio.py Co-authored-by: gabriellecontazap <[email protected]>
1 parent 84a286d commit db873a9

29 files changed

+3218
-1718
lines changed

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ RUN set -x \
3535
# Create virtualenv
3636
&& virtualenv -p python3 venv \
3737
#Downloads the hacked streamlit
38-
&& wget https://github.com/ImpulsoGov/streamlitlastversion/raw/main/builds/streamlit-0.70.1-py2.py3-none-any.whl \
38+
&& wget https://github.com/ImpulsoGov/streamlitlastversion/raw/main/builds/streamlit-0.70.2-py2.py3-none-any.whl \
3939
# Install Python libs
4040
&& . venv/bin/activate \
4141
&& pip install --default-timeout=100 future \
4242
&& pip install --upgrade -r requirements.txt \
4343
# Install streamlit
44-
&& pip install --no-cache-dir streamlit-0.70.1-py2.py3-none-any.whl\
44+
&& pip install --no-cache-dir streamlit-0.70.2-py2.py3-none-any.whl\
4545
&& python -m ipykernel install --user --name=venv
4646
ADD . ${USER_HOME}
4747
USER root

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@ streamlit run escolasegura.py
5353
make docker-build-dev
5454
```
5555

56-
- Windows:
56+
- Windows::
5757

5858
[wip rodando com o docker]

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ mechanize
1616
flask
1717
flask-cors
1818
ipywidgets
19+
matplotlib

src/escolasegura.py

Lines changed: 140 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
# coding=utf-8
22
import streamlit as st
33
import yaml
4-
import session
54
import time
6-
7-
import pages.main as es
8-
import pages.about as ab
9-
5+
from pages import inicio, inicio2
6+
import pages.about as sobre
7+
import pages.passos as guiapassos
8+
import pages.simulacao as simulacao
9+
import pages.referencesContainer as referencias
10+
import pages.duvidas as duvidas
11+
import socket
1012
import utils
1113
import pages.simulationContainer as sc
1214
from PIL import Image
15+
import pathlib
16+
from flask import Flask, request
17+
from flask.wrappers import Request
1318

1419

1520
st.set_page_config(
@@ -18,58 +23,148 @@
1823
layout='wide',
1924
initial_sidebar_state='collapsed')
2025

26+
# Remove menu da visualizacao
27+
hide_streamlit_style = """
28+
<style>
29+
#MainMenu {visibility: hidden;}
30+
footer {visibility: hidden;}
31+
</style>
32+
33+
"""
34+
st.markdown(hide_streamlit_style, unsafe_allow_html=True)
35+
36+
# # SESSION STATE
37+
# time.sleep(
38+
# 0.05
39+
# ) # minimal wait time so we give time for the user session to appear in steamlit
40+
# session_state = session.SessionState.get(
41+
# key=session.get_user_id(),
42+
# update=False,
43+
# state_name="Acre",
44+
# state_id="AC",
45+
# city_name="Todos",
46+
# administrative_level="Todos",
47+
# refresh=False,
48+
# reset=False,
49+
# already_generated_user_id=None,
50+
# pages_open=None,
51+
# amplitude_events=None,
52+
# button_styles=dict(),
53+
# continuation_selection=None,
54+
# button_simule=0,
55+
# section1_organize=False,
56+
# section2_manage=False
57+
# )
58+
# utils.applyButtonStyles(session_state)
59+
# PAGES[page].main(session_state)
60+
# # query_params = st.experimental_get_query_params()
61+
# # page_param = query_params.get("page", [0])
62+
# # if query_params:
63+
# # PAGES[page_param[0]].main(session_state)
64+
# # else:
65+
# # PAGES[page].main(session_state)
66+
2167

2268
def main():
2369
"""
2470
This function generates Escola Segura
2571
"""
2672

27-
# Remove menu da visualizacao
28-
hide_streamlit_style = """
29-
<style>
30-
#MainMenu {visibility: hidden;}
31-
footer {visibility: hidden;}
32-
</style>
33-
34-
"""
35-
st.markdown(hide_streamlit_style, unsafe_allow_html=True)
36-
3773
# SESSION STATE
3874
time.sleep(
3975
0.05
4076
) # minimal wait time so we give time for the user session to appear in steamlit
41-
session_state = session.SessionState.get(
42-
key=session.get_user_id(),
43-
update=False,
44-
state_name="Acre",
45-
state_id="AC",
46-
city_name="Todos",
47-
administrative_level="Todos",
48-
refresh=False,
49-
reset=False,
50-
already_generated_user_id=None,
51-
pages_open=None,
52-
amplitude_events=None,
53-
button_styles=dict(),
54-
continuation_selection=None,
55-
button_simule=0,
56-
section1_organize=False,
57-
section2_manage=False,
58-
)
59-
60-
PAGES = {
61-
"Escola Segura": es,
62-
"Quem somos?" : ab
63-
}
64-
65-
page = st.sidebar.radio(
66-
"Menu", list(PAGES.keys()),
67-
)
6877

69-
if __name__ == "__main__":
70-
PAGES[page].main(session_state)
71-
utils.applyButtonStyles(session_state)
78+
PAGES = {
79+
"inicio" : inicio,
80+
"inicio2" : inicio2,
81+
"guia10passos" : guiapassos,
82+
"simulation" : simulacao,
83+
"sobre" : sobre,
84+
"referencias": referencias,
85+
"duvidasfrequentes" : duvidas
86+
}
87+
# page = st.sidebar.radio(
88+
# "Menu", list(PAGES.keys()),
89+
# )
90+
query_params = st.experimental_get_query_params()
91+
page_param = query_params.get("page", [0])
92+
if query_params:
93+
PAGES[page_param[0]].main()
94+
else:
95+
inicio.main()
7296

97+
# if query_params:
98+
# PAGES[page_param[0]].main()
99+
# else:
100+
# PAGES[page].main()
101+
73102

74103
if __name__ == "__main__":
75104
main()
105+
106+
# app = Flask(__name__)
107+
108+
# @app.route('/')
109+
# def main():
110+
# # # inicio.main()
111+
# return "Hello World!"
112+
113+
# if __name__ == "__main__":
114+
# app.run(host="0.0.0.0", debug=True, port=8501)
115+
# # app.run(host="localhost", debug=True, port=8501)
116+
117+
118+
# from flask import Flask
119+
# app = Flask(__name__)
120+
121+
# @app.route('/')
122+
# def main():
123+
# return inicio.main()
124+
125+
# @app.route('/<path:entry>')
126+
# def hello(entry):
127+
# if entry=='guia10passos':
128+
# return 'Guia Passos!'
129+
# elif entry=='simulador':
130+
# return 'Simulador!'
131+
# else:
132+
# return "Hello World!"
133+
134+
# if __name__ == '__main__':
135+
# app.run()
136+
137+
# x = st.slider('Pick a number')
138+
# st.write('You picked:', x)
139+
140+
# if not hasattr(st, 'already_started_server'):
141+
# # Hack the fact that Python modules (like st) only load once to
142+
# # keep track of whether this file already ran.
143+
# st.already_started_server = True
144+
145+
# st.write('''
146+
# The first time this script executes it will run forever because it's
147+
# running a Flask server.
148+
149+
# Just close this browser tab and open a new one to see your Streamlit
150+
# app.
151+
# ''')
152+
153+
# from flask import Flask
154+
155+
# app = Flask(__name__)
156+
157+
# @app.route('/foo')
158+
# def serve_foo():
159+
# x = st.slider('Pick a number')
160+
# st.write('You picked:', x)
161+
# return 'This page is served via Flask!'
162+
163+
# app.run(port=8888)
164+
165+
166+
# # We'll never reach this part of the code the first time this file executes!
167+
168+
# # Your normal Streamlit app goes here:
169+
# x = st.slider('Pick a number')
170+
# st.write('You picked:', x)

src/imgs/escolasegura.png

42.3 KB
Loading

src/imgs/fundopassos.png

840 KB
Loading

src/imgs/grey_header.png

388 KB
Loading

src/imgs/logo-impulso.png

9.31 KB
Loading

src/imgs/logo-impulso2.png

3.63 KB
Loading

src/inicio.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/* PAGINA INICIAL*/
2+
body{
3+
background-image: url('https://i.imgur.com/Bn2MnRp.png');
4+
/* background-size: cover; */
5+
background-size: 60%;
6+
}

0 commit comments

Comments
 (0)