python-3.x - genshi snippet reuse uses a hard coded extra tag
问题描述
I have this snippet re-use in genshi and it works fine when I call it
<a py:def="check_nd_data(input)">
<py:choose test="">
<py:when test="input.startswith('test') == False">
<Dt>${input}</Dt>
</py:when>
<py:otherwise>
<NoData>${input}</NoData>
</py:otherwise>
</py:choose>
</a>
As you many understand, the whole point of snippets are to be able to create it once and use it in multiple places. So I dont want the output to have the extra hard coded tag
<a> </a>
before and after the input. How do I achieve this please.
解决方案
推荐阅读
- r - R - Create a column with consecutive numbers and reset based on other column using mutate
- c# - animator.SetTrigger 不触发动画
- microsoft-graph-api - 是否有 API 可用于从 MS Graph Bookings API 检索 Microsoft Bookings 中预订的可用时间段?
- python - Why won't my QFileDialog load its directory or apply filters?
- amazon-web-services - Unknown key Message when using Aws Cloudfront Signed URL With Java
- dart - Dart: A RESTful service responds with correct data, but no object is being added to a List
- command - Exit Python Discord Bot script to command line
- django - 如何将 css 类应用于 Django 中的 TimeDurationWidget
- vaadin - Vaadin 设计器没有生成正确的文件
- php - 当我检索特定数据时,find() 方法和 first() 方法之间哪个最好