Beispiel #1
0
    def __init__(self,
                 client,
                 webport,
                 tempdir,
                 nodeurl_path=None,
                 staticdir=None,
                 clock=None,
                 now_fn=time.time):
        service.MultiService.__init__(self)
        # the 'data' argument to all render() methods default to the Client
        # the 'clock' argument to root.Root is, if set, a
        # twisted.internet.task.Clock that is provided by the unit tests
        # so that they can test features that involve the passage of
        # time in a deterministic manner.

        self.root = root.Root(client, clock, now_fn)
        self.buildServer(webport, tempdir, nodeurl_path, staticdir)

        # If set, clock is a twisted.internet.task.Clock that the tests
        # use to test ophandle expiration.
        self._operations = OphandleTable(clock)
        self._operations.setServiceParent(self)
        self.root.putChild("operations", self._operations)

        self.root.putChild(b"storage-plugins", StoragePlugins(client))
Beispiel #2
0
 def __init__(self, client, webport, nodeurl_path=None, staticdir=None,
              clock=None, now_fn=time.time):
     service.MultiService.__init__(self)
     # the 'data' argument to all render() methods default to the Client
     # the 'clock' argument to root.Root is, if set, a
     # twisted.internet.task.Clock that is provided by the unit tests
     # so that they can test features that involve the passage of
     # time in a deterministic manner.
     self.root = root.Root(client, clock, now_fn)
     self.buildServer(webport, nodeurl_path, staticdir)
     if self.root.child_operations:
         self.site.remember(self.root.child_operations, IOpHandleTable)
         self.root.child_operations.setServiceParent(self)