コード例 #1
0
    def init_client(self):
        helper_furl = self.config.get_config("client", "helper.furl", None)
        if helper_furl in ("None", ""):
            helper_furl = None

        # FURLs need to be bytes:
        if helper_furl is not None:
            helper_furl = helper_furl.encode("utf-8")

        DEP = self.encoding_params
        DEP["k"] = int(
            self.config.get_config("client", "shares.needed", DEP["k"]))
        DEP["n"] = int(
            self.config.get_config("client", "shares.total", DEP["n"]))
        DEP["happy"] = int(
            self.config.get_config("client", "shares.happy", DEP["happy"]))

        # for the CLI to authenticate to local JSON endpoints
        self._create_auth_token()

        self.history = History(self.stats_provider)
        self.terminator = Terminator()
        self.terminator.setServiceParent(self)
        uploader = Uploader(
            helper_furl,
            self.stats_provider,
            self.history,
        )
        uploader.setServiceParent(self)
        self.init_blacklist()
        self.init_nodemaker()
コード例 #2
0
    def init_client(self):
        helper_furl = self.get_config("client", "helper.furl", None)
        DEP = self.DEFAULT_ENCODING_PARAMETERS
        DEP["k"] = int(self.get_config("client", "shares.needed", DEP["k"]))
        DEP["n"] = int(self.get_config("client", "shares.total", DEP["n"]))
        DEP["happy"] = int(self.get_config("client", "shares.happy", DEP["happy"]))

        self.init_client_storage_broker()
        self.history = History(self.stats_provider)
        self.terminator = Terminator()
        self.terminator.setServiceParent(self)
        self.add_service(Uploader(helper_furl, self.stats_provider,
                                  self.history))
        self.init_blacklist()
        self.init_nodemaker()
コード例 #3
0
ファイル: client.py プロジェクト: sarciszewski/tahoe-lafs
    def init_client(self):
        helper_furl = self.get_config("client", "helper.furl", None)
        if helper_furl in ("None", ""):
            helper_furl = None

        DEP = self.encoding_params
        DEP["k"] = int(self.get_config("client", "shares.needed", DEP["k"]))
        DEP["n"] = int(self.get_config("client", "shares.total", DEP["n"]))
        DEP["happy"] = int(
            self.get_config("client", "shares.happy", DEP["happy"]))

        self.init_client_storage_broker()
        self.history = History(self.stats_provider)
        self.terminator = Terminator()
        self.terminator.setServiceParent(self)
        self.add_service(
            Uploader(helper_furl, self.stats_provider, self.history))
        self.init_blacklist()
        self.init_nodemaker()