combo-plugin-gnm/debian/50gnm.py

282 lines
9.7 KiB
Python

# -*- coding: utf-8 -*-
COMBO_MAP_TILE_URLTEMPLATE = "https://carton.entrouvert.org/hydda-tiles/{z}/{x}/{y}{r}.png"
COMBO_MAP_ATTRIBUTION = "&copy; <a href='http://www.openstreetmap.org/copyright'>OpenStreetMap</a>"
COMBO_DASHBOARD_ENABLED = True
COMBO_DASHBOARD_NEW_TILE_POSITION = 'first'
COMBO_MAP_DEFAULT_POSITION = {'lat': '45.7577', 'lng': '4.8320'}
COMBO_MAP_MAX_BOUNDS = {
"corner1": {"lat": 45.9134, "lng": 4.6733},
"corner2": {"lat": 45.5583, "lng": 5.1574}
}
COMBO_PUBLIC_TEMPLATES.update({
"blank": {
"name": u"Blanc",
"template": "combo/page_template_blank.html",
},
"dashboard": {
"name": u"Tableau de bord",
"template": "combo/page_template_dashboard.html",
},
"iconbar": {
"name": u"Barre d'icônes",
"template": "combo/page_template_iconbar.html",
},
"iconbar-left-sidebar": {
"name": u"Barre d'icônes + barre à gauche",
"template": "combo/page_template_iconbar_left_sidebar.html",
},
"search": {
"name": u"Recherche",
"template": "combo/page_template_search.html",
},
"banner-two-columns": {
"name": "Deux colonnes + bandeau",
"template": "combo/page_template_banner_2cols.html",
},
"banner-one-column": {
"name": u"Une colonne + bandeau",
"template": "combo/page_template_banner.html",
},
"banner-two-columns-sidebar": {
"name": u"Deux colonnes et une barre latérale + bandeau",
"template": "combo/page_template_banner_2cols_sidebar.html",
},
"place": {
"name": u"Lieu",
"template": "combo/page_template_place.html",
},
})
JSON_CELL_TYPES = {
"velov": {
"url": "https://download.data.grandlyon.com/ws/rdata/jcd_jcdecaux.jcdvelov/all.json?field=gid&value=[gid]",
"name": u"Velov",
"cache_duration": 60,
"force_async": False,
"auto_refresh": 90,
"form": [
{
"varname": "gid",
"type": "string",
"label": "GID de la station"
}
]
},
"taxi": {
"url": "https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputformat=GEOJSON&request=GetFeature&typename=pvo_patrimoine_voirie.pvostationtaxi&filter=<Filter><PropertyIsEqualTo><PropertyName>gid</PropertyName><Literal>[gid]</Literal></PropertyIsEqualTo></Filter>",
"name": u"Station de taxi",
"cache_duration": 86400,
"force_async": False,
"form": [
{
"varname": "gid",
"type": "string",
"label": "GID de la station"
}
]
},
"mdr": {
"url": "https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputformat=GEOJSON&maxfeatures=30&request=GetFeature&typename=ter_territoire.maison_du_rhone&SRSNAME=urn:ogc:def:crs:EPSG::4326&filter=<Filter><PropertyIsEqualTo><PropertyName>identifiant</PropertyName><Literal>[identifiant]</Literal></PropertyIsEqualTo></Filter>",
"cache_duration": 86400,
"force_async": False,
"name": u"Maison de la Métropole de Lyon",
"form": [
{
"varname": "identifiant",
"type": "string",
"label": "Identifiant"
}
]
},
"piscine": {
"url": "https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputformat=GEOJSON&maxfeatures=30&request=GetFeature&typename=adr_voie_lieu.adrequippiscinepct&SRSNAME=urn:ogc:def:crs:EPSG::4326&filter=<Filter><PropertyIsEqualTo><PropertyName>identifiant</PropertyName><Literal>[identifiant]</Literal></PropertyIsEqualTo></Filter>",
"cache_duration": 86400,
"force_async": False,
"name": u"Piscine de la Métropole de Lyon",
"form": [
{
"varname": "identifiant",
"type": "string",
"label": "Identifiant"
}
]
},
"mairie": {
"url": "https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputformat=GEOJSON&maxfeatures=30&request=GetFeature&typename=adr_voie_lieu.adrmairiepct&SRSNAME=urn:ogc:def:crs:EPSG::4326&filter=<Filter><PropertyIsEqualTo><PropertyName>identifiant</PropertyName><Literal>[identifiant]</Literal></PropertyIsEqualTo></Filter>",
"cache_duration": 86400,
"force_async": False,
"name": u"Mairie",
"additional-data": [
{"key": "coordonnees",
"url": "[passerelle_url]csvdatasource/mairies/data?identifiant=[identifiant]"
}
],
"form": [
{
"varname": "identifiant",
"type": "string",
"label": "Identifiant"
}
]
},
"decheterie": {
"url": "https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputformat=GEOJSON&request=GetFeature&typename=gip_proprete.gipdecheterie&filter=<Filter><PropertyIsLike wildcard='*' singleChar='.' escape='!'><PropertyName>identifiant</PropertyName><Literal>[identifiant]</Literal></PropertyIsLike></Filter>",
"cache_duration": 86400,
"force_async": False,
"name": u"Déchèterie",
"form": [
{
"varname": "identifiant",
"type": "string",
"label": "Identifiant"
}
]
},
"donnerie": {
"url": "https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputformat=GEOJSON&request=GetFeature&typename=gip_proprete.gipdonnerie&filter=<Filter><PropertyIsLike wildcard='*' singleChar='.' escape='!'><PropertyName>identifiant</PropertyName><Literal>[identifiant]</Literal></PropertyIsLike></Filter>",
"cache_duration": 86400,
"force_async": False,
"name": u"Donnerie",
"form": [
{
"varname": "identifiant",
"type": "string",
"label": "Identifiant"
}
]
},
"bibliotheque": {
"url": "https://download.data.grandlyon.com/wfs/rdata?SERVICE=WFS&VERSION=2.0.0&outputformat=GEOJSON&request=GetFeature&typename=sit_sitra.sittourisme&filter=<Filter><PropertyIsEqualTo><PropertyName>gid</PropertyName><Literal>[gid]</Literal></PropertyIsEqualTo></Filter>",
"cache_duration": 86400,
"force_async": False,
"name": u"Bibliothèque",
"form": [
{
"varname": "gid",
"type": "string",
"label": "Identifiant"
}
]
},
"aire-de-covoiturage": {
"url": "https://download.data.grandlyon.com/wfs/grandlyon?SERVICE=WFS&VERSION=2.0.0&outputformat=GEOJSON&request=GetFeature&typename=pvo_patrimoine_voirie.pvoparking&filter=<Filter><PropertyIsEqualTo><PropertyName>gid</PropertyName><Literal>[gid]</Literal></PropertyIsEqualTo></Filter>",
"cache_duration": 86400,
"force_async": False,
"name": u"Aire de covoiturage",
"form": [
{
"varname": "gid",
"type": "string",
"label": "Identifiant"
}
]
},
"airquality": {
"url": "[passerelle_url]airquality/atmo/details/fr/lyon/",
"cache_duration": 300,
"force_async": False,
"name": u"Qualité de l'air"
},
"pollen": {
"url": "https://download.data.grandlyon.com/ws/rdata/rnsa_reseau_aerobio.rnsabulletin/all.json",
"cache_duration": 3000,
"force_async": False,
"name": u"Info Pollen",
"additional-data": [
{"key": "syntheses",
"url": "https://download.data.grandlyon.com/ws/rdata/rnsa_reseau_aerobio.rnsabulletin/all.json?field=type&value=Synthese"
}
]
},
"places": {
"url": "[passerelle_url]jsondatastore/lieux-favoris/data/?name_id=[user_nameid]",
"name": u"Lieux favoris",
"force_async": False,
"cache_duration": 600,
"actions": {
"create": {
"url": "[passerelle_url]jsondatastore/lieux-favoris/data/create?name_id=[user_nameid]"
},
"delete": {
"url": "[passerelle_url]jsondatastore/lieux-favoris/data/[id]/delete?name_id=[user_nameid]"
}
}
},
"silo-a-verre": {
"url": "https://download.data.grandlyon.com/ws/grandlyon/gic_collecte.gicsiloverre/all.json?field=identifiant&value=[identifiant]",
"cache_duration": 86400,
"force_async": False,
"name": u"Silo à verre",
"form": [
{
"varname": "identifiant",
"type": "string",
"label": "Identifiant"
}
]
},
"tcl": {
"url": "[passerelle_url]tcl/tcl/stop/[id]",
"auto_refresh": 25,
"cache_duration": 10,
"force_async": False,
"name": u"Arrêt TCL",
"form": [
{
"varname": "id",
"type": "string",
"label": "Identifiant"
}
]
},
"goto": {
"url": "http://preprod.tsvc.optimod2.cityway.fr:80/api/journeyplanner/opt/PlanTrips/json?DepartureType=COORDINATES&DepartureLatitude=[lat1]&DepartureLongitude=[lng1]&ArrivalType=COORDINATES&ArrivalLatitude=[lat2]&ArrivalLongitude=[lng2]&Date=[date]&DateType=DEPARTURE&TripModes=[tripmode]&Algorithm=FASTEST&BikeSecurityLevel=None&BikeSpeed=12&WalkSpeed=4&MaxCarDistance=100&MaxBikeDistance=100&MaxWalkDistance=3000&AvoidDisruptions=1&StopToPlaceCar=1&user_key=1fd5db9effbb01c36424ef76463cdda0",
"cache_duration": 60,
"force_async": False,
"name": u"M'y rendre",
"varnames": ["lat1", "lng1", "lat2", "lng2", "date", "to"],
"form": [
{
"varname": "tripmode",
"type": "string",
"label": "Mode de transport (WALK, BIKE, PT, CAR)"
}
]
},
"cut-profile": {
"url": "[idp_url]api/users/[user_nameid]/",
"name": "Profil CUT",
},
"profile-info": {
"url": "[idp_url]api/users/[user_nameid]/",
"name": "Infos de profil"
},
"suggestions": {
"name": "Suggestions",
"url": "[idp_url]api/users/[user_nameid]/",
"loading-message": "Recherche de suggestions…",
"additional-data": [
{"key": "places",
"url": "[passerelle_url]jsondatastore/lieux-favoris/data/?name_id=[user_nameid]"
}
]
},
"alerte-qualite-de-l-air": {
"url": "[passerelle_url]feeds/alertes-qualite-de-lair/json",
"cache_duration": 600,
"force_async": True,
"name": u"Alerte qualité de l'air"
},
"mairie-usager": {
"name": "Mairie de l'usager",
"url": "[idp_url]api/users/[user_nameid]/"
}
}
import memcache
memcache.SERVER_MAX_VALUE_LENGTH = 10 * 1024 * 1024