Spaces:
Running on Zero
Running on Zero
Cheikh Niang commited on
Deploiement GuindiMa AI (interface Gradio)
Browse files
app.py
CHANGED
|
@@ -843,6 +843,22 @@ def _une_carte(
|
|
| 843 |
"""
|
| 844 |
|
| 845 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 846 |
def _carte(
|
| 847 |
resultat: dict,
|
| 848 |
depart: str,
|
|
@@ -864,7 +880,7 @@ def _carte(
|
|
| 864 |
)
|
| 865 |
|
| 866 |
astuce = _astuce_quartier(depart, arrivee)
|
| 867 |
-
entete = bandeau_compagnie + avertissement + astuce
|
| 868 |
if resultat["found"]:
|
| 869 |
return (
|
| 870 |
entete
|
|
|
|
| 843 |
"""
|
| 844 |
|
| 845 |
|
| 846 |
+
def _note_distance_pied(depart: str, arrivee: str) -> str:
|
| 847 |
+
"""« C'est tout près » quand les deux lieux sont à moins d'un km.
|
| 848 |
+
|
| 849 |
+
Texte seulement : la voix reste celle des segments pré-générés, sans nouvelle
|
| 850 |
+
prise. Les bus proposés restent affichés tels quels.
|
| 851 |
+
"""
|
| 852 |
+
minutes = MATCHER.geo.minutes_a_pied(depart, arrivee)
|
| 853 |
+
if not minutes:
|
| 854 |
+
return ""
|
| 855 |
+
return (
|
| 856 |
+
"<div style='color:#0B6B37;background:#EAF7EF;border:1px solid #C6E3D2;"
|
| 857 |
+
"border-radius:8px;padding:8px 12px;margin-top:10px;font-size:14px;'>"
|
| 858 |
+
f"C'est tout près : environ {minutes} min à pied</div>"
|
| 859 |
+
)
|
| 860 |
+
|
| 861 |
+
|
| 862 |
def _carte(
|
| 863 |
resultat: dict,
|
| 864 |
depart: str,
|
|
|
|
| 880 |
)
|
| 881 |
|
| 882 |
astuce = _astuce_quartier(depart, arrivee)
|
| 883 |
+
entete = bandeau_compagnie + avertissement + astuce + _note_distance_pied(depart, arrivee)
|
| 884 |
if resultat["found"]:
|
| 885 |
return (
|
| 886 |
entete
|