comparison src/twisted/plugins/libervia_server.py @ 712:bf562fb9c273

server_side: use Jinja2 template engine for static blog
author souliane <souliane@mailoo.org>
date Mon, 13 Jul 2015 18:11:38 +0200
parents 5319110a862c
children 3905bc24eb17
comparison
equal deleted inserted replaced
711:052d1d19016d 712:bf562fb9c273
53 def coerceDataDir(value): # called from Libervia.OPT_PARAMETERS 53 def coerceDataDir(value): # called from Libervia.OPT_PARAMETERS
54 html = os.path.join(value, C.HTML_DIR) 54 html = os.path.join(value, C.HTML_DIR)
55 if not os.path.isfile(os.path.join(html, C.LIBERVIA_MAIN_PAGE)): 55 if not os.path.isfile(os.path.join(html, C.LIBERVIA_MAIN_PAGE)):
56 raise ValueError("%s is not a Libervia's browser HTML directory" % os.path.realpath(html)) 56 raise ValueError("%s is not a Libervia's browser HTML directory" % os.path.realpath(html))
57 themes_dir = os.path.join(value, C.THEMES_DIR) 57 themes_dir = os.path.join(value, C.THEMES_DIR)
58 if not os.path.isfile(os.path.join(themes_dir, 'default/index.html')): 58 if not os.path.isfile(os.path.join(themes_dir, 'default/styles/blog.css')):
59 raise ValueError("%s is not a Libervia's server data directory" % os.path.realpath(themes_dir)) 59 raise ValueError("%s is not a Libervia's server data directory" % os.path.realpath(themes_dir))
60 return value 60 return value
61 61
62 DATA_DIR_DEFAULT = '' 62 DATA_DIR_DEFAULT = ''
63 OPT_PARAMETERS_BOTH = [['connection_type', 't', 'https', _(u"'http', 'https' or 'both' (to launch both servers).").encode('utf-8'), coerceConnectionType], 63 OPT_PARAMETERS_BOTH = [['connection_type', 't', 'https', _(u"'http', 'https' or 'both' (to launch both servers).").encode('utf-8'), coerceConnectionType],