コード例 #1
0
ファイル: histo.py プロジェクト: morucci/repoxplorer
    def authors(self, pid=None, tid=None, cid=None, gid=None,
                dfrom=None, dto=None, inc_merge_commit=None,
                inc_repos=None, metadata=None, exc_groups=None,
                inc_groups=None):

        projects_index = Projects()
        idents = Contributors()

        query_kwargs = utils.resolv_filters(
            projects_index, idents, pid, tid, cid, gid,
            dfrom, dto, inc_repos, inc_merge_commit,
            metadata, exc_groups, inc_groups)

        c = Commits(index.Connector())
        if not c.get_commits_amount(**query_kwargs):
            return []
        ret = c.get_authors_histo(**query_kwargs)[1]
        for bucket in ret:
            _idents = idents.get_idents_by_emails(bucket['authors_email'])
            bucket['value'] = len(_idents)
            bucket['date'] = bucket['key_as_string']
            del bucket['authors_email']
            del bucket['doc_count']
            del bucket['key_as_string']
            del bucket['key']

        return ret
コード例 #2
0
    def commits(self,
                pid=None,
                tid=None,
                cid=None,
                gid=None,
                dfrom=None,
                dto=None,
                inc_merge_commit=None,
                inc_repos=None,
                metadata=None,
                exc_groups=None,
                inc_groups=None):

        projects_index = Projects()
        idents = Contributors()

        query_kwargs = utils.resolv_filters(projects_index, idents, pid, tid,
                                            cid, gid, dfrom, dto, inc_repos,
                                            inc_merge_commit, metadata,
                                            exc_groups, inc_groups)

        c = Commits(index.Connector())
        if not c.get_commits_amount(**query_kwargs):
            return []
        ret = c.get_commits_histo(**query_kwargs)
        ret = [{
            'date': d['key_as_string'],
            'value': d['doc_count']
        } for d in ret[1]]
        return ret
コード例 #3
0
    def authors(self,
                pid=None,
                tid=None,
                cid=None,
                gid=None,
                dfrom=None,
                dto=None,
                inc_merge_commit=None,
                inc_repos=None,
                metadata=None,
                exc_groups=None,
                inc_groups=None):

        projects_index = Projects()
        idents = Contributors()

        query_kwargs = utils.resolv_filters(projects_index, idents, pid, tid,
                                            cid, gid, dfrom, dto, inc_repos,
                                            inc_merge_commit, metadata,
                                            exc_groups, inc_groups)

        c = Commits(index.Connector())
        if not c.get_commits_amount(**query_kwargs):
            return []
        ret = c.get_authors_histo(**query_kwargs)[1]
        for bucket in ret:
            _idents = idents.get_idents_by_emails(bucket['authors_email'])
            bucket['value'] = len(_idents)
            bucket['date'] = bucket['key_as_string']
            del bucket['authors_email']
            del bucket['doc_count']
            del bucket['key_as_string']
            del bucket['key']

        return ret
コード例 #4
0
ファイル: commits.py プロジェクト: morucci/repoxplorer
class CommitsAmountTrend(object):
    def __init__(self, connector=None):
        self.ic = Commits(connector)

    def get_trend(self, mails=[], repos=[],
                  period_a=None, period_b=None,
                  merge_commit=None):
        """ Return the amount diff and the percentil
        of amount evolution for perdiod a compared to
        period b
        """
        assert isinstance(period_a, tuple)
        assert isinstance(period_b, tuple)
        c_amnt_a = self.ic.get_commits_amount(mails, repos,
                                              period_a[0], period_a[1],
                                              merge_commit)
        c_amnt_b = self.ic.get_commits_amount(mails, repos,
                                              period_b[0], period_b[1],
                                              merge_commit)
        diff = c_amnt_a - c_amnt_b
        trend = diff * 100 / (c_amnt_a or c_amnt_b)
        return diff, trend
コード例 #5
0
ファイル: commits.py プロジェクト: sniperkit/repoxplorer
class CommitsAmountTrend(object):
    def __init__(self, connector=None):
        self.ic = Commits(connector)

    def get_trend(self,
                  mails=[],
                  repos=[],
                  period_a=None,
                  period_b=None,
                  merge_commit=None):
        """ Return the amount diff and the percentil
        of amount evolution for perdiod a compared to
        period b
        """
        assert isinstance(period_a, tuple)
        assert isinstance(period_b, tuple)
        c_amnt_a = self.ic.get_commits_amount(mails, repos, period_a[0],
                                              period_a[1], merge_commit)
        c_amnt_b = self.ic.get_commits_amount(mails, repos, period_b[0],
                                              period_b[1], merge_commit)
        diff = c_amnt_a - c_amnt_b
        trend = diff * 100 / (c_amnt_a or c_amnt_b)
        return diff, trend
コード例 #6
0
ファイル: histo.py プロジェクト: morucci/repoxplorer
    def commits(self, pid=None, tid=None, cid=None, gid=None,
                dfrom=None, dto=None, inc_merge_commit=None,
                inc_repos=None, metadata=None, exc_groups=None,
                inc_groups=None):

        projects_index = Projects()
        idents = Contributors()

        query_kwargs = utils.resolv_filters(
            projects_index, idents, pid, tid, cid, gid,
            dfrom, dto, inc_repos, inc_merge_commit,
            metadata, exc_groups, inc_groups)

        c = Commits(index.Connector())
        if not c.get_commits_amount(**query_kwargs):
            return []
        ret = c.get_commits_histo(**query_kwargs)
        ret = [{'date': d['key_as_string'],
                'value': d['doc_count']} for d in ret[1]]
        return ret