本文整理汇总了Python中pushmaster.taglib.T.ul方法的典型用法代码示例。如果您正苦于以下问题:Python T.ul方法的具体用法?Python T.ul怎么用?Python T.ul使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pushmaster.taglib.T
的用法示例。
在下文中一共展示了T.ul方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get
# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import ul [as 别名]
def get(self, datestr=None):
if datestr:
from_date, to_date = report_date_range(datestr)
else:
for_date = last_monday_datetime() - datetime.timedelta(days=7)
return self.redirect('/lastweek/' + for_date.strftime('%Y%m%d'))
pushes = query.pushes_for_the_week_of(from_date)
requests = []
for push in pushes:
requests.extend(query.push_requests(push))
requests = sorted(requests, key=lambda r: r.mtime)
doc = common.Document(title='pushmaster: weekly report: ' + datestr)
teams_list = T.ul(class_='teams')
doc(teams_list)
nothing_messages_list = None
for team in config.report_users:
team_item = T.li(class_='team')(T.h3(team['name']))
teams_list(team_item)
devs_list = T.ul(class_='devs')
team_item(devs_list)
for dev in sorted(team['dev']):
dev_item = T.li(class_='dev')(T.h4(dev))
devs_list(dev_item)
dev_requests = filter(lambda r: r.owner.nickname() == dev, requests)
if dev_requests:
requests_list = T.ol(class_='requests')(map(common.request_item, dev_requests))
dev_item(requests_list)
else:
# lazy (re)initialize random messages
if not nothing_messages_list:
nothing_messages_list = list(config.nothing_messages)
import random
random.shuffle(nothing_messages_list)
dev_item(T.div(nothing_messages_list.pop(), class_='nothing'))
if 'prod' in team:
team_item(T.h4('PM: ' if len(team['prod']) == 1 else 'PMs: ', ', '.join(team['prod']), class_='pm'))
doc.serialize(self.response.out)