diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-03-25 16:14:12 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-03-25 16:14:12 +0100 |
commit | 019ee28fd9e51bed25b5a5a52640d73fb151273e (patch) | |
tree | dd2b78adade11870a936625c7c7bf13ca101c9d2 | |
parent | 4a2b71f1647fba01a040573c500c34ffbdd66d34 (diff) | |
download | Chimère - projet de référence-019ee28fd9e51bed25b5a5a52640d73fb151273e.tar.bz2 Chimère - projet de référence-019ee28fd9e51bed25b5a5a52640d73fb151273e.zip |
Flake8
-rw-r--r-- | settings.py | 95 |
1 files changed, 50 insertions, 45 deletions
diff --git a/settings.py b/settings.py index f29c799..625dbab 100644 --- a/settings.py +++ b/settings.py @@ -4,7 +4,8 @@ # Don't edit this file: # overload all theses settings in your local_settings.py file -import os, sys +import os +import sys _ = lambda s: s DEBUG = False @@ -21,7 +22,7 @@ STATIC_URL = '/static/' STATIC_ROOT = ROOT_PATH + 'static/' STATICFILES_DIRS = ( - os.path.join(ROOT_PATH, "chimere_example_static"), + os.path.join(ROOT_PATH, "chimere_example_static"), ) TINYMCE_URL = '/tinymce/' @@ -31,11 +32,11 @@ JQUERY_CSS_URLS = ('/javascript/jquery-ui/css/smoothness/jquery-ui.css', '/javascript/jquery-ui-themes/base/jquery.ui.all.css') GPSBABEL = '/usr/bin/gpsbabel' -GPSBABEL_OPTIONS = 'simplify,crosstrack,error=0.005k' # simplify with an - # error of 5 meters -#GPSBABEL_OPTIONS = 'simplify,count=100' +# simplify with an error of 5 meters +GPSBABEL_OPTIONS = 'simplify,crosstrack,error=0.005k' +# GPSBABEL_OPTIONS = 'simplify,count=100' -## chimere specific ## +# # chimere specific ## CHIMERE_DEFAULT_ZOOM = 10 # center of the map CHIMERE_DEFAULT_CENTER = (-1.679444, 48.114722) @@ -69,10 +70,14 @@ CHIMERE_MINIATURE_BY_DEFAULT = False # JS definition of the default map (for admin and when no map are defined in # the application) # cf. OpenLayers documentation for more details -CHIMERE_DEFAULT_MAP_LAYER = "new OpenLayers.Layer.OSM.Mapnik('Mapnik')" # OSM mapnik map +# OSM mapnik map +CHIMERE_DEFAULT_MAP_LAYER = """new ol.layer.Tile({ + style: 'Road', + source: new ol.source.MapQuest({layer: 'osm'}) +})""" CHIMERE_XAPI_URL = 'http://open.mapquestapi.com/xapi/api/0.6/' -CHIMERE_OSM_API_URL = 'api06.dev.openstreetmap.org' # test URL +CHIMERE_OSM_API_URL = 'api06.dev.openstreetmap.org' # test URL CHIMERE_OSM_USER = 'test' CHIMERE_OSM_PASSWORD = 'test' @@ -92,13 +97,14 @@ CHIMERE_ENABLE_ROUTING = False CHIMERE_ROUTING_TRANSPORT = (('foot', _(u"Foot")), ('bicycle', _(u"Bicycle")), ('motorcar', _(u"Motorcar")), - ) + ) -CHIMERE_ROUTING_SPEEDS = {'foot':((3, _(u"You are walking slowly")), - (6, _(u"You are walking pretty quickly")),), - 'bicycle':((16, _(u"You are riding pretty slowly")), - (22, _(u"You are riding pretty quickly")),) - } +CHIMERE_ROUTING_SPEEDS = { + 'foot': ((3, _(u"You are walking slowly")), + (6, _(u"You are walking pretty quickly")),), + 'bicycle': ((16, _(u"You are riding pretty slowly")), + (22, _(u"You are riding pretty quickly")),) +} # available routing engine: 'routino' CHIMERE_ROUTING_ENGINE = { @@ -108,25 +114,27 @@ CHIMERE_ROUTING_ENGINE = { } CHIMERE_ROUTING_FAIL_MESSAGE = u"""<h3 class='warn'>Attention</h3> -<p>Le moteur de routage a echoue dans sa recherche de trajet. Les points de +<p>Le moteur de routage a echoue dans sa recherche de trajet. Les points de depart ou d'arrivee sont peut-etre trop loin d'une voie existante ou le trajet est trop dangereux.</p>""" NOMINATIM_URL = 'http://nominatim.openstreetmap.org/search' -# Fields used to geolocate with nominatim (http://wiki.openstreetmap.org/wiki/Nominatim#Search) +# Fields used to geolocate with nominatim +# (http://wiki.openstreetmap.org/wiki/Nominatim#Search) # from external sources. Key must be a valid parameters for Nominatim. If given # value are property slugs use the corresponding value otherwise use it as a # fixed value # e.g : {'street':'address', 'city':'city', 'country':u'France'} -CHIMERE_NOMINATIM_FIELDS = {'street':'address', 'city':'city', - 'country':u'France'} + +CHIMERE_NOMINATIM_FIELDS = {'street': 'address', 'city': 'city', + 'country': u'France'} MOBILE_TEST = False MOBILE_DOMAINS = [] # thumbnail -CHIMERE_THUMBS_SCALE_HEIGHT=250 -CHIMERE_THUMBS_SCALE_WIDTH=None +CHIMERE_THUMBS_SCALE_HEIGHT = 250 +CHIMERE_THUMBS_SCALE_WIDTH = None # search engine CHIMERE_SEARCH_ENGINE = False @@ -171,7 +179,8 @@ if 'test' in sys.argv: SOUTH_TESTS_MIGRATE = False # Local time zone for this installation. Choices can be found here: -# http://www.postgresql.org/docs/8.1/static/datetime-keywords.html#DATETIME-TIMEZONE-SET-TABLE +# http://www.postgresql.org/docs/8.1/static/datetime-keywords.html +# #DATETIME-TIMEZONE-SET-TABLE # although not all variations may be possible on all operating systems. # If running in a Windows environment this must be set to the same as your # system time zone. @@ -201,7 +210,6 @@ MEDIA_URL = '/media/' TEMPLATE_LOADERS = ( 'django.template.loaders.filesystem.Loader', 'django.template.loaders.app_directories.Loader', -# 'django.template.loaders.eggs.load_template_source', ) MIDDLEWARE_CLASSES = ( @@ -215,9 +223,6 @@ MIDDLEWARE_CLASSES = ( ROOT_URLCONF = 'chimere_example_project.urls' TEMPLATE_DIRS = [ - # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". - # Always use forward slashes, even on Windows. - # Don't forget to use absolute paths, not relative paths. ROOT_PATH + 'templates', ] @@ -244,7 +249,6 @@ INSTALLED_APPS = [ # celery try: import djcelery - import kombu djcelery.setup_loader() BROKER_URL = 'django://' INSTALLED_APPS += ['kombu.transport.django', @@ -259,10 +263,10 @@ INSTALLED_APPS += [ ] LOG_PATH = '/var/log/django/' -MOBILE_DOMAINS = [] # if you have specific domains for mobile access +MOBILE_DOMAINS = [] # if you have specific domains for mobile access -CHIMERE_VIEW_RENDERER = 'openlayers' # 'openlayers' or 'leaflet' -CHIMERE_EDIT_RENDERER = 'openlayers' # 'openlayers' +CHIMERE_VIEW_RENDERER = 'openlayers' # 'openlayers' or 'leaflet' +CHIMERE_EDIT_RENDERER = 'openlayers' # 'openlayers' try: from local_settings import * @@ -274,8 +278,9 @@ if CHIMERE_SEARCH_ENGINE: if 'LOGGING' not in globals(): global LOGGING - LOGGING = {'version': 1, - 'disable_existing_loggers': False, + LOGGING = { + 'version': 1, + 'disable_existing_loggers': False, 'handlers': { # Include the default Django email handler for errors # This is what you'd get without configuring logging at all. @@ -304,11 +309,12 @@ if 'LOGGING' not in globals(): 'level': 'ERROR', 'propagate': False, }, - # Your own app - this assumes all your logger names start with "myapp." + # Your own app + # this assumes all your logger names start with "myapp." 'chimere': { 'handlers': ['logfile'], - 'level': 'WARNING', # Or maybe INFO or DEBUG - 'propogate': False + 'level': 'WARNING', # Or maybe INFO or DEBUG + 'propogate': False }, }, } @@ -320,14 +326,12 @@ if 'CHIMERE_SHARE_NETWORKS' not in globals(): # share with global CHIMERE_SHARE_NETWORKS CHIMERE_SHARE_NETWORKS = ( - ("Email", 'mailto:?subject=%(text)s&body=%(url)s', - STATIC_URL + 'chimere/img/email.png'), - ("Facebook", 'http://www.facebook.com/sharer.php?t=%(text)s&u=%(url)s', - STATIC_URL + 'chimere/img/facebook.png'), - ("Twitter", 'http://twitter.com/home?status=%(text)s %(url)s', - STATIC_URL + 'chimere/img/twitter.png'), - ("Identi.ca", 'http://identi.ca/index.php?action=newnotice&status_textarea=%(text)s %(url)s', - STATIC_URL + 'chimere/img/identica.png'), + ("Email", 'mailto:?subject=%(text)s&body=%(url)s', + STATIC_URL + 'chimere/img/email.png'), + ("Facebook", 'http://www.facebook.com/sharer.php?t=%(text)s&u=%(url)s', + STATIC_URL + 'chimere/img/facebook.png'), + ("Twitter", 'http://twitter.com/home?status=%(text)s %(url)s', + STATIC_URL + 'chimere/img/twitter.png'), ) if 'MAP_CSS_URLS' not in globals(): @@ -342,6 +346,7 @@ if 'MAP_JS_URLS' not in globals(): MAP_JS_URLS = [STATIC_URL + "ol3/ol.js"] if 'OSM_MOBILE_JS_URLS' not in globals(): global OSM_MOBILE_URLS - OSM_JS_MOBILE_URLS = [STATIC_URL + "openlayers/OpenLayers.mobile.js", - STATIC_URL + "openlayers/SimplePanZoom.js", - "http://www.openstreetmap.org/openlayers/OpenStreetMap.js"] + OSM_JS_MOBILE_URLS = [ + STATIC_URL + "openlayers/OpenLayers.mobile.js", + STATIC_URL + "openlayers/SimplePanZoom.js", + "http://www.openstreetmap.org/openlayers/OpenStreetMap.js"] |