mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-06-19 07:48:11 +00:00
explicitly save refs to webish and operations (instead of using Service methods)
This commit is contained in:
@ -496,6 +496,12 @@ class _Client(node.Node, pollmixin.PollMixin):
|
|||||||
def get_long_tubid(self):
|
def get_long_tubid(self):
|
||||||
return idlib.nodeid_b2a(self.nodeid)
|
return idlib.nodeid_b2a(self.nodeid)
|
||||||
|
|
||||||
|
def get_web_service(self):
|
||||||
|
"""
|
||||||
|
:return: a reference to our web server
|
||||||
|
"""
|
||||||
|
return self.getServiceNamed("webish")
|
||||||
|
|
||||||
def _init_permutation_seed(self, ss):
|
def _init_permutation_seed(self, ss):
|
||||||
seed = self.config.get_config_from_file("permutation-seed")
|
seed = self.config.get_config_from_file("permutation-seed")
|
||||||
if not seed:
|
if not seed:
|
||||||
|
@ -62,7 +62,7 @@ class DirectoryNodeHandler(RenderMixin, rend.Page, ReplaceMeMixin):
|
|||||||
self.node = node
|
self.node = node
|
||||||
self.parentnode = parentnode
|
self.parentnode = parentnode
|
||||||
self.name = name
|
self.name = name
|
||||||
self._operations = client.getServiceNamed("webish").getServiceNamed("operations")
|
self._operations = client.get_web_service().get_operations()
|
||||||
|
|
||||||
def childFactory(self, ctx, name):
|
def childFactory(self, ctx, name):
|
||||||
name = name.decode("utf-8")
|
name = name.decode("utf-8")
|
||||||
|
@ -168,9 +168,9 @@ class WebishServer(service.MultiService):
|
|||||||
|
|
||||||
# If set, clock is a twisted.internet.task.Clock that the tests
|
# If set, clock is a twisted.internet.task.Clock that the tests
|
||||||
# use to test ophandle expiration.
|
# use to test ophandle expiration.
|
||||||
operations = OphandleTable(clock)
|
self._operations = OphandleTable(clock)
|
||||||
operations.setServiceParent(self)
|
self._operations.setServiceParent(self)
|
||||||
self.root.putChild("operations", operations)
|
self.root.putChild("operations", self._operations)
|
||||||
|
|
||||||
def buildServer(self, webport, nodeurl_path, staticdir):
|
def buildServer(self, webport, nodeurl_path, staticdir):
|
||||||
self.webport = webport
|
self.webport = webport
|
||||||
@ -241,6 +241,12 @@ class WebishServer(service.MultiService):
|
|||||||
# who knows, probably some weirdo future version of Twisted
|
# who knows, probably some weirdo future version of Twisted
|
||||||
self._started.errback(AssertionError("couldn't find out the scheme or port for the web-API server"))
|
self._started.errback(AssertionError("couldn't find out the scheme or port for the web-API server"))
|
||||||
|
|
||||||
|
def get_operations(self):
|
||||||
|
"""
|
||||||
|
:return: a reference to our "active operations" tracker
|
||||||
|
"""
|
||||||
|
return self._operations
|
||||||
|
|
||||||
|
|
||||||
class IntroducerWebishServer(WebishServer):
|
class IntroducerWebishServer(WebishServer):
|
||||||
def __init__(self, introducer, webport, nodeurl_path=None, staticdir=None):
|
def __init__(self, introducer, webport, nodeurl_path=None, staticdir=None):
|
||||||
|
Reference in New Issue
Block a user