本文整理汇总了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