comparison dash.py @ 9:b06cb7fbf7f8

updated template paths for daemon usage
author sean
date Wed, 29 Jul 2015 12:20:08 +0200
parents 8fc4db85f2f5
children d71f39618d6f
comparison
equal deleted inserted replaced
8:8fc4db85f2f5 9:b06cb7fbf7f8
9 import os.path,sys,configparser 9 import os.path,sys,configparser
10 10
11 CONFIG_FILE = "dash.conf" 11 CONFIG_FILE = "dash.conf"
12 PATH = os.path.abspath(os.path.dirname(sys.argv[0])) 12 PATH = os.path.abspath(os.path.dirname(sys.argv[0]))
13 CONFIG_PATH = PATH + "/" + CONFIG_FILE 13 CONFIG_PATH = PATH + "/" + CONFIG_FILE
14
15 # Create a new list with absolute paths
16 MY_TEMPLATE_PATH = [
17 PATH, './views')),
18 ]
19
20 # Patch @view() so it uses the customized path list instead of the global one
21 view = functools.partial(bottle.view, template_lookup=MY_TEMPLATE_PATH)
14 22
15 tiles = [] 23 tiles = []
16 settings = {} 24 settings = {}
17 25
18 default_settings = configparser.ConfigParser() 26 default_settings = configparser.ConfigParser()
138 def error404(error): 146 def error404(error):
139 return 'Nothing here, sorry <br /> 404' 147 return 'Nothing here, sorry <br /> 404'
140 148
141 read_config() 149 read_config()
142 # print(tiles) 150 # print(tiles)
143 # run(host='localhost', port=8080, debug=True) 151 run(host='localhost', port=8080, debug=True)
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)