comparison twisted/plugins/libervia_server.py @ 1199:b300eaec53b6

server: don't raise error anymore if themes_dir is invalid or legacy blog can't be created: legacy blog will be entirely removed with 0.8 release, and themes_dir is only used by it. This patch limit troubles with this old code by not raising an error anymore if option is wrong or if the legacy blog can't be created. fix 317
author Goffi <goffi@goffi.org>
date Tue, 09 Jul 2019 20:20:46 +0200
parents 49ff1330c9d0
children b2d067339de3
comparison
equal deleted inserted replaced
1198:1211dbc3cca7 1199:b300eaec53b6
101 raise ValueError( 101 raise ValueError(
102 "%s is not a Libervia's browser HTML directory" % os.path.realpath(html) 102 "%s is not a Libervia's browser HTML directory" % os.path.realpath(html)
103 ) 103 )
104 themes_dir = os.path.join(value, C.THEMES_DIR) 104 themes_dir = os.path.join(value, C.THEMES_DIR)
105 if not os.path.isfile(os.path.join(themes_dir, "default/styles/blog.css")): 105 if not os.path.isfile(os.path.join(themes_dir, "default/styles/blog.css")):
106 raise ValueError( 106 # XXX: we just display a message, as themes_dir is only used by legacy blog
107 "%s is not a Libervia's server data directory" % os.path.realpath(themes_dir) 107 # which will be removed entirely in 0.8
108 ) 108 # TODO: remove entirely legacy blog and linked options
109 print "%s is not a Libervia's server data directory" % os.path.realpath(
110 themes_dir)
109 return value 111 return value
110 112
111 113
112 def coerceBool(value): 114 def coerceBool(value):
113 return C.bool(value) 115 return C.bool(value)