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


Python Report.print_title方法代码示例

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


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

示例1: build

# 需要导入模块: from report import Report [as 别名]
# 或者: from report.Report import print_title [as 别名]
    def build(self, reporter=None):
        if self.built:
            return 0

        if not self.tool.EMPTY:
            statistics.targets += 1
            
        if reporter is None:
            from report import Report
            reporter = Report()

        reporter.title(self.pathname)
        
        rebuild_target = False
        rebuild_reason = None        
        
        builds = 0
        for tinput in self.inputs:
            builds += tinput.build(reporter.sub())
            
        if os.path.islink(self.pathname):
            link = os.readlink(self.pathname)
            comake_shortname, comake_outdir, comake_pathname, comake_relname = self.filenames()
            if comake_relname != link:
                os.unlink(self.pathname)
                os.symlink(comake_relname, self.pathname)
            
        if not os.path.exists(self.pathname):
            rebuild_target = True
            rebuild_reason = "target requires creation"
        else:
            my_mtime = self.mtime()
            others_mtime = [tinput.mtime() for tinput in self.inputs]
            if others_mtime:
                max_others_mtime = max(others_mtime)
                if max_others_mtime > my_mtime:
                    rebuild_target = True
                    rebuild_reason = "target is older than dependencies"

        if not rebuild_target:
            if builds:
                rebuild_target = True
                rebuild_reason = "dependencies were rebuilt"

        if not rebuild_target:
            if self.tool.rebuild_needed(self):
                rebuild_target = True
                rebuild_reason = "rebuilding required by tool"

        if rebuild_target:
            if not self.tool.EMPTY:
                reporter.print_title()
                reporter.print_text("Building: %s" % (rebuild_reason, ))
            self._make(reporter)
            builds += 1

        self.built = True
        return builds
开发者ID:matt81093,项目名称:Original-Colinux,代码行数:60,代码来源:target.py


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