Mercurial > libervia-web
comparison libervia/server/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 | a15ac511390c |
children | 3f791fbc1643 |
comparison
equal
deleted
inserted
replaced
1198:1211dbc3cca7 | 1199:b300eaec53b6 |
---|---|
2024 # files upload | 2024 # files upload |
2025 self.putChildSAT("upload_radiocol", _upload_radiocol) | 2025 self.putChildSAT("upload_radiocol", _upload_radiocol) |
2026 self.putChildSAT("upload_avatar", _upload_avatar) | 2026 self.putChildSAT("upload_avatar", _upload_avatar) |
2027 | 2027 |
2028 # static pages | 2028 # static pages |
2029 self.putChildSAT("blog_legacy", MicroBlog(self)) | 2029 #Â FIXME: legacy blog must be removed entirely in 0.8 |
2030 self.putChildSAT(C.THEMES_URL, ProtectedFile(self.themes_dir)) | 2030 try: |
2031 micro_blog = MicroBlog(self) | |
2032 except Exception as e: | |
2033 log.warning(u"Can't load legacy microblog, ignoring it: {reason}".format( | |
2034 reason=e)) | |
2035 else: | |
2036 self.putChildSAT("blog_legacy", micro_blog) | |
2037 self.putChildSAT(C.THEMES_URL, ProtectedFile(self.themes_dir)) | |
2031 | 2038 |
2032 # websocket | 2039 # websocket |
2033 if self.options["connection_type"] in ("https", "both"): | 2040 if self.options["connection_type"] in ("https", "both"): |
2034 wss = websockets.LiberviaPageWSProtocol.getResource(self, secure=True) | 2041 wss = websockets.LiberviaPageWSProtocol.getResource(self, secure=True) |
2035 self.putChildAll("wss", wss) | 2042 self.putChildAll("wss", wss) |