自适应字符串插值
plone.stringinterp的Python项目详细描述
简介
提供使用命名适配器查找的${id}样式字符串插值 变量。这是为了提供一个简单的模板系统 对于plone.app.contentrules这样的客户。
要在上下文中插入字符串,只需遵循以下模式:
from plone.stringinterp.interfaces import IStringInterpolator IStringInterpolator(context)("Here is the title: ${title}")
作为都柏林核心的一部分的变量替换是 与包裹一起提供。提供额外的替代品 提供实现接口的命名适配器。IstringSubstitution 根据你的情况。适配器名称用于查找。
如果需要传递 替换中的自定义消息。