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


Python T.a方法代码示例

本文整理汇总了Python中pushmaster.taglib.T.a方法的典型用法代码示例。如果您正苦于以下问题:Python T.a方法的具体用法?Python T.a怎么用?Python T.a使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pushmaster.taglib.T的用法示例。


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

示例1: request_display

# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import a [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:
        div(T.h3(T.span('Branch: '), T.a(request.branch, href=config.git_branch_url % dict(branch=request.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:alanf,项目名称:PushmasterApp,代码行数:34,代码来源:request.py

示例2: request_item

# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import a [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

示例3: funcbar

# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import a [as 别名]
def funcbar():
    bar = T.div(class_='func')(
        T.a(id='new-request', href='#')('Make Request'),
        T.span(class_='sep')('|'),
        T.a(id='new-push', href='#')('Start Push'),
        T.span(class_='sep')('|'),
        T.a(id='details', href='#')(T.span('Show Details', class_='show'), T.span('Hide Details', class_='hide')),
        )
    return bar
开发者ID:alanf,项目名称:PushmasterApp,代码行数:11,代码来源:common.py

示例4: navbar

# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import a [as 别名]
def navbar(current=None):
    nav = T.div(class_='nav')(
        T.a(href='/push/current')(T.span('Current Push')),
        T.span(class_='sep')('|'),
        T.a(href='/requests')('Requests'),
        T.span(class_='sep')('|'),
        T.a(href='/pushes')('Pushes'),
        T.span(class_='sep')('|'),
        T.a(href='/lastweek')('Last Week'),
        )
    return nav
开发者ID:alanf,项目名称:PushmasterApp,代码行数:13,代码来源:common.py

示例5: get

# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import a [as 别名]
    def get(self, datestr):
        from_date, to_date = report_date_range(datestr)

        doc = common.Document(title='pushmaster: reports')
        doc.body(T.h1('Report for ', from_date.strftime('%e %b %Y'), ' - ', to_date.strftime('%e %b %Y')))

        pushes = query.pushes_for_the_week_of(from_date)
        for push in pushes:
            pushdiv = T.div(class_='push')
            pushdiv(T.h2(
                    T.a(href=push.uri)(
                        push.ltime.replace(tzinfo=timezone.UTC()).astimezone(config.timezone).strftime('%a, %l:%M %p, %e %b %Y'),
                        T.span(' '),
                        push.name or '',
                        ), 
                    T.span(' by '),
                    common.display_user_email(push.owner),
                    ))
            reqlist = T.ol(class_='requests')
            for request in query.push_requests(push):
                reqlist(common.request_item(request))
            pushdiv(reqlist)
            doc.body(pushdiv)

        doc.body(common.jquery_js, common.jquery_ui_js, common.pushmaster_js)

        doc.serialize(self.response.out)
开发者ID:wingerz,项目名称:pushmaster,代码行数:29,代码来源:report.py

示例6: session

# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import a [as 别名]
def session():
    user = users.get_current_user()
    div = T.div(class_='session')(
        user_home_link(user),
        T.span(class_='sep')('|'),
        T.a(href=users.create_logout_url('/'))('Logout')
    )
    return div
开发者ID:wingerz,项目名称:pushmaster,代码行数:10,代码来源:common.py

示例7: new_request_form

# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import a [as 别名]
def new_request_form(push=None, subject='', message='', branch=''):
    label = T.a(class_='toggle', href='#')('New Request') if push else 'New Request'
    class_ = 'push request' if push else 'request'
    content = T.div(class_='content')
    form = T.form(action='/requests', method='post', class_=class_)(
        T.fieldset(class_='container')(
            T.legend(label),
            content(
                T.div(
                    T.label(for_='new-request-subject')('Subject'),
                    T.input(name='subject', id='new-request-subject', value=subject),
                    ),
                T.div(
                    T.label(for_='new-request-branch')('Branch'),
                    T.input(name='branch', id='new-request-branch', value=branch),
                    ),
                T.div(
                    T.label(for_='new-request-message')('Message'),
                    T.textarea(name='message', id='new-request-message', rows='40', cols='120')(message),
                    ),
                T.div(
                    T.label(for_='new-request-target-date')('Push Date'),
                    T.input(name='target_date', id='new-request-target-date', class_='date', value=logic.tznow().date().strftime('%Y-%m-%d')),
                    ),
                T.fieldset(class_='flags')(
                    T.legend('Flags'),
                    T.div(
                        T.input(id='new-request-urgent', type='checkbox', name='urgent', class_='checkbox'),
                        T.label(for_='new-request-urgent', class_='checkbox')('Urgent (e.g. P0)'),
                        ),
                    T.div(
                        T.input(id='new-request-tests-pass', type='checkbox', name='tests_pass', class_='checkbox'),
                        T.label(for_='new-request-tests-pass', class_='checkbox')('Passes Buildbot'),
                        ),
                    T.div(
                        T.input(id='new-request-no-testing', type='checkbox', name='no_testing', class_='checkbox'),
                        T.label(for_='new-request-no-testing', class_='checkbox')('No Testing Required'),
                        ),
                    T.div(
                        T.input(id='new-request-push-plans', type='checkbox', name='push_plans', class_='checkbox'),
                        T.label(class_='checkbox', for_='new-request-push-plans')('Push Plans'),
                        ),
                    T.div(
                        T.input(id='new-request-js-serials', type='checkbox', name='js_serials', class_='checkbox'),
                        T.label(class_='checkbox', for_='new-request-js-serials')('Bump Javascript Serials'),
                        ),
                    T.div(
                        T.input(id='new-request-img-serials', type='checkbox', name='img_serials', class_='checkbox'),
                        T.label(class_='checkbox', for_='new-request-img-serials')('Bump Image Serials'),
                        ),
                    ),
                T.button(type='submit')('Create')
                ),
            ),
        )
    if push:
        content(T.input(type='hidden', name='push', value=str(push.key())))
    return form
开发者ID:wingerz,项目名称:pushmaster,代码行数:60,代码来源:common.py

示例8: push_item

# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import a [as 别名]
def push_item(push):
    return T.li(class_='push')(
        T.a(href=push.uri)(
            common.display_datetime(push.ptime),
            T.span(' '),
            T.span(push.name or ''),
            ),
        common.user_home_link(push.owner),
        T.span(class_='state')(common.display_push_state(push)),
    )
开发者ID:wingerz,项目名称:pushmaster,代码行数:12,代码来源:push.py

示例9: edit_request_form

# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import a [as 别名]
def edit_request_form(request):
    request_id = str(request.key())
    return T.form(action=request.uri, method='post', class_='edit request')(
        T.fieldset(class_='container')(
            T.legend(T.a(class_='toggle', href='#')('Edit Request')),
            T.div(class_='content')(
                T.div(
                    T.label(for_='edit-request-subject-'+request_id)('Subject'),
                    T.input(name='subject', id='edit-request-subject-'+request_id, value=request.subject),
                    ),
                T.div(
                    T.label(for_='edit-request-branch-'+request_id)('Branch'),
                    T.input(name='branch', id='edit-request-branch-'+request_id, value=request.branch or ''),
                    ),
                T.div(
                    T.label(for_='edit-request-message-'+request_id)('Message'),
                    T.textarea(name='message', id='edit-request-message-'+request_id)(request.message or ''),
                    ),
                T.div(
                    T.label(for_='edit-request-target-date-'+request_id)('Push Date'),
                    T.input(name='target_date', id='edit-request-target-date-'+request_id, class_='date', value=request.target_date.strftime('%Y-%m-%d') if request.target_date else ''),
                    ),
                T.fieldset(class_='flags')(
                    T.legend('Flags'),
                    T.div(
                        T.input(id='edit-request-urgent-'+request_id, type='checkbox', name='urgent', class_='checkbox', checked=request.urgent),
                        T.label(for_='edit-request-urgent-'+request_id, class_='checkbox')('Urgent (e.g. P0)'),
                        ),
                    T.div(
                        T.input(id='edit-request-tests-pass-'+request_id, type='checkbox', name='tests_pass', checked=request.tests_pass, class_='checkbox'),
                        T.label(for_='edit-request-tests-pass-'+request_id, class_='checkbox')('Passes Buildbot'),
                        ),
                    T.div(
                        T.input(id='edit-request-no-testing-'+request_id, type='checkbox', name='no_testing', checked=request.no_testing, class_='checkbox'),
                        T.label(for_='edit-request-no-testing-'+request_id, class_='checkbox')('No Testing (batch-only)'),
                        ),
                    T.div(
                        T.input(id='edit-request-push-plans-'+request_id, type='checkbox', name='push_plans', checked=request.push_plans, class_='checkbox'),
                        T.label(for_='edit-request-push-plans-'+request_id, class_='checkbox')('Push Plans'),
                        ),
                    T.div(
                        T.input(id='edit-request-js-serials-'+request_id, type='checkbox', name='js_serials', checked=request.js_serials, class_='checkbox'),
                        T.label(for_='edit-request-js-serials-'+request_id, class_='checkbox')('Bump Javascript Serials'),
                        ),
                    T.div(
                        T.input(id='edit-request-img-serials-'+request_id, type='checkbox', name='img_serials', checked=request.img_serials, class_='checkbox'),
                        T.label(for_='edit-request-img-serials-'+request_id, class_='checkbox')('Bump Image Serials'),
                        ),
                    ),
                T.div(
                    T.button(type='submit', name='act', value='edit')('Save'),
                    ),
                ),
            ),
        )
开发者ID:wingerz,项目名称:pushmaster,代码行数:57,代码来源:request.py

示例10: push_item

# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import a [as 别名]
def push_item(push):
    requests = query.push_requests(push)
    return T.li(class_='push')(
        T.div(
            common.display_datetime(push.ptime),
            T.a(href=push.uri)(push.name or 'push'),
            common.user_home_link(push.owner, logic.user_info(push.owner)),
            T.span(class_='state')(common.display_push_state(push)),
            class_='headline',
            ),
        T.ol(map(common.request_item, requests)) if requests else T.div('No requests.'),
    )
开发者ID:Yelp,项目名称:PushmasterApp,代码行数:14,代码来源:push.py

示例11: request_item

# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import a [as 别名]
def request_item(request):
    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),
        ' ',
        T.span(class_='verify')(request.time_to_verify),
        )

    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'

    if request.branch and '/' in request.branch:
        repo, _, branch = request.branch.partition('/')
        repo = 'devs/%s.git' % repo
    else:
        repo, branch = 'yelp-main.git', request.branch

    request_branch = T.a(request.branch, class_='branch', href=config.git_branch_url % dict(repo=repo,branch=branch))
    li(
        ' ',
        request_badges(request),
        ' ',
        request_branch,
        ' ',
        T.div(linkify(request.message), class_='message'),
        )

    return li
开发者ID:Yelp,项目名称:PushmasterApp,代码行数:42,代码来源:common.py

示例12: request_item

# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import a [as 别名]
def request_item(request):
    li = T.li(class_='request')(
        display_date(request.target_date),
        T.span(class_='email')(T.a(href=urls.user_home(request.owner))(request.owner.nickname())),
        T.a(href=request.uri, class_='request-subject')(request.subject),
        )

    if request.target_date > logic.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))

    return li
