本文整理汇总了Python中pushmaster.taglib.T类的典型用法代码示例。如果您正苦于以下问题:Python T类的具体用法?Python T怎么用?Python T使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了T类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: take_ownership_form
def take_ownership_form(object):
form = T.form(class_='small', action=object.uri, method='post')(
T.div(class_='fields')(
T.button(type='submit', name='act', value='take_ownership')('Take Ownership'),
),
)
return form
示例2: __init__
def __init__(self, title='pushmaster'):
super(Document, self).__init__()
self.title = T.title(title) if title else T.title()
self.head = T.head(
meta_content_type,
self.title,
favicon,
reset_css,
jquery_ui_css,
pushmaster_css,
)
self.dialogs = T.div(id='dialogs')
request_form = new_request_form()
request_form(id='new-request-form')
self.dialogs(request_form)
push_form = new_push_form()
push_form(id='new-push-form')
self.dialogs(push_form)
reject_form = reject_request_form()
self.dialogs(reject_form)
self.body = T.body(session(), navbar(), self.dialogs)
self.html(self.head, self.body)
示例3: request_display
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
示例4: onstage_request_item
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
示例5: get
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)
示例6: request_actions_form
def request_actions_form(request):
form = T.form(action=request.uri, method='post', class_='request-actions')
if request.state in ('requested', 'rejected'):
form(T.button(type='submit', name='act', value='abandon')('Abandon'))
return form
示例7: get
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)
示例8: get
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)
示例9: session
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
示例10: push_item
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)),
)
示例11: get
def get(self):
requests = query.current_requests()
doc = common.Document(title='pushmaster: requests')
doc.body(
T.h2(('Current Requests (%d)' % len(requests)) if len(requests) > 5 else 'Current Requests'),
common.request_list(requests) if requests else T.span('There are no requests at present.'),
T.div(common.bookmarklet(self.hostname)),
)
doc.serialize(self.response.out)
示例12: accepted_request_item
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
示例13: get
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)
示例14: push_item_full
def push_item_full(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(lambda item: common.request_item(item, full_request=True), requests)) if requests else T.div('No requests.'),
)
示例15: new_push_form
def new_push_form():
return T.form(action='/pushes', method='post', class_='new-push')(
T.div(class_='fields')(
T.input(type='hidden', name='act', value='new_push'),
T.div(T.label(for_='new-push-name')('Name:')),
T.div(T.input(type='text', name='name', class_='push-name', id='new-push-name')),
T.div(T.button(type='submit', class_='submit')('Start New Push')),
),
)