跳转到主要内容

ZOPYX SmartPrintNG Server

项目描述

zopyx.smartprintng.server

zopyx.smartprintng.server是一个基于Pyramid的服务器实现,实现了Produce & Publish平台的服务器端功能。它被称为Produce & Publish Server

需求

  • Python 2.6, 2.7(不支持Python 3)

安装

  • 创建一个virtualenv环境(Python 2.6)- 在您的当前(空)目录中,或者让virtualenv为您创建一个。 (easy_install virtualenv如果您的系统上没有virtualenv)

    virtualenv --no-site-packages .

    或者

    virtualenv --no-site-packages smartprintng
  • 安装SmartPrintNG服务器

    bin/easy_install zopyx.smartprintng.server
  • 创建一个server.ini配置文件(并根据您的需要进行修改)

    [DEFAULT]
    debug = true
    
    [app:main]
    use = egg:zopyx.smartprintng.server#app
    reload_templates = true
    debug_authorization = false
    debug_notfound = false
    
    [server:main]
    use = egg:Paste#http
    host = 127.0.0.1
    port = 6543
  • 启动服务器(前台)

    bin/pserve server.ini
  • 或者后台启动

    bin/pserve server.ini  --daemon

升级

要升级现有的SmartPrintNG服务器,您应该在您的virtualenv环境中尝试以下操作

bin/easy_install -U zopyx.smartprintng.server
bin/easy_install -U zopyx.convert2

XMLRPC API

SmartPrintNG服务器通过XMLRPC公开了几个方法

def convertZIP(auth_token, zip_archive, converter_name):
    """ 'zip_archive' is ZIP archive (encoded as base-64 byte string).
        The archive must contain exactly *one* HTML file to be converted
        including all related resources like stylesheets and images.
        All files must be stored flat within the archive (no subfolders).
        All references to externals resources like the 'src' attribute
        of the IMG tag or references to the stylesheet(s) must use
        relative paths. The method returns the converted output file
        also as base64-encoded ZIP archive.
    """

def convertZIPEmail(auth_token, context, zip_archive, converter_name='pdf-prince',
                    sender=None, recipient=None, subject=None, body=None):
    """ Similar to convertZIP() except that this method will send the
        converted output document to a recipient by email. 'subject' and
        'body' parameters *must* be utf-8 encoded.
    """

def availableConverters():
    """ Returns a list of available converter names on the
        SmartPrintNG backend.
    """

def authenticate(username, password):
    """ Log into the server. Returns an auth_token. authenticate()
        must be called before calling any of the methods above.
    """

def ping():
    """ says 'pong' - or something similar """

电子邮件配置

要通过convertZIPEmail()使用电子邮件支持,电子邮件服务器必须通过一个专门的配置文件进行配置。一个email.ini可能看起来像这样

[mail]
hostname = smtp.gmail.com
username = some_username
password = some_password
force_tls = False
no_tls = False

在启动服务器时,您需要将电子邮件配置文件的名称传递给pserve

bin/pserve server.ini mail_config=/path/to/email.ini

源代码

https://github.com/zopyx/zopyx.smartprintng.server/

错误跟踪器

https://github.com/zopyx/zopyx.smartprintng.server/issues

支持

Produce & Publish Server 的支持目前仅限于项目基础。

联系

ZOPYX 有限公司
Hundskapfklinge 33
D-72074 Tuebingen, 德国
www.zopyx.com

变更日志

1.1.2 (2012/10/14)

  • 文档更新

1.1.1 (2012/02/03)

  • 更好的自测试页面(更多文本,一些图片)

  • 更新依赖项

1.1.0 (2011/08/22)

  • 与 Pyramid 1.1 兼容

1.0.1 (2011/01/30)

  • 与 Pyramid 1.0b3+ 兼容

1.0.0 (2011/01/16)

  • 最终版本

  • 修复测试固定装置

0.7.1 (2011/01/10)

  • 锁定 pyramid_xmlrpc 0.1

0.7.0 (2010/12/11)

  • 转换为 Pyramid

0.6.7 (2010/07/18)

  • 调整公司名称

0.6.6 (2010/05/15)

  • 将转换结果包含到 ZIP 文件中

0.6.5 (2010/02/04)

  • 修复清理代码中的竞态条件

0.6.4 (2009/12/25)

  • 小修

  • 文档清理

0.6.3 (2009/11/29)

  • 与 BFG 1.2 兼容

0.6.1 (2009/10/04)

  • 修复清理 spool_directory 代码中的错误

0.6.0 (2009/09/15)

  • 身份验证和授权支持

0.5.2 (2009/09/05)

  • 调整到最新 zopyx.convert2 版本

0.6.0 (2009/09/15)

  • 添加身份验证和授权支持

0.5.2 (2009/09/05)

  • 调整到最新 zopyx.convert2 版本

0.5.1 (2009/08/01)

  • 添加 convertZIPandRedirect() 方法

  • 添加 deliver() 方法

  • 将 base.ServerCore 移至 models.py

  • 交付的文件必须小于 'delivery_max_age' 秒

  • 清理代码

  • 内部重构

  • 更多测试

0.5.0 (2009/07/23)

  • 现在需要 Python 2.6

0.4.3 (2009/07/22)

  • 删除大部分 ZCML 配置

  • 测试,测试,测试

0.4.2 (2009/07/19)

  • 切换回 zope.sendmail

  • 在 zope.sendmail 上实现异步邮件交付

0.4.1 (2009/07/19)

  • 使用 repoze.sendmail

0.4.0 (2009/07/19)

  • 添加 convertZIPEmail() API

0.3.4 (2009/07/13)

  • 更新文档

0.3.3 (2009/07/12)

  • 修复 HTML 文件中缺少 BASE 标签的问题

0.3.2 (2009/07/12)

  • 更好的日志记录

0.3.1 (2009/07/08)

  • 自 8MB 对我们来说太小以来,已禁用 parse_xmlrpc_request() 中请求最大大小的检查

0.3.0 (2009/07/06)

  • 切换到 repoze.bfg

0.2.0 (2009/07/06)

  • 改进临时目录的处理

0.1.2 (2009/07/05)

  • 改进临时目录的处理

0.1.1 (2009/07/05)

  • 改进日志记录和错误处理

0.1 (2009/07/05)

  • 初始版本

项目详情


下载文件

下载适用于您平台的文件。如果您不确定选择哪个,请了解更多关于 安装软件包 的信息。

源分发

zopyx.smartprintng.server-1.1.2.zip (44.5 kB 查看散列)

上传时间

由以下支持

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误记录 StatusPage StatusPage 状态页面