本文整理汇总了Python中trac.web.chrome.Chrome.get_email_map方法的典型用法代码示例。如果您正苦于以下问题:Python Chrome.get_email_map方法的具体用法?Python Chrome.get_email_map怎么用?Python Chrome.get_email_map使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类trac.web.chrome.Chrome
的用法示例。
在下文中一共展示了Chrome.get_email_map方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1:
# 需要导入模块: from trac.web.chrome import Chrome [as 别名]
# 或者: from trac.web.chrome.Chrome import get_email_map [as 别名]
if email_cells:
for cell in email_cells:
emails = chrome.format_emails(context.child(resource), cell["value"])
result[cell["index"]] = cell["value"] = emails
row["resource"] = resource
if row_groups:
row_group = row_groups[-1][1]
else:
row_group = []
row_groups = [(None, row_group)]
row_group.append(row)
data.update({"header_groups": header_groups, "row_groups": row_groups, "numrows": numrows})
if format == "rss":
data["email_map"] = chrome.get_email_map()
data["context"] = web_context(req, report_resource, absurls=True)
return "report.rss", data, "application/rss+xml"
elif format == "csv":
filename = "report_%s.csv" % id if id else "report.csv"
self._send_csv(req, cols, authorized_results, mimetype="text/csv", filename=filename)
elif format == "tab":
filename = "report_%s.tsv" % id if id else "report.tsv"
self._send_csv(req, cols, authorized_results, "\t", mimetype="text/tab-separated-values", filename=filename)
else:
p = page if max is not None else None
add_link(
req,
"alternate",
auth_link(req, report_href(format="rss", page=None)),
_("RSS Feed"),
示例2:
# 需要导入模块: from trac.web.chrome import Chrome [as 别名]
# 或者: from trac.web.chrome.Chrome import get_email_map [as 别名]
cell['value'])
result[cell['index']] = cell['value'] = emails
row['resource'] = resource
if row_groups:
row_group = row_groups[-1][1]
else:
row_group = []
row_groups = [(None, row_group)]
row_group.append(row)
data.update({'header_groups': header_groups,
'row_groups': row_groups,
'numrows': numrows})
if format == 'rss':
data['email_map'] = chrome.get_email_map()
data['context'] = web_context(req, report_resource,
absurls=True)
return 'report.rss', data, 'application/rss+xml'
elif format == 'csv':
filename = 'report_%s.csv' % id if id else 'report.csv'
self._send_csv(req, cols, authorized_results, mimetype='text/csv',
filename=filename)
elif format == 'tab':
filename = 'report_%s.tsv' % id if id else 'report.tsv'
self._send_csv(req, cols, authorized_results, '\t',
mimetype='text/tab-separated-values',
filename=filename)
else:
p = page if max is not None else None
add_link(req, 'alternate',