コード例 #1
0
ファイル: cran_package.py プロジェクト: pombredanne/depsy
    def save_host_contributors(self):
        raw_byline_string = self.api_raw["Author"]
        maintainer = self.api_raw["Maintainer"]

        byline = Byline(raw_byline_string)

        extracted_name_dicts = byline.author_email_pairs()

        for kwargs_dict in extracted_name_dicts:
            person = get_or_make_person(**kwargs_dict)
            self._save_contribution(person, "author")
コード例 #2
0
ファイル: pypi_package.py プロジェクト: richard-orr/depsy
    def save_host_contributors(self):
        raw_byline_string = self.api_raw["info"]["author"]
        author_email = self.api_raw["info"]["author_email"]

        byline = Byline(raw_byline_string)

        extracted_name_dicts = byline.author_email_pairs()
        
        # use the author email field only if only one name
        if len(extracted_name_dicts)==1:
            extracted_name_dicts[0]["email"] = author_email

        for kwargs_dict in extracted_name_dicts:
            person = get_or_make_person(**kwargs_dict)
            self._save_contribution(person, "author")
コード例 #3
0
    def save_github_contribs_to_db(self):
        if isinstance(self.github_contributors, dict):
            # it's an error resp from the API, doh.
            return None

        if self.github_contributors is None:
            return None

        total_contributions_count = sum([c['contributions'] for c in self.github_contributors])
        for github_contrib in self.github_contributors:
            person = get_or_make_person(github_login=github_contrib["login"])
            percent_total_contribs = round(
                github_contrib["contributions"] / float(total_contributions_count) * 100,
                3
            )
            self._save_contribution(
                person,
                "github_contributor",
                quantity=github_contrib["contributions"],
                percent=percent_total_contribs
            )
        self.num_github_committers = len(self.github_contributors)
コード例 #4
0
    def save_github_owner_to_db(self):
        if not self.github_owner:
            return False

        person = get_or_make_person(github_login=self.github_owner)
        self._save_contribution(person, "github_owner")