Archive for the 'Uncategorized' Category


simple ZODB performance settings

The use of the database can be optimized by using a bigger cache in the client.

For a single zope instance without a zeo server this can be done by increasing the number of cached objects.

The cache.size parameter in etc/local.conf must be set (default is 5000) :


cache-size 50000
path $DATADIR/Data.fs

The default size of 5000 is no longer usefull for a database with 200000 objects.

For a zeo client it is possible to configurate the client cache memory size :

server localhost:8101 storage 1
# ZEO client cache, in bytes
cache-size 300MB
# Uncomment to have a persistent disk cache
#client zeo1

The size should be set to a high value because otherwise a lot of network traffic is created between zeo and the client, this is also true if the client and zeo is on the same machine using localhost for the connection.

speed up your Apple Mail app

I found a good tipp for fasten up your email application in mac os x with an easy trick:

open Terminal
cd ~/Library/Mail
sqlite3 Envelope\ Index
vacuum subjects;
press Control-D to leave sqlite3

thanks to hawkwings.net for the tipp
http://www.hawkwings.net/2007/03/01/a-faster-way-to-speed-up-mailapp/

Using plone.app.form in Plone 2.5

It’s really nice that so much zope 3 stuff is available already in Plone 2.5 and Five 1.4. I use formlib and plone.app.form with success. I found three issues, but after solving them it works nicely.

  1. I had an “AttributeError: debug” error when trying to use formlib. The cause was that Zope 3 has a debug attribute on requests, while Zope 2 doesn’t. When my widget (in the form) rendered itself, which is zope 3 code, it tried to use the debug attribute on the request, but as the request is a Zope 2 request it couldn’t be found. I fixed this by monkey patching ZPublisher.HTTPRequest and setting the debug attribute to zope.publisher.base.DebugFlags(). I’m told this will be fixed, but as I want this to work now I’ll use the patch for now.
  2. If using latest trunk of plone.app.form one should inherit from Five’s EditForm. In earlier versions one needed to inherit directly from zope.formlib’s EditForm, otherwise you couldn’t save forms. plone.app.form did some monkey patching. I’m glad Daniel Nouri changed this behaviour. One should now inherit from Five’s base classes, not directly from zope.formlib’s base classes.
  3. formlib is supposed to work, but not all widgets are supported. The OrderedMultiSelectWidget is rendering itself and therefore it’s using the Zope 3 page template engine. The Zope 3 page template engine is not supported in Zope 2. When a path expression (which the template for the widget contains) is traversed it tries to adapt to ITraversable. This will not work in Five as this traverses the url, not path expressions. So the solution is to provide another adapter. The result is that the default Zope 3 adapter for traversing path expressions will be used (for input widgets).

<adapter

for=”zope.app.form.browser.interfaces.IInputWidget”
provides=”zope.app.traversing.interfaces.ITraversable”
factory=”zope.app.traversing.adapters.DefaultTraversable”

/>

Not sure if 1 and 3 are still valid for Five 1.5.