webapi: pass client through constructor arguments, remove IClient, should make it easier to test web renderers in isolation

This commit is contained in:
Brian Warner
2009-02-20 12:15:54 -07:00
parent e357b8a679
commit c6c30ac5d4
14 changed files with 265 additions and 226 deletions

View File

@ -91,6 +91,8 @@ class Client(node.Node, pollmixin.PollMixin):
hotline = TimerService(1.0, self._check_hotline, hotline_file)
hotline.setServiceParent(self)
# this needs to happen last, so it can use getServiceNamed() to
# acquire references to StorageServer and other web-statusable things
webport = self.get_config("node", "web.port", None)
if webport:
self.init_web(webport) # strports string
@ -269,7 +271,7 @@ class Client(node.Node, pollmixin.PollMixin):
nodeurl_path = os.path.join(self.basedir, "node.url")
staticdir = self.get_config("node", "web.static", "public_html")
staticdir = os.path.expanduser(staticdir)
ws = WebishServer(webport, nodeurl_path, staticdir)
ws = WebishServer(self, webport, nodeurl_path, staticdir)
self.add_service(ws)
def init_ftp_server(self):