zc buildout recipe在zope2实例中设置zope.sendmail

iw.recipe.sendmail的Python项目详细描述


代码库:http://ingeniweb.svn.sourceforge.net/svnroot/ingeniweb/iw.recipe.sendmail

Change history

trunk (2008-05-21)

  • xxx [Ingeniweb]

0.2.3 (2008-05-20)

  • Documentation and history fixed

0.2.2 (2008-05-19)

  • Fix #60: create the package-includes directory if it doesn’t exist [encolpe].

0.2.1 (2007-02-09)

  • Auto include zope.sendmail in generated zcml [gawel].

0.2 (2007-02-09)

  • Added username / password options [gawel].

0.1 (2007-02-09)

  • Created recipe with ZopeSkel [gawel].

Detailed Documentation

Supported options

配方支持以下选项:

Zope2位置

A path to a Zope2 instance

名称

The name of the mail queue delivery utility. Default to iw.mailer.

主持人

Your smtp host. Default to localhost.

端口

Yout smtp port. Default to 25.

用户名

Login name if required by smtp server.

密码

Password if required by smtp server

邮件队列

A path to an existing directory to create a mailqueue. Default to var/. Be aware that this need to be an absolute path.

Example usage

The PyPI page for zc.buildout contains documentation about the test environment.

http://pypi.python.org/pypi/zc.buildout#testing-support

下面是一个骨骼医生测试,你可以开始时,建设 你自己的测试。

我们将从创建使用配方的构建开始:

>>> write('buildout.cfg',
... """
... [buildout]
... parts = mailer
...
... [mailer]
... recipe = iw.recipe.sendmail
... zope2location=parts/zope2
... host = smtp.example.com
... """)

模拟zope2部分:

>>> mkdir('parts','zope2')
>>> mkdir('parts','zope2','etc')

运行构建会给我们带来:

>>> print system(buildout)
Installing mailer.
iw.sendmail-configure.zcml: Generated file 'iw.sendmail-configure.zcml'.

并查看结果zcml存根:

>>> cat('parts','zope2','etc','package-includes',
...                           'iw.sendmail-configure.zcml')
<configure
    xmlns="http://namespaces.zope.org/zope"
    xmlns:zcml="http://namespaces.zope.org/zcml">
<BLANKLINE>
    <include package="zope.sendmail" file="meta.zcml" />
<BLANKLINE>
    <configure
        xmlns:mail="http://namespaces.zope.org/mail">
<BLANKLINE>
        <mail:smtpMailer
            name="iw.smtp"
            hostname="smtp.example.com"
            port="25"
            />
<BLANKLINE>
        <mail:queuedDelivery
            name="iw.mailer"
            permission="zope.Public"
            mailer="iw.smtp"
            queuePath="/sample-buildout/var/mailqueue"
            />
    </configure>
<BLANKLINE>
    <configure zcml:condition="installed iw.mailhost">
        <include package="iw.mailhost" />
    </configure>
<BLANKLINE>
</configure>

让我们尝试使用所有参数:

>>> write('buildout.cfg',
... """
... [buildout]
... parts = mailer
...
... [mailer]
... recipe = iw.recipe.sendmail
... zope2location=parts/zope2
... name = mailer
... host = smtp.example2.com
... port = 50
... username = gael
... password = xxx
... mailqueue = ${buildout:directory}
... """)

再次运行构建:

>>> print system(buildout)
Uninstalling mailer.
Installing mailer.
iw.sendmail-configure.zcml: Generated file 'iw.sendmail-configure.zcml'.

并查看结果zcml存根:

>>> cat('parts','zope2','etc','package-includes',
...                           'iw.sendmail-configure.zcml')
<configure
    xmlns="http://namespaces.zope.org/zope"
    xmlns:zcml="http://namespaces.zope.org/zcml">
<BLANKLINE>
    <include package="zope.sendmail" file="meta.zcml" />
<BLANKLINE>
    <configure
        xmlns:mail="http://namespaces.zope.org/mail">
<BLANKLINE>
        <mail:smtpMailer
            name="iw.smtp"
            hostname="smtp.example2.com"
            port="50"
            username="gael"
            password="xxx"
            />
<BLANKLINE>
        <mail:queuedDelivery
            name="mailer"
            permission="zope.Public"
            mailer="iw.smtp"
            queuePath="/sample-buildout/mailqueue"
            />
    </configure>
<BLANKLINE>
    <configure zcml:condition="installed iw.mailhost">
        <include package="iw.mailhost" />
    </configure>
<BLANKLINE>
</configure>

Contributors

英格尼韦布,盖尔·帕斯格里莫德 IngeniWeb、Encolpe degoute

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
来自控制器的java集合引用应用程序?   java无法插入到swagger 2.0文档中常见错误代码的html链接   循环中的java输入不匹配异常   java Spring批处理集成运行并行作业的远程分区   在Android中使用Gson在自定义类的ArrayList中读取java   C++规范化图像描述符OpenCV-java   java Andmore的Android软件包生成器失败,错误与sun/misc/BASE64Encoder相关   如何用java从多部分数据格式创建接收代码   java用文件填充数组   分页如何在Java代码中实现下一步按钮单击?   我们能用泛型参数动态调用Java接口方法吗?   java从另一个项目中定义的类调用静态方法需要为这两个项目添加库   反射:运行时类型信息是否存储在java中?   编写一个Java程序,允许用户输入自己的公式并进行计算   java Tomcat多个webapps文件夹   java比较两个xml文件并向第一个xml文件添加新标记   反射我能用正则表达式在java中找到类的方法吗?