def makeClient(self, expiry_time=None, seen_new_branch_hook=None):
        """Make a `BranchFileSystemClient`.

        The created client interacts with the InMemoryFrontend.
        """
        return BranchFileSystemClient(
            self._xmlrpc_client, self.user.id, expiry_time=expiry_time,
            seen_new_branch_hook=seen_new_branch_hook,
            _now=self.fake_time.now)
Beispiel #2
0
    def __init__(self,
                 scheme,
                 codehosting_api,
                 user_id,
                 seen_new_branch_hook=None):
        """Construct a LaunchpadServer.

        :param scheme: The URL scheme to use.
        :param codehosting_api: An XML-RPC client that implements callRemote.
        :param user_id: The database ID for the user who is accessing
            branches.
        :param seen_new_branch_hook: A callable that will be called once for
            each branch accessed via this server.
        """
        AsyncVirtualServer.__init__(self, scheme)
        self._branchfs_client = BranchFileSystemClient(
            codehosting_api,
            user_id,
            seen_new_branch_hook=seen_new_branch_hook)
        self._is_start_server = False