How to use the grimoirelab.toolkit.uris.urijoin function in grimoirelab

To help you get started, we’ve selected a few grimoirelab examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github crossminer / scava / web-dashboards / perceval-crossminer / perceval / backends / crossminer / crossminer.py View on Github external
api = self.api_projects_url
        elif category == CATEGORY_METRIC:
            # Get all metrics definitions and then find the values for the current project
            api_metrics = self.api_metrics_url
            metrics = json.loads(self.fetch(api_metrics))
        else:
            raise ValueError(category + ' not supported in Crossminer')

        if category == CATEGORY_PROJECT:
            logger.debug("Crossminer client calls APIv1: %s", api)
            projects = self.fetch(api)
            yield projects
        else:
            for metric in metrics:
                metric_id = metric['id']
                api = urijoin(self.api_projects_url, "/p/%s/m/%s" % (project, metric_id))
                logger.debug("Crossminer client calls APIv1: %s", api)
                print(api)
                project_metric = self.fetch(api)
                yield project_metric
github crossminer / scava / web-dashboards / perceval-crossminer / perceval / backends / crossminer / crossminer.py View on Github external
def __init__(self, url, project=None, archive=None, from_archive=False):
        super().__init__(url, archive=archive, from_archive=from_archive)
        self.project = project
        self.api_metrics_url = urijoin(self.base_url, "metrics")
        self.api_projects_url = urijoin(self.base_url, "projects")
github chaoss / grimoirelab-perceval / perceval / backends / core / gmane.py View on Github external
def messages(self, mailing_list, offset, max_messages=MAX_MESSAGES):
        """Fetch a set of messages from the given mailing list.

        Given the mailing list identifier used by Gmane and a offset,
        this method fetches a set of messages.

        :param mailing_list: mailing list identifier on Gmane
        :param offset: start to fetch from here
        :param max_messages: maximum number of messages to fetch
        """
        end_offset = offset + max_messages
        resource = urijoin(mailing_list, offset, end_offset)

        r = self.fetch(self.GMANE_DOWNLOAD_RTYPE, resource)

        return r.content
github crossminer / scava / web-dashboards / perceval-crossminer / perceval / backends / crossminer / crossminer.py View on Github external
def __init__(self, url, project=None, archive=None, from_archive=False):
        super().__init__(url, archive=archive, from_archive=from_archive)
        self.project = project
        self.api_metrics_url = urijoin(self.base_url, "metrics")
        self.api_projects_url = urijoin(self.base_url, "projects")

grimoirelab

Tool set for software development analytics

GPL-3.0
Latest version published 15 days ago

Package Health Score

84 / 100
Full package analysis

Similar packages