本文整理汇总了Python中pushmaster.taglib.T.p方法的典型用法代码示例。如果您正苦于以下问题:Python T.p方法的具体用法?Python T.p怎么用?Python T.p使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pushmaster.taglib.T
的用法示例。
在下文中一共展示了T.p方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: request_item
# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import p [as 别名]
def request_item(request, full_request=False):
li = T.li(class_='request clearfix')(
display_date(request.target_date),
T.span(class_='email')(T.a(href=urls.user_home(request.owner))(logic.user_info(request.owner).full_name), ':'),
T.a(href=request.uri, class_='request-subject')(request.subject),
)
if full_request:
li(
T.a(request.branch, href=config.git_branch_url % dict(branch=request.branch)),
T.p(class_='content')(request.message),
)
if request.target_date > util.tznow().date():
li.attrs['class'] += ' future'
if request.urgent:
li.attrs['class'] += ' urgent'
if request.state == 'rejected':
li.attrs['class'] += ' rejected'
if request.owner == users.get_current_user():
li.attrs['class'] += ' own'
li(request_badges(request), T.span(request.branch, class_='branch'), T.div(linkify(request.message), class_='message'))
return li
示例2: request_display
# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import p [as 别名]
def request_display(request, push):
title = T.h2(class_='request-title')(
T.span(class_='subject')(request.subject),
common.user_home_link(request.owner),
common.display_date(request.target_date),
)
div = T.div(class_='request')(title)
if request.branch:
div(T.h3(T.span('Branch: '), T.a(request.branch, href=config.git_branch_url % dict(branch=request.branch))))
if request.reject_reason:
div(
T.h3('Reject Reason:'),
T.p(common.linkify(request.reject_reason), class_='reject-reason'),
)
div(T.div(class_='message')(common.linkify(request.message or '')))
if request.urgent:
title.attrs['class'] += ' urgent'
title(common.request_badges(request))
title(T.span(request.state, class_='state'))
if not push or users.get_current_user() == push.owner:
div(request_actions_form(request))
return div
示例3: request_display
# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import p [as 别名]
def request_display(request, push):
title = T.h2(class_='request-title')(
T.span(class_='subject')(request.subject),
common.user_home_link(request.owner, logic.user_info(request.owner)),
common.display_date(request.target_date),
)
div = T.div(class_='request')(title)
if request.branch:
if '/' in request.branch:
repo, _, branch = request.branch.partition('/')
repo = 'devs/%s.git' % repo
else:
repo, branch = 'yelp-main.git', request.branch
div(T.h3(T.span('Branch: '), T.a(request.branch, href=config.git_branch_url % dict(repo=repo,branch=branch))))
if push:
div(T.h3(T.span('Push: '), T.a('%s %s' % (util.format_datetime(push.ptime), push.name), href=push.uri)))
if request.reject_reason:
div(
T.h3('Reject Reason:'),
T.p(common.linkify(request.reject_reason), class_='reject-reason'),
)
div(T.div(class_='message')(common.linkify(request.message or '')))
if request.urgent:
title.attrs['class'] += ' urgent'
title(common.request_badges(request))
title(T.span(request.state, class_='state'))
if not push or users.get_current_user() == push.owner:
div(request_actions_form(request))
return div