开发者ID:wingerz,项目名称:pushmaster,代码行数:24,代码来源:common.py

示例13: navbar

# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import a [as 别名]
def navbar(current=None):
    nav = T.div(class_='nav')(
        T.a(id='new-request', href='#')('Make Request'),
        T.span(class_='sep')('|'),
        T.a(id='new-push', href='#')('Start Push'),
        T.span(class_='sep')('|'),
        T.a(href='/push/current')(T.span('Current Push')),
        T.span(class_='sep')('|'),
        T.a(href='/requests')('Requests'),
        T.span(class_='sep')('|'),
        T.a(href='/pushes')('Pushes'),
        T.span(class_='sep')('|'),
        T.a(href='/reports')('Reports'),
        T.span(class_='sep')('|'),
        T.a(href='/lastweek')('Last Week'),
        )
    
    return nav
开发者ID:wingerz,项目名称:pushmaster,代码行数:20,代码来源:common.py

示例14: push_item

# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import a [as 别名]
def push_item(push):
    return T.li(class_='push')(
        T.a(href=push.uri)(common.display_datetime(push.ctime)),
        T.span(common.display_push_state(push)),
        )
开发者ID:wingerz,项目名称:pushmaster,代码行数:7,代码来源:home.py

示例15: reject_request_link

# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import a [as 别名]
def reject_request_link(request):
    return T.a('Reject', class_='reject-request', href=request.uri, title=request.subject)
开发者ID:Yelp,项目名称:PushmasterApp,代码行数:4,代码来源:push.py


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