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


Python T.p方法代码示例

本文整理汇总了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
开发者ID:alanf,项目名称:PushmasterApp,代码行数:29,代码来源:common.py

示例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
开发者ID:wingerz,项目名称:pushmaster,代码行数:31,代码来源:request.py

示例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
开发者ID:Yelp,项目名称:PushmasterApp,代码行数:39,代码来源:request.py


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