Exemplo n.º 1
0
    def query_remote_gecko_config(self):
        repo = self.query_repo()
        if os.path.exists(repo):
            config_path = self.query_gecko_config_path()
            config_path = "{repo}/{config_path}".format(repo=repo, config_path=config_path)
            return json.load(open(config_path, "r"))
        elif detect_hg(repo):
            rev = self.query_revision()
            if rev is None:
                rev = 'default'

            config_path = self.query_gecko_config_path()
            # Handle local files vs. in-repo files
            url = self.query_hgweb_url(repo, rev, config_path)
            return self.retry(self.load_json_from_url, args=(url,))
        elif detect_git(repo):
            rev = self.query_revision()
            if rev is None:
                rev = 'HEAD'

            config_path = self.query_gecko_config_path()
            url = self.query_gitweb_url(repo, rev, config_path)
            return self.retry(self.load_json_from_url, args=(url,))
Exemplo n.º 2
0
    def query_remote_gecko_config(self):
        repo = self.query_repo()
        if os.path.exists(repo):
            config_path = self.query_gecko_config_path()
            config_path = "{repo}/{config_path}".format(repo=repo, config_path=config_path)
            return json.load(open(config_path, "r"))
        elif detect_hg(repo):
            rev = self.query_revision()
            if rev is None:
                rev = 'default'

            config_path = self.query_gecko_config_path()
            # Handle local files vs. in-repo files
            url = self.query_hgweb_url(repo, rev, config_path)
            return self.retry(self.load_json_from_url, args=(url,))
        elif detect_git(repo):
            rev = self.query_revision()
            if rev is None:
                rev = 'HEAD'

            config_path = self.query_gecko_config_path()
            url = self.query_gitweb_url(repo, rev, config_path)
            return self.retry(self.load_json_from_url, args=(url,))