本文整理汇总了Python中aspen.website.Website.renderer_factories['csv_dump']方法的典型用法代码示例。如果您正苦于以下问题:Python Website.renderer_factories['csv_dump']方法的具体用法?Python Website.renderer_factories['csv_dump']怎么用?Python Website.renderer_factories['csv_dump']使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类aspen.website.Website
的用法示例。
在下文中一共展示了Website.renderer_factories['csv_dump']方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Website
# 需要导入模块: from aspen.website import Website [as 别名]
# 或者: from aspen.website.Website import renderer_factories['csv_dump'] [as 别名]
from gratipay.version import get_version
from gratipay.renderers import csv_dump, jinja2_htmlescaped, eval_, scss
import aspen
from aspen.website import Website
website = Website()
# Configure renderers
# ===================
website.renderer_default = 'unspecified' # require explicit renderer, to avoid escaping bugs
website.renderer_factories['csv_dump'] = csv_dump.Factory(website)
website.renderer_factories['eval'] = eval_.Factory(website)
website.renderer_factories['jinja2_htmlescaped'] = jinja2_htmlescaped.Factory(website)
website.renderer_factories['scss'] = scss.Factory(website)
website.default_renderers_by_media_type['text/html'] = 'jinja2_htmlescaped'
website.default_renderers_by_media_type['text/plain'] = 'jinja2' # unescaped is fine here
website.default_renderers_by_media_type['text/css'] = 'scss'
website.default_renderers_by_media_type['image/*'] = 'eval'
website.renderer_factories['jinja2'].Renderer.global_context = {
# This is shared via class inheritance with jinja2_htmlescaped.
'b64encode': base64.b64encode,
'enumerate': enumerate,
'filter': filter,
'filter_profile_nav': utils.filter_profile_nav,
'float': float,