用于repoze.zope2 + Plone的Sane建筑物

news/2024/7/10 0:09:07 标签: java, python, vue, 人工智能, 大数据

This is a follow-up to Martin Aspeli’s introduction to repoze and Plone from last year

这是去年以来Martin Aspeli对repoze和Plone的介绍的后续内容

两个建筑的故事 (A Tale of Two Buildouts)

There are two stories going on here, both of which Martin Aspeli recently described in great detail and Chris McDonough tackled last year. For the purposes of this blog entry, I’ll refer to the issue as the “index vs. find-links” conundrum in buildout  (find-links in buildout are equivalent to distribution_links in setuptools).

这里有两个故事, 最近都有马丁·阿斯佩利(Martin Aspeli)详细描述, 去年 则由 克里斯·麦克唐纳 ( Chris McDonough)处理 。 出于本博客条目的目的,我将把这个问题称为构建中的“索引与查找链接”难题(构建中的查找链接等同于setuptools中的distribution_links)。

For those that want strict repeatability, using the index parameter is the clear winner. It simply forces buildout to do the right thing now and forever, by limiting what packages it can select from. For those that want functionality and don’t mind the occasional egg-out-of-whack (i.e. unexpected upgrade), then using the find-links parameter can provide a “sexy” way to get decent results quickly (but may, and probably will, shoot you in the foot later).

对于那些需要严格的可重复性的人来说,使用index参数无疑是赢家。 通过限制它可以选择的软件包,它只是迫使构建现在和永远做正确的事情。 对于那些需要功能并且不介意偶尔出现问题的人(即意外升级),那么使用find-links参数可以提供一种“性感”的方法来快速获得不错的结果(但可能并且可能会在稍后射击您的脚)。

性感但危险 (Sexy, but Dangerous)

Let’s start with the sexy, but with less repeat-ability method first. Using this method we are not specifying our own index. Therefore you are free to add any package from PyPI or plone.org as you see fit. This is essentially why people like this method (the counter argument is that it is simple to add any additional egg you may want to your index, but we’ll get to that later).

让我们从性感开始,但首先要减少重复性方法。 使用这种方法,我们没有指定自己的索引。 因此,您可以根据需要随意从PyPI或plone.org添加任何软件包。 基本上这就是人们喜欢这种方法的原因(counter参数是,将您可能想要的任何其他鸡蛋添加到索引很简单,但是稍后我们会介绍)。

So a simple buildout using this method might look like this:

因此,使用此方法的简单构建可能如下所示:

virtualenv plone; cd plone
bin/easy_install zc.buildout
bin/buildout init
Edit buildout.cfg:
virtualenv plone; cd plone
bin/easy_install zc.buildout
bin/buildout init
Edit buildout.cfg:

A few more steps are required, which we could certainly automate in buildout, but for now I’ll just list them here:

还需要执行一些步骤,我们当然可以在构建过程中使其自动化,但是现在我将在此处列出它们:

  1. bin/mkzopeinstance
  2. bin/addzope2user admin admin
  1. bin / mkzopeinstance
  2. bin / addzope2user admin管理员

Now, the moment we’ve all been waiting for… the fun part!

现在,我们一直在等待……有趣的部分!

  1. bin/paster serve etc/zope2.ini
  1. 箱/粘贴服务等/zope2.ini

You should see something like:

您应该看到类似以下内容:

[aclark@alex-clarks-macbook-pro]~/Developer/plone% bin/paster serve etc/zope2.ini
2009-06-18 22:52:24 INFO Marshall libxml2-python not available. Unable to register libxml2 based marshallers.
2009-06-18 22:52:27 WARNING ZODB.FileStorage Ignoring index for
/Users/aclark/Developer/p3-repoze-2/var/Data.fsDeprecationWarning: zope.app.annotation has moved to
zope.annotation. Import of zope.app.annotation will become
unsupported in Zope 3.5
/Users/aclark/Developer/plone/eggs/zopelib-2.10.7.0-py2.4-macosx-10.5-i386.egg/zope/configuration/xmlconfig.py:323:
  __import__(arguments[0])
