sparc平台中使用的通用工具
sparc.common的Python项目详细描述
SPARC平台常用的常用工具。包括但不限于Zope组件ZCML实用程序。
ZCA配置
-------------BR/>工具,利用SPARC包通常也依赖于Zope组件架构
(http://DOCS.Zop.org/Zop.Dea/Nalr.html)。使用ZCA需要组件配置,BR/> SPARC通过ZCML(http://Github.com/ZopeFortuation /Zop.Deal/Bulb/Mask/DoSs/ZCML .RST)。这简化了您通过zcml创建组件的能力,并让您的应用程序
分析zcml文件以允许它们注册以供查找。
>;>import a.package.that.contains.a.configure.zcml
>;>import another.package.that.contains.a.configure.zcml
>;>从sparc.common import configure
>;>configure([您的.package.that.contains.a.configure.zcml,
…另一个.package.that.contains.a.configure.zcml])
>>>>来自SPARC.common import configure
>;>来自SPARC.common import icallable
>;>来自zope.component import getutility
>;>configure([SPARC.common])
>;>asker=getutility(icallable,“sparc.common.ask撸question”)
>;>answer=asker(u“你好吗?”,required=true,answers={'1':'awesome','2':'ok','3':'not so good'},tries=3)
你好吗?
(1)很棒
(2)好的
(3)不太好
>打印答案
'1'
>sparc.common
==
<0.0.3
+++++++++++
*pypi打包更新
>0.0.2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++
*初始版本
ZCA配置
-------------BR/>工具,利用SPARC包通常也依赖于Zope组件架构
(http://DOCS.Zop.org/Zop.Dea/Nalr.html)。使用ZCA需要组件配置,BR/> SPARC通过ZCML(http://Github.com/ZopeFortuation /Zop.Deal/Bulb/Mask/DoSs/ZCML .RST)。这简化了您通过zcml创建组件的能力,并让您的应用程序
分析zcml文件以允许它们注册以供查找。
>;>import a.package.that.contains.a.configure.zcml
>;>import another.package.that.contains.a.configure.zcml
>;>从sparc.common import configure
>;>configure([您的.package.that.contains.a.configure.zcml,
…另一个.package.that.contains.a.configure.zcml])
>>>>来自SPARC.common import configure
>;>来自SPARC.common import icallable
>;>来自zope.component import getutility
>;>configure([SPARC.common])
>;>asker=getutility(icallable,“sparc.common.ask撸question”)
>;>answer=asker(u“你好吗?”,required=true,answers={'1':'awesome','2':'ok','3':'not so good'},tries=3)
你好吗?
(1)很棒
(2)好的
(3)不太好
>打印答案
'1'
>sparc.common
==
<0.0.3
+++++++++++
*pypi打包更新
>0.0.2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++
*初始版本