当前位置: 首页>>代码示例>>Python>>正文


Python Fetch.localcount_internal_helper方法代码示例

本文整理汇总了Python中bb.fetch.Fetch.localcount_internal_helper方法的典型用法代码示例。如果您正苦于以下问题:Python Fetch.localcount_internal_helper方法的具体用法?Python Fetch.localcount_internal_helper怎么用?Python Fetch.localcount_internal_helper使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在bb.fetch.Fetch的用法示例。


在下文中一共展示了Fetch.localcount_internal_helper方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: sortable_revision

# 需要导入模块: from bb.fetch import Fetch [as 别名]
# 或者: from bb.fetch.Fetch import localcount_internal_helper [as 别名]
    def sortable_revision(self, url, ud, d):
        """

        """
        pd = bb.persist_data.persist(d)
        localcounts = pd['BB_URI_LOCALCOUNT']
        key = self.generate_revision_key(url, ud, d, branch=True)
        oldkey = self.generate_revision_key(url, ud, d, branch=False)

        latest_rev = self._build_revision(url, ud, d)
        last_rev = localcounts[key + '_rev']
        if last_rev is None:
            last_rev = localcounts[oldkey + '_rev']
            if last_rev is not None:
                del localcounts[oldkey + '_rev']
                localcounts[key + '_rev'] = last_rev

        uselocalcount = bb.data.getVar("BB_LOCALCOUNT_OVERRIDE", d, True) or False
        count = None
        if uselocalcount:
            count = Fetch.localcount_internal_helper(ud, d)
        if count is None:
            count = localcounts[key + '_count']
        if count is None:
            count = localcounts[oldkey + '_count']
            if count is not None:
                del localcounts[oldkey + '_count']
                localcounts[key + '_count'] = count

        if last_rev == latest_rev:
            return str(count + "+" + latest_rev)

        buildindex_provided = hasattr(self, "_sortable_buildindex")
        if buildindex_provided:
            count = self._sortable_buildindex(url, ud, d, latest_rev)
        if count is None:
            count = "0"
        elif uselocalcount or buildindex_provided:
            count = str(count)
        else:
            count = str(int(count) + 1)

        localcounts[key + '_rev'] = latest_rev
        localcounts[key + '_count'] = count

        return str(count + "+" + latest_rev)
开发者ID:folkien,项目名称:poky-fork,代码行数:48,代码来源:git.py


注:本文中的bb.fetch.Fetch.localcount_internal_helper方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。