------
2009-06-18T22:52:24 INFO Marshall libxml2-python not available. Unable to register libxml2 based marshallers.
------
2009-06-18T22:52:27 WARNING ZODB.FileStorage Ignoring index for /Users/aclark/Developer/plone/var/Data.fs
Starting server in PID 26900.
zserver on port 8080
[aclark@alex-clarks-macbook-pro]~/Developer/plone% bin/paster serve etc/zope2.ini
2009-06-18 22:52:24 INFO Marshall libxml2-python not available. Unable to register libxml2 based marshallers.
2009-06-18 22:52:27 WARNING ZODB.FileStorage Ignoring index for
/Users/aclark/Developer/p3-repoze-2/var/Data.fsDeprecationWarning: zope.app.annotation has moved to
zope.annotation. Import of zope.app.annotation will become
unsupported in Zope 3.5
/Users/aclark/Developer/plone/eggs/zopelib-2.10.7.0-py2.4-macosx-10.5-i386.egg/zope/configuration/xmlconfig.py:323:
  __import__(arguments[0])
------
2009-06-18T22:52:24 INFO Marshall libxml2-python not available. Unable to register libxml2 based marshallers.
------
2009-06-18T22:52:27 WARNING ZODB.FileStorage Ignoring index for /Users/aclark/Developer/plone/var/Data.fs
Starting server in PID 26900.
zserver on port 8080

At this point, you should be able to login to http://localhost:8080/manage and create a Plone site.

此时,您应该能够登录到http:// localhost:8080 / manage并创建一个Plone站点。

Of course, we did a sloppy job here, creating the Zope2 instance in the root of the buildout, etc. It is possible that plone.recipe.zope2install may help us in the future by supporting repoze.zope2 instances (or maybe it does already, I didn’t try).

当然,我们在这里做得很草率,在构建的根目录中创建了Zope2实例, 依此类推。plone.recipe.zope2install将来可能会通过支持repoze.zope2实例来帮助我们(或者也许已经做到了) ,我没有尝试)。

Next up?

接下来呢?

无聊但可重复 (Boring, but Repeatable)

I kid, but this is actually a very serious concern for many people, and rightfully so. The notion that your buildout will work the same today as it does in one year from now may be a strict requirement for your project. If it is, we can accommodate you (I hope) with the “index” buildout that follows. The downside is that *you* can’t control what I put in the index. However, you can certainly create your own index using this technique.

我开玩笑,但这实际上对许多人来说是一个非常严重的关切,理所当然的。 对于您的项目来说,构筑物在今天和一年后一样有效的想法可能是严格的要求。 如果是这样,我们(希望)可以为您提供下面的“索引”扩展。 缺点是*您*无法控制我输入的索引。 但是,您当然可以使用此技术创建自己的索引。

An arguably even simpler buildout using this technique might look like this:

使用这种技术可以说是一个甚至更简单的构建可能看起来像这样:

  1. virtualenv plone; cd plone
  2. bin/easy_install zc.buildout
  3. bin/buildout init
  4. Edit buildout.cfg:
  1. virtualenv plone; cd plone
  2. bin / easy_install zc.buildout
  3. bin / buildout初始化
  4. 编辑buildout.cfg:

结论 (In Conclusion)

Depending on what my needs are, I might choose either of these techniques. We can also hold out for multi-index support in setuptools. That would seemingly make everyone happy. In the meantime, I can tell you I’d definitely reach for a buildout sans custom index first, then ask questions later (i.e. wait for bleeding toes) but that is just me. If people find the “index” technique generally useful, I’d be willing to support package sheperding and index generating with basketweaver. Just let me know. If it really catches on, we could rename http://dist.plone.org/experimental/release/3.3rc3/ to http://dist.plone.org/repoze/release/3.3rc3/. Of course, if anyone objects to this or finds it confusing, I can just as easily remove it (from dist.plone.org).

