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


Python T.li方法代码示例

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


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

示例1: request_item

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

# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import li [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)
开发者ID:wingerz,项目名称:pushmaster,代码行数:49,代码来源:report.py

示例3: push_item

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

示例4: push_item

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

示例5: request_item

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

示例6: request_item

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

示例7: push_item

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


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