Update app.py
Browse files
app.py
CHANGED
@@ -9,18 +9,35 @@ from datetime import datetime
|
|
9 |
|
10 |
load_dotenv()
|
11 |
|
|
|
12 |
st.set_page_config(
|
13 |
-
page_title="AIdeaText",
|
14 |
-
layout="wide",
|
15 |
-
page_icon="
|
16 |
)
|
17 |
|
18 |
# Definir rutas de los archivos
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
|
25 |
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
26 |
|
|
|
9 |
|
10 |
load_dotenv()
|
11 |
|
12 |
+
# Configuración de la página con el logo
|
13 |
st.set_page_config(
|
14 |
+
page_title="AIdeaText",
|
15 |
+
layout="wide",
|
16 |
+
page_icon="./assets/img/aideaText.ico" # Opcional: un emoji mientras se carga el logo
|
17 |
)
|
18 |
|
19 |
# Definir rutas de los archivos
|
20 |
+
ASSETS_DIR = os.path.join(os.path.dirname(__file__), 'assets', 'img')
|
21 |
+
LOGO_PATH = os.path.join(ASSETS_DIR, 'aideaText_logo.png')
|
22 |
+
|
23 |
+
# Función para verificar y cargar el logo
|
24 |
+
def setup_logo():
|
25 |
+
try:
|
26 |
+
if os.path.exists(LOGO_PATH):
|
27 |
+
# Para un logo cuadrado, usamos la misma imagen para ambos parámetros
|
28 |
+
st.logo(
|
29 |
+
image=LOGO_PATH,
|
30 |
+
icon_image=LOGO_PATH, # Mismo archivo para ambos usos
|
31 |
+
size="medium", # "small", "medium", o "large"
|
32 |
+
link="https://aideatext.ai" # Opcional: URL al hacer clic
|
33 |
+
)
|
34 |
+
return True
|
35 |
+
else:
|
36 |
+
logger.warning("Logo file not found")
|
37 |
+
return False
|
38 |
+
except Exception as e:
|
39 |
+
logger.error(f"Error setting up logo: {str(e)}")
|
40 |
+
return False
|
41 |
|
42 |
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
43 |
|