根据我的需求,我可以选择其中一种技术。 我们也可以在setuptools中支持多索引 。 这似乎会让每个人都开心。 同时,我可以告诉您,我肯定会先达到无Sans自定义索引的构建,然后再问问题(即等待脚趾出血),但这仅是我自己。 如果人们发现“索引”技术通常很有用,我愿意支持使用basketweaver进行软件包打包和索引生成 。 请让我知道。 如果确实流行,我们可以将http://dist.plone.org/experimental/release/3.3rc3/重命名为http://dist.plone.org/repoze/release/3.3rc3/ 。 当然,如果有人反对或发现它令人困惑,我也可以轻松地将其删除(从dist.plone.org中删除)。

Special thanks to Chris McDonough and Martin Aspeli for helping me scratch my itch!

特别感谢Chris McDonough和Martin Aspeli帮助我Martin痒!

Finally, please don’t rely on any of this “in production” yet unless you know what you are doing. I tested these techniques up to the point of starting Zope (via paste) and adding a Plone site, nothing more!

最后,除非您知道自己在做什么,否则请不要依赖任何这种“生产中”的东西。 我测试了这些技术,直到启动Zope(通过粘贴)并添加一个Plone网站,仅此而已!

I, however, am getting a new server next week and will be hosting this site on repoze.zope2 very shortly 😉

但是,下周我将获得一台新服务器,并将很快在repoze.zope2上托管此网站😉

翻译自: https://www.pybloggers.com/2009/06/a-sane-buildout-for-repoze-zope2-plone/


http://www.niftyadmin.cn/n/981622.html

相关文章

修改DNS大幅提高OS X Mavericks(5.29G)升级下载速度(4.1M/s)

2019独角兽企业重金招聘Python工程师标准>>> OS X Mavericks新功能介绍:https://help.apple.com/osx-mavericks/whats-new-from-mountain-lion 苹果的发布会如约而至,除了发布了最新的 macbook pro,ipad air 和 ipad mini 外,还带…

plone 中文文档_帮助改进Plone的API文档

plone 中文文档Sponsor my trip to the Plone Doccom Sprint in California 赞助我的加利福尼亚Plone Doccom Sprint之行 I’m travelling from Washington, DC, USA to Mountain View, CA, USA June 26 – 29 to participate in the 2007 Plone Doccomm Sprint. My main focu…

提高网站优化,需注重哪两个要点

网站优化技术过于的平淡化,换而言之为普通化。导致,所维护的网站处于茫茫的行业大海之中。犹如渺小的沙粒,未能掀起一场尘暴。因此,要想在行业的大军之中,展现一定光彩,势必要做出一定的努力。而如今的搜索…

Powershell Switch 条件

Powershell Switch 条件 6 21 1月, 2012 在 Powershell tagged Powershell教程 / 分支 / 字符串 / 数字 / 条件 by Mooser Lee本文索引[隐藏] 1测试取值范围 1.1没有匹配条件1.2多个条件匹配2比较字符串 2.1大小写敏感2.2使用通配符3同时处理多个值如果语句中有多路分支&…

php开发总结

./configure --prefix/usr/local/php --with-apxs2/usr/local/apache2/bin/apxs --with-mysqlshared,mysqlnd && make -j4 && make install 一、Windows 下环境配置 为了快速入门,不建议初学者在工具上花费大量时间,可以安装整合环境 Z…

链接克隆 完整克隆_对克隆作为蛋感到兴奋

链接克隆 完整克隆Updated for 4.x 更新为4.x I’m really excited about this because it greatly simplifies the development and deployment story for Plone. For example you can now create a Plone buildout.cfg file like this: 我对此感到非常兴奋,因为它…

python学习之路前端-Dom

Dom简介 文档对象模型(Document Object Model,DOM)是一种用于HTML和XML文档的编程接口。它给文档提供了一种结构化的表示方法,可以改变文档的内容和呈现方式。我们最为关心的是,DOM把网页和脚本以及其他的编程语言联系…

Photoshop制作一只可爱的卡通小鸟

这篇photoshop教程介绍卡通小鸟的制作方法。真个制作过程并不复杂。大致了解物体构造以后,然后分开来制作,如把头部,身体,翅膀等分开制作,每一部分注意好高光及暗调的渲染即可。最终效果1、新建一个600 * 600 像素的文…