Added a -w flag which will host the web client if specified. Currently this just delegates to the webclient RestServlet.

This commit is contained in:
Kegan Dougal 2014-08-13 13:50:01 +01:00
parent ebfc4389ad
commit 7f40fa1d46
5 changed files with 65 additions and 48 deletions

View file

@ -171,7 +171,13 @@ class HomeServer(BaseHomeServer):
def build_distributor(self):
return Distributor()
def register_servlets(self):
"""Simply building the ServletFactory is sufficient to have it
register."""
self.get_rest_servlet_factory()
def register_servlets(self, host_web_client):
""" Register all servlets associated with this HomeServer.
Args:
host_web_client (bool): True to host the web client as well.
"""
# Simply building the ServletFactory is sufficient to have it register
factory = self.get_rest_servlet_factory()
if host_web_client:
factory.register_web_client(self)