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


Python IBox.parms["show_idle"]方法代码示例

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


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

示例1: phase1

# 需要导入模块: from buildbot.status.web.base import IBox [as 别名]
# 或者: from buildbot.status.web.base.IBox import parms["show_idle"] [as 别名]
 def phase1(self, request, sourceNames, timestamps, eventGrid,
            sourceEvents):
     # phase1 rendering: table, but boxes do not overlap
     data = ""
     if not timestamps:
         return data
     lastDate = None
     for r in range(0, len(timestamps)):
         chunkstrip = eventGrid[r]
         # chunkstrip is a horizontal strip of event blocks. Each block
         # is a vertical list of events, all for the same source.
         assert(len(chunkstrip) == len(sourceNames))
         maxRows = reduce(lambda x,y: max(x,y),
                          map(lambda x: len(x), chunkstrip))
         for i in range(maxRows):
             data += " <tr>\n";
             if i == 0:
                 stuff = []
                 # add the date at the beginning, and each time it changes
                 today = time.strftime("<b>%d %b %Y</b>",
                                       time.localtime(timestamps[r]))
                 todayday = time.strftime("<b>%a</b>",
                                          time.localtime(timestamps[r]))
                 if today != lastDate:
                     stuff.append(todayday)
                     stuff.append(today)
                     lastDate = today
                 stuff.append(
                     time.strftime("%H:%M:%S",
                                   time.localtime(timestamps[r])))
                 data += td(stuff, valign="bottom", align="center",
                            rowspan=maxRows, class_="Time")
             for c in range(0, len(chunkstrip)):
                 block = chunkstrip[c]
                 assert(block != None) # should be [] instead
                 # bottom-justify
                 offset = maxRows - len(block)
                 if i < offset:
                     data += td("")
                 else:
                     e = block[i-offset]
                     box = IBox(e).getBox(request)
                     box.parms["show_idle"] = 1
                     data += box.td(valign="top", align="center")
             data += " </tr>\n"
     
     return data
开发者ID:aloisiojr,项目名称:buildbot,代码行数:49,代码来源:waterfall.py


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