本文整理汇总了Python中pushmaster.taglib.T.ol方法的典型用法代码示例。如果您正苦于以下问题:Python T.ol方法的具体用法?Python T.ol怎么用?Python T.ol使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pushmaster.taglib.T
的用法示例。
在下文中一共展示了T.ol方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get
# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import ol [as 别名]
def get(self, email):
email = urllib.unquote_plus(email)
doc = common.Document(title='pushmaster: recent activity: ' + email)
doc.body(T.div(class_='bookmarklet')(common.bookmarklet(self.hostname)))
user = users.User(email)
requests = query.requests_for_user(user)
pushes = query.pushes_for_user(user)
if requests:
doc.body(
T.h3('Recent Requests'),
T.ol(class_='my requests')(map(request_item, requests)),
)
if pushes:
doc.body(
T.h3('Recent Pushes'),
T.ol(class_='pushes')(map(push_item, pushes)),
)
doc.serialize(self.response.out)
示例2: get
# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import ol [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)
示例3: get
# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import ol [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)
示例4: get
# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import ol [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)
示例5: get
# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import ol [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)
示例6: push_item
# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import ol [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.'),
)
示例7: push_pending_list
# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import ol [as 别名]
def push_pending_list(push, requests):
is_push_owner = users.get_current_user() == push.owner
def request_item(request):
li = common.request_item(request)
if is_push_owner:
li.children.insert(0, T.div(class_='actions')(
T.form(class_='small', action=request.uri, method='post')(
T.div(class_='fields')(
T.button(type='submit')('Accept'),
common.hidden(push=str(push.key()), act='accept')),
),
T.span('or', class_='sep'),
reject_request_link(request),
),
)
return li
ol = T.ol(class_='requests')
if requests:
ol(map(request_item, requests))
return ol
示例8: accepted_list
# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import ol [as 别名]
def accepted_list(accepted, request_item=common.request_item, state=''):
return T.ol(class_=' '.join(['requests', state]))(map(request_item, accepted))
示例9: request_list
# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import ol [as 别名]
def request_list(requests):
return T.ol(class_='requests')(map(request_item, requests))
示例10: accepted_list
# 需要导入模块: from pushmaster.taglib import T [as 别名]
# 或者: from pushmaster.taglib.T import ol [as 别名]
def accepted_list(accepted, request_item=common.request_item):
return T.ol(class_='accepted requests')(map(request_item, accepted))