zcml:condition的有效条件是什么?

ZCML可以包含表单的条件指令
<configure zcml:condition="installed some.python.package">
    (conditional configuration directives)
</configure>
condition
的表达式语法是什么?是'或'允许?     
已邀请:
我也经常要这样看。语法很简单,我担心
or
不是语法的一部分。 从zope.configuration源代码中的文档中可以看出,语法总是为
verb arguments
,其中动词是
have
not-have
installed
not-installed
之一。
have
not-have
测试注册功能。注册的功能只是一个注册了
<meta:provides feature="something" />
标签的不透明字符串。使用它来标记已包含的内容,而不将其绑定到特定实现。例:
<configure zcml:condition="have apidoc">
    <!-- only when the apidoc feature has been provided -->
</configure>
installed
not-installed
只是尝试导入命名包;如果导入成功,那么
installed
测试。例:
<configure zcml:condition="installed sqlalchemy"> 
    <!-- only when the sqlalchemy module can be imported -->
</configure>
    

要回复问题请先登录注册