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


Python T.h1方法代码示例

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


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

示例1: get

# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import h1 [as 别名]
    def get(self):
        doc = common.Document(title='pushmaster: recent pushes')

        pushes = query.open_pushes()

        doc.body(T.h1('Recent Pushes'), T.ol(map(push_item, pushes), class_='requests'))
        doc.serialize(self.response.out)
开发者ID:Yelp,项目名称:PushmasterApp,代码行数:9,代码来源:push.py

示例2: get

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

示例3: get

# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import h1 [as 别名]
 def get(self):
     doc = common.Document(title="pushmaster: today's pushes")
     
     pushes = query.live_pushes_today()
     
     doc.body(T.h1("Today's Pushes"), T.ol(map(push_item_full, pushes)))
     self.dispatch_daily_push_report_email(doc)
     doc.serialize(self.response.out)
开发者ID:alanf,项目名称:PushmasterApp,代码行数:10,代码来源:push.py

示例4: get

# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import h1 [as 别名]
    def get(self):
        doc = common.Document(title='pushmaster: pushes')
        
        pushes = query.open_pushes()

        push_list = T.ol(map(push_item, pushes))
        
        doc.body(T.h1('Recent Pushes'))
        doc.body(push_list)
        doc.body(common.jquery_js, common.jquery_ui_js, common.pushmaster_js)
        doc.serialize(self.response.out)
开发者ID:wingerz,项目名称:pushmaster,代码行数:13,代码来源:push.py

示例5: render_push_div

# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import h1 [as 别名]
    def render_push_div(self, current_user, push, requests, pending_requests):
        push_div = T.div(class_='push')

        if current_user == push.owner:
            push_div(push_actions_form(push, requests)(class_='small push-action'))
        elif push.can_change_owner:
            push_div(common.take_ownership_form(push)(class_='small push-action'))

        header = T.h1(common.display_datetime(push.ptime), T.span(class_='name')(push.name or ''), common.user_home_link(push.owner, logic.user_info(push.owner)))

        if any(request.push_plans for request in requests):
            header(common.push_plans_badge())

        if any(request.js_serials for request in requests):
            header(common.js_serials_badge())

        if any(request.img_serials for request in requests):
            header(common.img_serials_badge())

        push_div(header)
        requests_div = T.div(class_='requests')
        push_div(requests_div)

        def requests_with_state(state):
            return filter(lambda r: r.state == state, requests)

        if push.state == 'live':
            requests_div(accepted_list(requests_with_state('live'), state='live'))
        else:
            def onstage_request_item(request):
                li = common.request_item(request)
                if current_user == push.owner:
                    li.children.insert(0, T.div(class_='actions')(mark_tested_form(request), T.span('or', class_='sep'), withdraw_form(request)))
                elif current_user == request.owner:
                    li.children.insert(0, T.div(class_='actions')(mark_tested_form(request)))
                return li

            def withdrawable_request_item(request):
                li = common.request_item(request)
                if current_user == push.owner:
                    li.children.insert(0, T.div(class_='actions')(withdraw_form(request)))
                return li

            def accepted_request_item(request):
                li = common.request_item(request)
                if current_user == push.owner:
                    li.children.insert(0, T.div(class_='actions')(
                            mark_checked_in_form(request),
                            T.span('or', class_='sep'),
                            withdraw_form(request),
                            T.span('or', class_='sep'),
                            reject_request_link(request),
                            ))
                return li

            request_states = [
                ('Verified on Stage', 'tested', withdrawable_request_item),
                ('On Stage (%s)' % push.stage, 'onstage', onstage_request_item),
                ('Checked In', 'checkedin', withdrawable_request_item),
                ('Accepted', 'accepted', accepted_request_item),
                ]
            for label, state, request_item in request_states:
                subrequests = requests_with_state(state)
                if subrequests:
                    if len(subrequests) > 5:
                        label = '%(label)s (%(count)d)' % {'label': label, 'count': len(subrequests)}
                    requestors = ', '.join(set(request.owner.nickname() for request in subrequests))
                    label = '%(label)s - %(requestors)s' % {'label': label, 'requestors': requestors}
                    requests_div(T.h3(label), accepted_list(subrequests, request_item=request_item, state=state))

        if current_user == push.owner:
            accepted_requests = requests_with_state('accepted')
            if accepted_requests:
                requests_div(T.div('cherry-pick-branches %s' % (' '.join(['"%s"' % request.branch for request in accepted_requests if request.branch]),), class_='code'))

        if push.editable:
            if pending_requests:
                pending_requests_title = ('Pending Requests (%d)' % len(pending_requests)) if len(pending_requests) > 5 else 'Pending Requests'
                push_div(T.h2(class_='pending')(pending_requests_title), push_pending_list(push, pending_requests))

        return push_div
开发者ID:Yelp,项目名称:PushmasterApp,代码行数:83,代码来源:push.py


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